diff --git a/.eslintrc.json b/.eslintrc.json
index 5fb4c12171..929afa80ab 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -12,7 +12,6 @@
"eslint-plugin-rxjs",
"eslint-plugin-simple-import-sort",
"eslint-plugin-import-newlines",
- "eslint-plugin-jsonc",
"dspace-angular-ts",
"dspace-angular-html"
],
@@ -293,7 +292,9 @@
],
"rules": {
// Custom DSpace Angular rules
- "dspace-angular-html/themed-component-usages": "error"
+ "dspace-angular-html/themed-component-usages": "error",
+ "dspace-angular-html/no-disabled-attribute-on-button": "error",
+ "@angular-eslint/template/prefer-control-flow": "error"
}
},
{
@@ -301,10 +302,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/dependabot.yml b/.github/dependabot.yml
index 2ee321db78..b53e501d29 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -1,12 +1,16 @@
-# Enable Dependabot NPM updates for all dependencies on a weekly basis
+#-------------------
+# DSpace's dependabot rules. Enables npm updates for all dependencies on a weekly basis
+# for main and any maintenance branches. Security updates only apply to main.
+#-------------------
version: 2
updates:
###############
## Main branch
###############
+ # NOTE: At this time, "security-updates" rules only apply if "target-branch" is unspecified
+ # So, only this first section can include "applies-to: security-updates"
- package-ecosystem: "npm"
directory: "/"
- target-branch: main
schedule:
interval: "weekly"
# Allow up to 10 open PRs for dependencies
@@ -68,6 +72,7 @@ updates:
applies-to: version-updates
patterns:
- "@cypress*"
+ - "axe-*"
- "cypress*"
- "jasmine*"
- "karma*"
@@ -76,10 +81,11 @@ updates:
- "minor"
- "patch"
# Group together any testing related security updates
- testing:
+ testing-security:
applies-to: security-updates
patterns:
- "@cypress*"
+ - "axe-*"
- "cypress*"
- "jasmine*"
- "karma*"
@@ -96,7 +102,7 @@ updates:
- "minor"
- "patch"
# Group together any postcss related security updates
- postcss:
+ postcss-security:
applies-to: security-updates
patterns:
- "postcss*"
@@ -112,8 +118,8 @@ updates:
- "minor"
- "patch"
# Group together any sass related security updates
- sass:
- applies-to: version-updates
+ sass-security:
+ applies-to: security-updates
patterns:
- "sass*"
update-types:
@@ -128,7 +134,7 @@ updates:
- "minor"
- "patch"
# Group together any webpack related seurity updates
- webpack:
+ webpack-security:
applies-to: security-updates
patterns:
- "webpack*"
@@ -159,14 +165,6 @@ updates:
update-types:
- "minor"
- "patch"
- # Group together all security updates for Angular. Only accept minor/patch types.
- angular-security:
- applies-to: security-updates
- patterns:
- - "@angular*"
- update-types:
- - "minor"
- - "patch"
# Group together all minor/patch version updates for NgRx in a single PR
ngrx:
applies-to: version-updates
@@ -175,14 +173,6 @@ updates:
update-types:
- "minor"
- "patch"
- # Group together all security updates for NgRx. Only accept minor/patch types.
- ngrx-security:
- applies-to: security-updates
- patterns:
- - "@ngrx*"
- update-types:
- - "minor"
- - "patch"
# Group together all patch version updates for eslint in a single PR
eslint:
applies-to: version-updates
@@ -192,32 +182,12 @@ updates:
update-types:
- "minor"
- "patch"
- # Group together all security updates for eslint.
- eslint-security:
- applies-to: security-updates
- patterns:
- - "@typescript-eslint*"
- - "eslint*"
- update-types:
- - "minor"
- - "patch"
# Group together any testing related version updates
testing:
applies-to: version-updates
patterns:
- "@cypress*"
- - "cypress*"
- - "jasmine*"
- - "karma*"
- - "ng-mocks"
- update-types:
- - "minor"
- - "patch"
- # Group together any testing related security updates
- testing:
- applies-to: security-updates
- patterns:
- - "@cypress*"
+ - "axe-*"
- "cypress*"
- "jasmine*"
- "karma*"
@@ -233,23 +203,7 @@ updates:
update-types:
- "minor"
- "patch"
- # Group together any postcss related security updates
- postcss:
- applies-to: security-updates
- patterns:
- - "postcss*"
- update-types:
- - "minor"
- - "patch"
# Group together any sass related version updates
- sass:
- applies-to: version-updates
- patterns:
- - "sass*"
- update-types:
- - "minor"
- - "patch"
- # Group together any sass related security updates
sass:
applies-to: version-updates
patterns:
@@ -265,14 +219,6 @@ updates:
update-types:
- "minor"
- "patch"
- # Group together any webpack related seurity updates
- webpack:
- applies-to: security-updates
- patterns:
- - "webpack*"
- update-types:
- - "minor"
- - "patch"
ignore:
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
- dependency-name: "*"
@@ -297,14 +243,6 @@ updates:
update-types:
- "minor"
- "patch"
- # Group together all security updates for Angular. Only accept minor/patch types.
- angular-security:
- applies-to: security-updates
- patterns:
- - "@angular*"
- update-types:
- - "minor"
- - "patch"
# Group together all minor/patch version updates for NgRx in a single PR
ngrx:
applies-to: version-updates
@@ -313,14 +251,6 @@ updates:
update-types:
- "minor"
- "patch"
- # Group together all security updates for NgRx. Only accept minor/patch types.
- ngrx-security:
- applies-to: security-updates
- patterns:
- - "@ngrx*"
- update-types:
- - "minor"
- - "patch"
# Group together all patch version updates for eslint in a single PR
eslint:
applies-to: version-updates
@@ -330,32 +260,12 @@ updates:
update-types:
- "minor"
- "patch"
- # Group together all security updates for eslint.
- eslint-security:
- applies-to: security-updates
- patterns:
- - "@typescript-eslint*"
- - "eslint*"
- update-types:
- - "minor"
- - "patch"
# Group together any testing related version updates
testing:
applies-to: version-updates
patterns:
- "@cypress*"
- - "cypress*"
- - "jasmine*"
- - "karma*"
- - "ng-mocks"
- update-types:
- - "minor"
- - "patch"
- # Group together any testing related security updates
- testing:
- applies-to: security-updates
- patterns:
- - "@cypress*"
+ - "axe-*"
- "cypress*"
- "jasmine*"
- "karma*"
@@ -371,14 +281,6 @@ updates:
update-types:
- "minor"
- "patch"
- # Group together any postcss related security updates
- postcss:
- applies-to: security-updates
- patterns:
- - "postcss*"
- update-types:
- - "minor"
- - "patch"
# Group together any sass related version updates
sass:
applies-to: version-updates
@@ -387,31 +289,10 @@ updates:
update-types:
- "minor"
- "patch"
- # Group together any sass related security updates
- sass:
- applies-to: version-updates
- patterns:
- - "sass*"
- update-types:
- - "minor"
- - "patch"
- # Group together any webpack related version updates
- webpack:
- applies-to: version-updates
- patterns:
- - "webpack*"
- update-types:
- - "minor"
- - "patch"
- # Group together any webpack related seurity updates
- webpack:
- applies-to: security-updates
- patterns:
- - "webpack*"
- update-types:
- - "minor"
- - "patch"
ignore:
+ # 7.x Cannot update Webpack past v5.76.1 as later versions not supported by Angular 15
+ # See also https://github.com/DSpace/dspace-angular/pull/3283#issuecomment-2372488489
+ - dependency-name: "webpack"
# Ignore all major version updates for all dependencies. We'll only automate minor/patch updates.
- dependency-name: "*"
update-types: ["version-update:semver-major"]
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b26f5a7c06..e13d8f75d7 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -7,7 +7,8 @@ name: Build
on: [push, pull_request]
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:
@@ -35,6 +36,9 @@ jobs:
NODE_OPTIONS: '--max-old-space-size=4096'
# 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:
@@ -114,6 +118,14 @@ jobs:
path: 'coverage/dspace-angular/lcov.info'
retention-days: 14
+ # 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)
@@ -178,12 +190,84 @@ 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 DSpace
+ # Get a specific community in our test data and verify that the "
" tag includes "Publications" (the community name).
+ # If it does, then SSR is working.
+ - name: Verify SSR on a Community page
+ run: |
+ result=$(wget -O- -q http://127.0.0.1:4000/communities/0958c910-2037-42a9-81c7-dca80e3892b4)
+ echo "$result"
+ echo "$result" | grep -oE "
]*>[^><]*
" | grep Publications
+
+ # Get a specific collection in our test data and verify that the "
" tag includes "Articles" (the collection name).
+ # If it does, then SSR is working.
+ - name: Verify SSR on a Collection page
+ run: |
+ result=$(wget -O- -q http://127.0.0.1:4000/collections/282164f5-d325-4740-8dd1-fa4d6d3e7200)
+ echo "$result"
+ echo "$result" | grep -oE "