Skip to content

Commit

Permalink
Merge branch 'master' into camcops-docker-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
martinburchell committed Aug 5, 2024
2 parents ff05702 + e6be138 commit d45e9cb
Show file tree
Hide file tree
Showing 46 changed files with 2,321 additions and 382 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/cpp_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ ${CAMCOPS_QT6_BASE_DIR}/qt_linux_x86_64_install/bin/qmake ../tablet_qt/tests
make
export QT_DEBUG_PLUGINS=1

find . -path '*/bin/*' -type f -exec {} \;
PYTHON=${HOME}/venv/bin/python
${PYTHON} ${GITHUB_WORKSPACE}/tablet_qt/tools/run_cpp_tests.py --testroot .
8 changes: 7 additions & 1 deletion .github/workflows/cpp-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ on:
- .github/scripts/add_apt_sources.sh
- .github/scripts/change_apt_mirror.sh
- .github/scripts/cpp_tests.sh
- .github/scripts/python_setup.sh
- .github/workflows/cpp-tests.yml
- tablet_qt/qt_version.txt
- tablet_qt/tools/build_qt.py
- tablet_qt/tools/run_cpp_tests.py

jobs:
cpp-tests:
Expand All @@ -26,7 +28,10 @@ jobs:
file: qt.tgz
token: ${{ secrets.GITHUB_TOKEN }}
# The release ID is set by the build-qt.yml action
version: 'tags/untagged-6d2cba07b921fd593071'
# but the tagging is broken somehow. This is brittle
# because editing the release on GitHub will change
# the tag (which isn't a proper tag)
version: 'tags/untagged-b8b360463f95f88e986f'
- name: Install Qt
run: |
set -euxo pipefail
Expand Down Expand Up @@ -113,4 +118,5 @@ jobs:
run: |
set -eux -o pipefail
export CAMCOPS_QT6_BASE_DIR=${HOME}/qt_local_build
${GITHUB_WORKSPACE}/.github/scripts/python_setup.sh
xvfb-run --auto-servernum ${GITHUB_WORKSPACE}/.github/scripts/cpp_tests.sh
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

# Qt
build-*/
*.pro.user
*.pro.user*
*.stash
tablet_qt/.qtc_clangd/
tablet_qt/build/
tablet_qt/Makefile
tablet_qt/tests/build/

# Temporary
*~
Expand Down
1 change: 1 addition & 0 deletions docs/source/autodoc/server/camcops_server/_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ server/camcops_server
tasks/tests/apeq_cpft_perinatal_tests.py.rst
tasks/tests/aq_tests.py.rst
tasks/tests/basdai_tests.py.rst
tasks/tests/bmi_tests.py.rst
tasks/tests/cia_tests.py.rst
tasks/tests/core10_tests.py.rst
tasks/tests/cpft_covid_medical_tests.py.rst
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/server/camcops_server/tasks/tests/bmi_tests.py.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal ([email protected]).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
camcops_server.tasks.tests.bmi_tests
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. automodule:: camcops_server.tasks.tests.bmi_tests
:members:
6 changes: 6 additions & 0 deletions docs/source/autodoc/tablet_qt/_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -956,11 +956,17 @@ tablet_qt
tests/auto/lib/lib.pro.rst
tests/auto/lib/margins/margins.pro.rst
tests/auto/lib/margins/testmargins.cpp.rst
tests/auto/lib/numericfunc/numericfunc.pro.rst
tests/auto/lib/numericfunc/testnumericfunc.cpp.rst
tests/auto/lib/soundfunc/soundfunc.pro.rst
tests/auto/lib/soundfunc/testsoundfunc.cpp.rst
tests/auto/lib/stringfunc/stringfunc.pro.rst
tests/auto/lib/stringfunc/teststringfunc.cpp.rst
tests/auto/qobjects/qobjects.pro.rst
tests/auto/qobjects/strictdoublevalidator/strictdoublevalidator.pro.rst
tests/auto/qobjects/strictdoublevalidator/teststrictdoublevalidator.cpp.rst
tests/auto/qobjects/strictintvalidator/strictintvalidator.pro.rst
tests/auto/qobjects/strictintvalidator/teststrictintvalidator.cpp.rst
tests/auto/qobjects/widgetpositioner/testwidgetpositioner.cpp.rst
tests/auto/qobjects/widgetpositioner/widgetpositioner.pro.rst
tests/auto/questionnairelib/namevalueoptions/namevalueoptions.pro.rst
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/lib/numericfunc/numericfunc.pro.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal ([email protected]).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/lib/numericfunc/numericfunc.pro
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/lib/numericfunc/numericfunc.pro
:language: none
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/lib/numericfunc/testnumericfunc.cpp.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal ([email protected]).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/lib/numericfunc/testnumericfunc.cpp
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/lib/numericfunc/testnumericfunc.cpp
:language: C++
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/qobjects/strictdoublevalidator/strictdoublevalidator.pro.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal ([email protected]).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/qobjects/strictdoublevalidator/strictdoublevalidator.pro
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/qobjects/strictdoublevalidator/strictdoublevalidator.pro
:language: none
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/qobjects/strictdoublevalidator/teststrictdoublevalidator.cpp.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal ([email protected]).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/qobjects/strictdoublevalidator/teststrictdoublevalidator.cpp
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/qobjects/strictdoublevalidator/teststrictdoublevalidator.cpp
:language: C++
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/qobjects/strictintvalidator/strictintvalidator.pro.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal ([email protected]).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/qobjects/strictintvalidator/strictintvalidator.pro
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/qobjects/strictintvalidator/strictintvalidator.pro
:language: none
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. docs/source/autodoc/tablet_qt/tests/auto/qobjects/strictintvalidator/teststrictintvalidator.cpp.rst
.. THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
.. Copyright (C) 2012, University of Cambridge, Department of Psychiatry.
Created by Rudolf Cardinal ([email protected]).
.
This file is part of CamCOPS.
.
CamCOPS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
CamCOPS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.
tablet_qt/tests/auto/qobjects/strictintvalidator/teststrictintvalidator.cpp
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../../../../../../tablet_qt/tests/auto/qobjects/strictintvalidator/teststrictintvalidator.cpp
:language: C++
12 changes: 10 additions & 2 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3921,8 +3921,16 @@ Current C++/SQLite client, Python/SQLAlchemy server
enter the correct password.
https:/ucam-department-of-psychiatry/camcops/issues/353

