Skip to content

Commit

Permalink
Merge branch 'main' into role_module
Browse files Browse the repository at this point in the history
  • Loading branch information
regisoc authored Oct 18, 2023
2 parents 8e65d40 + ded19be commit 348492e
Show file tree
Hide file tree
Showing 343 changed files with 15,871 additions and 4,291 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ babel.config.js

# compiled js ignored since it is run on the jsx directory
modules/*/js/*
!modules/brainbrowser/js/brainbrowser.config.js
!modules/brainbrowser/js/brainbrowser.loris.js
modules/electrophysiology_browser/jsx/react-series-data-viewer/src/protocol-buffers/chunk_pb.js
htdocs/js/components/*

Expand Down
6 changes: 4 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
"jsdoc/require-param-description": "off",
"jsdoc/require-returns": "off",
"jsdoc/require-returns-description": "off",
"jsdoc/check-tag-names": "error"
"jsdoc/check-tag-names": "error",
"jsdoc/check-types": "error"
},
"overrides": [
{
Expand Down Expand Up @@ -199,7 +200,8 @@
"files": [
"modules/candidate_parameters/**",
"modules/dqt/**",
"modules/configuration/jsx/configuration_helper.js"
"modules/configuration/jsx/configuration_helper.js",
"modules/brainbrowser/js/brainbrowser.loris.js"
],
"rules": {
"no-jquery/no-other-utils": "warn",
Expand Down
35 changes: 0 additions & 35 deletions .github/ISSUE_TEMPLATE/module_testing.md

This file was deleted.

202 changes: 199 additions & 3 deletions .github/workflows/loristest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,207 @@ on:
- push
- pull_request

env:
EEG_VIS_ENABLED: 'true'

jobs:
build:
buildjs:
env:
EEG_VIS_ENABLED: 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install EEG package dependencies
# We only need to install protobuf-compiler
# Other deps were added to fix an apt dependency issue introduced by a new github Ubuntu image
# (see https://github.com/actions/runner-images/blob/releases/ubuntu22/20230305/images/linux/Ubuntu2204-Readme.md)
# that updated the list of installed apt packages/apt repositories. That issue may disappear in future Ubuntu images.
run: |
sudo apt install -y imagemagick-6-common libmagickcore-6.q16-6 libmagickwand-6.q16-6 \
libprotobuf-dev libprotobuf23 libprotoc23 protobuf-compiler
cd modules/electrophysiology_browser/jsx/react-series-data-viewer/
protoc protocol-buffers/chunk.proto --js_out=import_style=commonjs,binary:./src/
- name: Install npm modules
run: npm ci

- name: Compile LORIS javascript
run: npm run compile

- name: Create LORIS JS tarball
run: tar cfvz lorisjs.tar.gz htdocs/js/components/ modules/*/js/*

- name: Create node_modules tarball
run: tar cfvz node_modules.tar.gz node_modules

- uses: actions/upload-artifact@v3
name: Upload node_modules artifact
with:
name: node_modules
path: node_modules.tar.gz

- uses: actions/upload-artifact@v3
name: Upload lorisjs.tar.gz artifact
with:
name: lorisjs
path: lorisjs.tar.gz

buildphp:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.2']
steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: zip, php-ast

- name: Validate composer.json and composer.lock
run: composer validate

- name: Cache Composer packages
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Composer cache
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install composer dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-progress --no-suggest

- name: Create vendor tarball
run: tar cfvz vendor-php${{matrix.php}}.tar.gz vendor

- uses: actions/upload-artifact@v3
name: Upload vendor-php${{matrix.php}}.tar.gz artifact
with:
name: vendor-php${{matrix.php}}
path: vendor-php${{matrix.php}}.tar.gz

api:
runs-on: ubuntu-latest
needs:
- buildjs
- buildphp

env:
DB_DATABASE: LorisTest
DB_USER: SQLTestUser
DB_PASSWORD: TestPassword
LORIS_DB_CONFIG: project/config.xml
DOCKER_WEB_SERVER: http://localhost:8000/
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2']
apiversion: ['v0.0.3', 'v0.0.4-dev']
steps:
- uses: actions/checkout@v2

- uses: actions/download-artifact@v3
name: Download node_modules artifact
with:
name: node_modules
path: .

- uses: actions/download-artifact@v3
name: Download compiled LORIS javascript artifact
with:
name: lorisjs
path: .

- uses: actions/download-artifact@v3
name: Download PHP dependencies artifact
with:
name: vendor-php${{matrix.php}}
path: .


- name: Extract node_modules
run: tar xfvz node_modules.tar.gz

- name: Extract compiled JS
run: tar xfvz lorisjs.tar.gz

- name: Extract composer vendor directory
run: tar xfvz vendor-php${{matrix.php}}.tar.gz

- name: Generate VERSION file
run: make VERSION

- name: Setup project/ directory
run: |
mkdir -p project/instruments
cp test/config.xml project/config.xml
cp test/test_instrument/NDB_BVL_Instrument_testtest.class.inc project/instruments/
cp -r raisinbread/instruments/* project/instruments/
sed -i 's/<sandbox>1<\/sandbox>/<sandbox>0<\/sandbox>/g' project/config.xml
sed -i 's/<adminUser>SQLTestUser<\/adminUser>/<adminUser>root<\/adminUser>/g' project/config.xml
sed -i 's/<adminPassword>TestPassword<\/adminPassword>/<adminPassword>root<\/adminPassword>/g' project/config.xml
sed -i 's/<host>db<\/host>/<host>localhost<\/host>/g' project/config.xml
cat project/config.xml
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -uroot -proot
mysql -e "CREATE USER '${{env.DB_USER}}'@'localhost' IDENTIFIED BY '${{env.DB_PASSWORD}}'" -uroot -proot
mysql -e "GRANT UPDATE,INSERT,SELECT,DELETE,CREATE TEMPORARY TABLES ON ${{env.DB_DATABASE}}.* TO '${{env.DB_USER}}'@'localhost'" -uroot -proot
- name: Source default schema and Raisinbread
run: |
mysql ${{ env.DB_DATABASE}} -uroot -proot < SQL/0000-00-00-schema.sql
mysql ${{ env.DB_DATABASE}} -uroot -proot < SQL/0000-00-01-Modules.sql
mysql ${{ env.DB_DATABASE}} -uroot -proot < SQL/0000-00-02-Permission.sql
mysql ${{ env.DB_DATABASE}} -uroot -proot < SQL/0000-00-03-ConfigTables.sql
mysql ${{ env.DB_DATABASE}} -uroot -proot < SQL/0000-00-04-Help.sql
mysql ${{ env.DB_DATABASE}} -uroot -proot < SQL/0000-00-05-ElectrophysiologyTables.sql
find raisinbread/instruments/instrument_sql -name *.sql -exec sh -c "echo Sourcing {}; mysql ${{ env.DB_DATABASE}} -uroot -proot < {}" \;
find raisinbread/RB_files/ -name *.sql -exec sh -c "echo Sourcing {}; mysql ${{ env.DB_DATABASE}} -uroot -proot < {}" \;
- name: Source instrument schemas
run: |
find raisinbread/instruments/instrument_sql -name 0000-*.sql -exec sh -c "echo Sourcing {}; mysql ${{ env.DB_DATABASE}} -uroot -proot < {}" \;
echo Sourcing test/test_instrument/testtest.sql
mysql ${{ env.DB_DATABASE}} -uroot -proot < test/test_instrument/testtest.sql
- name: Set LORIS base path
run: |
echo UPDATE Config SET VALUE=\'`pwd`/\' WHERE ConfigID IN \(SELECT ID FROM ConfigSettings WHERE Name=\'base\'\)
echo UPDATE Config SET VALUE=\'`pwd`/\' WHERE ConfigID IN \(SELECT ID FROM ConfigSettings WHERE Name=\'base\'\) | mysql ${{env.DB_DATABASE}} -uroot -proot
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: zip, php-ast

- name: Start PHP Web Server
run: php -S localhost:8000 -t htdocs/ htdocs/router.php 2>error_log &

- name: Test server
run: |
sleep 1
curl -v http://localhost:8000
- name: Run Test Suite
run: |
vendor/bin/phpunit --configuration test/phpunit.xml --testsuite LorisAPITests --group api-${{ matrix.apiversion }}
- name: Print Error Logs
if: always()
run: cat error_log

docker:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down
58 changes: 51 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ changes in the following format: PR #1234***
- Migrated instrument permissions from config.xml to database and added the ability
to manage instrument permissions in the frontend from the `instrument_manager`
module. (PR #8302)
- new postinstall script that automatically installs /project and eeg-browser additional npm dependencies
when `make` or `npm ci` is executed (PR #8244)


#### Updates and Improvements
- Upgrade react to version 18 (PR #8188)
- Rename subproject to Cohort (PR #7817, applied changes in LORIS-MRI PR #882)
- Create new CohortData and CohortController classes to use as data access model
and transfer object (PR #7817)
Expand All @@ -27,41 +31,77 @@ changes in the following format: PR #1234***
- Fixed the Candidate Age at Death field label and Data Dictionary item for LINST instruments (PR #8362)
- Allow clearing a previously entered consent status in candidate parameters (PR #7772)
- Add code sanitizer before dangerouslySetInnerHTML is used in login to protect against XSS attacks (PR #7491)
- npm package freeze with versionning of `package-lock.json` and switch from `npm install` to `npm ci` (PR #8224)
- New imaging config to set:
- createVisit
- a default project (default_project) used if createVisit or createCandidate is set to true, or for phantom scans
- a default cohort (default_cohort) used if createVisit is set to true (PR #8384)
- Help and help editor reactification (PR #8309)

#### Bug Fixes
- placeholder
- Fix a Fatal error on the Genomic Browser tabs (PR #8468)

### Modules

#### API
- Modified in v0.0.4-dev the candidate instrument data format returned by a GET request or
provided as the body of a PUT/PATCH request. The values of all fields are now defined by
the `Data` key instead of `$InstrumentName` (PR #7857)
- Fix Candidate endpoint error:
The candidates/{CanID} endpoint throws a fatal error if a missing but valid (format pass validation) CanID is provided (PR #8417)


#### Candidate Parameters
- Added date restriction for consent withdrawal so that withdrawal date cannot be earlier
than the given consent response date (PR #8298)

#### EEG Browser
- Visualization:
- Electrode 2D montage: detect if the coordinate space is in the ALS orientation to convert to RAS (nose up)
- Use the optimal signal sampling that fulfills number of chunk displayed < MAX_VIEWED_CHUNKS
- Fixes UI panels open/close glitches
- Fixes UI panels open/close glitches (PR #8238)
- Upgrade codebase to Typescript 4.0 syntax (PR #8211)
- New config (GUI/useEEGBrowserVisualizationComponents) to enable the EEG visualization (PR #8263)
- Annotations: HED tags support (PR #8236)
- Added a SQL table to save any additional task events property data imported through BIDS files (PR #8237)
- Added method to extract from BIDS files in LORIS-MRI (LORIS-MRI PR #873)
- Added SQL tables to save coordinate system data imported through BIDS files (PR #8242)
- Added method to extract from BIDS files in LORIS-MRI (LORIS-MRI PR #885)
- Fix a few issues with EEGLAB set/fdt files:
- Download link broken
- Incorrect placement, it should be logically after the .set file (PR #8323)
- Download All files fails when no annotations exists (PR #8323)
- Clean dependency tree and fix security issues (PR #8486)

#### Instrument Builder
- Fixed display order of select options that were previously ordered alphabetically.
Now the options correctly display in order of how they are defined in the instrument. (PR #8361)

#### Instruments
- Added `postMortem` functionality for LINST instruments, fixing display of 'Candidate Age at Death' when `postMortem` is set to true (PR #8362)
- Added/modified documentation for configuring 'Candidate Age at Death' field display in instruments (PR #8362)

#### Issue Tracker

- Modified username (i.e. user ID) to full names throughout the main table, edit form and history sections (PR #8451)

#### EEG uploader
- New module (PR #8409)

#### Dashboard
- Reactification (PR #8476)

#### MRI violation
- Reactification (PR #7473)
- Fixes links to BrainBrowser from the MRI violations module (PR #8392)
- Remove MRI violation module tabs (PR #8399)
- Fix multiple rows for file protocol violations not resolvable (PR #8661)
- Fix hashing algorithm for `violations_resolved` table's `hash` column (PR #8664)

#### Statistics
- Reactification (PR #8476)

### Tools
- placeholder
- Fix CouchDB_MRI_Importer.php script for PHP > 8.0 (PR #8369)

### Clean Up
- Fixed inconsistency in candidate consent data and history in Raisinbread (PR #8297)
Expand All @@ -72,11 +112,14 @@ SQL schema, and automated testing (PR #8313)
- API: Modified in v0.0.4-dev the candidate instrument data format returned by a GET request or
provided as the body of a PUT/PATCH request. The values of all fields are now defined by
the `Data` key instead of `$InstrumentName` (PR #7857)

- Run the script `tools/single_use/update_violations_resolved_hashes.sql.php` to update hashes
for the `violations_resolved` table according to the new hashing nomenclature. Not doing so
will result in duplication of data in the `violations_resolved` table when users update
a resolution status for a violation.

### Notes For Developers
- placeholder

- Require jsodc comments to have correct `@return` and `@param` values in javascript (PR #8266)
- Disable ESLint on build (prod instances) (PR #8229)



Expand Down Expand Up @@ -105,6 +148,7 @@ the `Data` key instead of `$InstrumentName` (PR #7857)
- Add psr/log to composer (PR #8109)
- Fixed broken DB calls in `assign_missing_instruments` and `instruments` (PR #8162)
- Add support for PHP 8.1 (PR #7989)
- Fix Project tab of Configuration module to give correct errors, and prevent saving without Alias (PR #8349)
### Modules
#### API
- Ability to use PSCID instead of the CandID in the candidates API (PR #8138)
Expand Down
Loading

0 comments on commit 348492e

Please sign in to comment.