diff --git a/.eslintrc.json b/.eslintrc.json index af1b97849b6..6920cc47121 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -231,10 +231,13 @@ "*.json5" ], "extends": [ - "plugin:jsonc/recommended-with-jsonc" + "plugin:jsonc/recommended-with-json5" ], "rules": { - "no-irregular-whitespace": "error", + // The ESLint core no-irregular-whitespace rule doesn't work well in JSON + // See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html + "no-irregular-whitespace": "off", + "jsonc/no-irregular-whitespace": "error", "no-trailing-spaces": "error", "jsonc/comma-dangle": [ "error", diff --git a/.github/actions/import-db/action.yml b/.github/actions/import-db/action.yml index 2b74e9b5675..15c3b355089 100644 --- a/.github/actions/import-db/action.yml +++ b/.github/actions/import-db/action.yml @@ -14,6 +14,10 @@ inputs: description: 'location of assetstore folder' required: false type: string + ADMIN_PASSWORD: + description: 'Admin password for DSpace' + required: true + type: string runs: using: "composite" @@ -42,6 +46,8 @@ runs: DB5NAME: dspace-import-db5 DB7PORT: 543${{ inputs.INSTANCE }} BEURL: http://dev-5.pc:8${{ inputs.INSTANCE }}/repository/server/api + BEUSERNAME: dspace.admin.dev@dataquest.sk + BEUSERPASSWORD: ${{ inputs.ADMIN_PASSWORD }} run: | docker stop $DB5NAME || true echo "=====" @@ -78,6 +84,8 @@ runs: args=( --resume=false --config=backend.endpoint=$BEURL + --config=backend.user=$BEUSERNAME + --config=backend.password=$BEUSERPASSWORD --config=db_dspace_7.port=$DB7PORT --config=db_dspace_5.port=$DB5PORT --config=db_utilities_5.port=$DB5PORT diff --git a/.github/disabled-workflows/deploy.yml b/.github/disabled-workflows/deploy.yml index a027cccabd7..e6104dc8775 100644 --- a/.github/disabled-workflows/deploy.yml +++ b/.github/disabled-workflows/deploy.yml @@ -44,6 +44,8 @@ jobs: env: INSTANCE: '5' ENVFILE: /opt/dspace-envs/.env.dspace.dev-5 + ADMIN_PASSWORD: ${{ secrets.DSPACE_ADMIN_PASSWORD }} + USER_PASSWORD: ${{ secrets.DSPACE_USER_PASSWORD }} steps: - uses: actions/checkout@v4 @@ -73,6 +75,8 @@ jobs: # disable TSL checks = allowing to cooperate with https backend with invalid # certificate ENVFILE: /opt/dspace-envs/.env.dspace.imported.dev-5 + ADMIN_PASSWORD: ${{ secrets.DSPACE_ADMIN_PASSWORD }} + USER_PASSWORD: ${{ secrets.DSPACE_USER_PASSWORD }} steps: - uses: actions/checkout@v4 @@ -95,9 +99,6 @@ jobs: ## !!!!! please remove this section if you do not want handle server !!!!!!! echo "=====" echo "installing handle server" - docker exec dspace${INSTANCE} apt update - docker exec dspace${INSTANCE} apt install host -y - echo "installed host from apt" docker exec dspace${INSTANCE} /dspace/bin/make-handle-config echo "made handle config:" docker exec dspace${INSTANCE} cat /dspace/handle-server/config.dct @@ -122,6 +123,7 @@ jobs: DATADIR: /opt/dspace-data/clarin-dspace/ ASSETSTORE: /opt/dspace-data/clarin-dspace/assetstore/ LOGDIR: /log/ + ADMIN_PASSWORD: ${{ secrets.DSPACE_ADMIN_PASSWORD }} - name: dspace basic command run: | @@ -150,44 +152,15 @@ jobs: docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace healthcheck -v" playwright-after-deploy8: - runs-on: dspace-test-1 needs: deploy-8 - timeout-minutes: 45 if: '!inputs.IMPORT' - steps: - - name: Checkout Playwright tests - uses: actions/checkout@v4 - with: - repository: dataquest-dev/dspace-ui-tests - path: dspace-ui-tests - token: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }} - - - name: Checkout main repository - uses: actions/checkout@v4 - with: - path: this-repository - - - name: Copy customer config to UI tests repository for merging - run: | - cp this-repository/config/config.lindat.ui.tests.json dspace-ui-tests/customer-constants/ - - - name: test - working-directory: dspace-ui-tests/scripts - env: - HOME_URL: https://dev-5.pc:8443/repository/ - NAME: LINDAT - run: | - ./test.sh - - - uses: mazoea/ga-maz/end@master - with: - CHOWN_DIR: ./ - if: ${{ always() }} + uses: ./.github/workflows/playwright-tests.yml + secrets: inherit rest-tests-after-deploy8: runs-on: ubuntu-latest needs: playwright-after-deploy8 - timeout-minutes: 45 + timeout-minutes: 120 steps: - name: run rest-tests run: | @@ -219,44 +192,15 @@ jobs: playwright-after-import8: - runs-on: dspace-test-1 needs: import-8 if: inputs.IMPORT - timeout-minutes: 45 - steps: - - name: Checkout Playwright tests - uses: actions/checkout@v4 - with: - repository: dataquest-dev/dspace-ui-tests - path: dspace-ui-tests - token: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }} - - - name: Checkout main repository - uses: actions/checkout@v4 - with: - path: this-repository - - - name: Copy customer config to UI tests repository for merging - run: | - cp this-repository/config/config.lindat.ui.tests.json dspace-ui-tests/customer-constants/ - - - name: test - working-directory: dspace-ui-tests/scripts - env: - HOME_URL: https://dev-5.pc:8443/repository/ - NAME: LINDAT - run: | - ./test.sh - - - uses: mazoea/ga-maz/end@master - with: - CHOWN_DIR: ./ - if: ${{ always() }} + uses: ./.github/workflows/playwright-tests.yml + secrets: inherit rest-tests-after-import8: runs-on: ubuntu-latest needs: playwright-after-import8 - timeout-minutes: 45 + timeout-minutes: 120 steps: - name: run rest-tests run: | diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 76ff6196da6..8efe0f8cf86 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,15 +1,16 @@ -| Phases | MP | MM | MB | MR | JM | Total | -|-----------------|----:|----:|----:|-----:|-----:|-------:| -| ETA | 0 | 0 | 0 | 0 | 0 | 0 | -| Developing | 0 | 0 | 0 | 0 | 0 | 0 | -| Review | 0 | 0 | 0 | 0 | 0 | 0 | -| Total | - | - | - | - | - | 0 | -| ETA est. | | | | | | 0 | -| ETA cust. | - | - | - | - | - | 0 | ## Problem description -### Reported issues -### Not-reported issues + ## Analysis (Write here, if there is needed describe some specific problem. Erase it, when it is not needed.) ## Problems (Write here, if some unexpected problems occur during solving issues. Erase it, when it is not needed.) + +### Sync verification +If en.json5 or cs.json5 translation files were updated: +- [ ] Run `yarn run sync-i18n -t src/assets/i18n/cs.json5 -i` to synchronize messages, and changes are included in this PR. + +### Manual Testing (if applicable) +- [ ] Added to [testing scenarios](https://github.com/dataquest-dev/dspace-customers/issues/55) + +### Copilot review +- [ ] Requested review from Copilot \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f3eb1a5212e..de8de14d8bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,8 @@ on: workflow_dispatch: permissions: - contents: read # to fetch code (actions/checkout) + contents: read # to fetch code (actions/checkout) + packages: read # to fetch private images from GitHub Container Registry (GHCR) jobs: tests: @@ -39,17 +40,22 @@ jobs: DSPACE_CACHE_SERVERSIDE_ANONYMOUSCACHE_MAX: 0 # Tell Cypress to run e2e tests using the same UI URL CYPRESS_BASE_URL: http://127.0.0.1:4000 + # Disable the cookie consent banner in e2e tests to avoid errors because of elements hidden by it + DSPACE_INFO_ENABLECOOKIECONSENTPOPUP: false # When Chrome version is specified, we pin to a specific version of Chrome # Comment this out to use the latest release #CHROME_VERSION: "90.0.4430.212-1" # Bump Node heap size (OOM in CI after upgrading to Angular 15) NODE_OPTIONS: '--max-old-space-size=4096' - # Project name to use when running docker compose prior to e2e tests + # Project name to use when running "docker compose" prior to e2e tests COMPOSE_PROJECT_NAME: 'ci' + # Docker Registry to use for Docker compose scripts below. + # We use GitHub's Container Registry to avoid aggressive rate limits at DockerHub. + DOCKER_REGISTRY: ghcr.io strategy: # Create a matrix of Node versions to test against (in parallel) matrix: - node-version: [16.x, 18.x] + node-version: [18.x, 20.x] # Do NOT exit immediately if one matrix job fails fail-fast: false # These are the actual CI steps to perform per job @@ -119,7 +125,15 @@ jobs: path: 'coverage/dspace-angular/lcov.info' retention-days: 14 - # Using docker compose start backend using CI configuration + # Login to our Docker registry, so that we can access private Docker images using "docker compose" below. + - name: Login to ${{ env.DOCKER_REGISTRY }} + uses: docker/login-action@v3 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Using "docker compose" start backend using CI configuration # and load assetstore from a cached copy - name: Start DSpace REST Backend via Docker (for e2e tests) run: | @@ -183,21 +197,124 @@ jobs: # Get homepage and verify that the tag includes "DSpace". # If it does, then SSR is working, as this tag is created by our MetadataService. # This step also prints entire HTML of homepage for easier debugging if grep fails. - - name: Verify SSR (server-side rendering) + - name: Verify SSR (server-side rendering) on Homepage run: | result=$(wget -O- -q http://127.0.0.1:4000/home) echo "$result" echo "$result" | grep -oE "]*>" | grep Home + # Get a specific community in our test data and verify that the "