**Client and server v2.4.20, , IN PROGRESS**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**Client and server v2.4.20, IN PROGRESS**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- Fix the BMI task on both the client and server to avoid a division by zero
error when the user enters a zero height.
https:/ucam-department-of-psychiatry/camcops/issues/366

- Fix bugs in the "strict" validation of double-precision floating-point values
where valid values were being rejected.
https:/ucam-department-of-psychiatry/camcops/issues/368

- Fix the installer to set the SSL options in the config file only if using
HTTPS directly.
36 changes: 23 additions & 13 deletions docs/source/developer/releasing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ Google Play Store release history
| 2.4.18 | 41 (32-bit ARM); | 2.4.18 | 2024-02-08 | 23 | 33 |
| | 42 (64-bit ARM) | | | | |
+---------------+---------------------+---------------------+--------------------+---------+---------+
| 2.4.19 | 47 (32-bit ARM); | 2.4.19 | 2024-06-27 | 23 | 33 |
| | 48 (64-bit ARM) | | | | |
+---------------+---------------------+---------------------+--------------------+---------+---------+


iOS client
Expand Down Expand Up @@ -224,42 +227,49 @@ Build in QtCreator as usual then sign for distribution outside the Apple Store a

.. code-block:: bash
codesign --verify --verbose --timestamp --sign "Developer ID Application: UNIVERSITY OF CAMBRIDGE DEPARTMENT OF PSYCHIATRY (XXXXXXXXXX)" --options runtime camcops.app
/path/to/macos/qt/install/bin/macdeployqt camcops.app -verbose=3 -dmg -no-strip
/path/to/macos/qt/install/bin/macdeployqt camcops.app -always-overwrite -verbose=3 -no-strip -sign-for-notarization="Developer ID Application: UNIVERSITY OF CAMBRIDGE DEPARTMENT OF PSYCHIATRY (XXXXXXXXXX)" -dmg
This should sign with a valid Developer ID certificate, include a secure timestamp and have the hardened runtime enabled.
``macdeployqt`` can also do code signing but doesn't support all the required options, so we do it separately.

To notarize the app with Apple (to prevent malicious software warnings), you
need to know the app-specific password for ``altool`` which was generated at
need to know the app-specific password for ``notarytool`` which was generated at
https://appleid.apple.com/ and then:

.. code-block:: bash
xcrun altool -t osx -f camcops.dmg --primary-bundle-id "uk.ac.cam.psychiatry.camcops.dmg" --notarize-app -u <ACCOUNT OWNER APPLE ID>
xcrun notarytool submit --apple-id <ACCOUNT OWNER APPLE ID> --team-id <ACCOUNT OWNER TEAM ID> camcops.dmg
You will be prompted to enter the app-specific password generated by the account owner.

You can watch the upload progress in the Activity Monitor app (Network tab, look out for ``java`` process after a few minutes).

After the upload has finished, you should see something like:

.. code-block:: bash
No errors uploading 'camcops.dmg'
RequestUUID = 12345678-9abc-def0-1234-56789abcdef0
Submission ID received
id: <some UUID>
Upload progress: 100.00% (39.7 MB of 39.7 MB)
Successfully uploaded file
id: <some UUID>
path: /some/path/camcops.dmg
To check progress:

.. code-block:: bash
xcrun notarytool info --apple-id <ACCOUNT OWNER APPLE ID> --team-id <ACCOUNT OWNER TEAM ID> <the UUID above>
Again use the app-specific password.

You can check progress with:
If notarization failed, try this for more information:

.. code-block:: bash
xcrun altool --notarization-info 12345678-9abc-def0-1234-56789abcdef0 -u <ACCOUNT OWNER APPLE ID>
xcrun notarytool info --apple-id <ACCOUNT OWNER APPLE ID> --team-id <ACCOUNT OWNER TEAM ID> <the UUID above>
Again use the app-specific password.

If notarization failed, follow the link to the log file in a browser to see what the problem was.

If it passed, run this command:
If notarization succeeded, run this command:

.. code-block:: bash
Expand Down
4 changes: 2 additions & 2 deletions server/camcops_server/cc_modules/cc_fhir.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
# Development thoughts
# =============================================================================

_ = """
_ = r"""
Dive into the internals of the HAPI FHIR server
===============================================
Expand Down Expand Up @@ -318,7 +318,7 @@ def elementProperties(self):
The fields are: ``name, jsname, typ, is_list, of_many, not_optional``.
They are validated in FHIRAbstractBase.update_with_json().
""" # noqa
""" # noqa: E501


# =============================================================================
Expand Down
Loading

0 comments on commit d45e9cb

Please sign in to comment.