Skip to content

Commit 9adc36d

Browse files
author
Andrea Barbasso
committed
Merge remote-tracking branch 'lyrasis/main' into task/main/CST-19328
# Conflicts: # src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.html # src/app/entity-groups/research-entities/metadata-representations/org-unit/org-unit-item-metadata-list-element.component.ts # src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.html # src/app/entity-groups/research-entities/metadata-representations/person/person-item-metadata-list-element.component.ts # src/app/shared/object-list/my-dspace-result-list-element/item-list-preview/item-list-preview.component.html # src/app/shared/object-list/search-result-list-element/item-search-result/item-types/item/item-search-result-list-element.component.html
2 parents a7148e3 + 7b6b000 commit 9adc36d

1,286 files changed

Lines changed: 42101 additions & 20162 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"@angular-eslint/eslint-plugin",
66
"eslint-plugin-import",
77
"eslint-plugin-jsdoc",
8-
"eslint-plugin-deprecation",
98
"unused-imports",
109
"eslint-plugin-lodash",
1110
"eslint-plugin-jsonc",
12-
"eslint-plugin-rxjs",
11+
"@smarttools/rxjs",
1312
"eslint-plugin-simple-import-sort",
1413
"eslint-plugin-import-newlines",
14+
"@stylistic",
1515
"dspace-angular-ts",
1616
"dspace-angular-html"
1717
],
@@ -37,7 +37,7 @@
3737
"plugin:@typescript-eslint/recommended-requiring-type-checking",
3838
"plugin:@angular-eslint/recommended",
3939
"plugin:@angular-eslint/template/process-inline-templates",
40-
"plugin:rxjs/recommended"
40+
"plugin:@smarttools/rxjs/recommended-legacy"
4141
],
4242
"rules": {
4343
"indent": [
@@ -175,15 +175,16 @@
175175
"ignoreParameters": true
176176
}
177177
],
178-
"@typescript-eslint/quotes": [
178+
"@angular-eslint/prefer-inject": "off",
179+
"@stylistic/quotes": [
179180
"error",
180181
"single",
181182
{
182183
"avoidEscape": true,
183184
"allowTemplateLiterals": true
184185
}
185186
],
186-
"@typescript-eslint/semi": "error",
187+
"@stylistic/semi": "error",
187188
"@typescript-eslint/no-shadow": "error",
188189
"@typescript-eslint/dot-notation": "error",
189190
"@typescript-eslint/consistent-type-definitions": "error",
@@ -206,9 +207,9 @@
206207
]
207208
}
208209
],
209-
"@typescript-eslint/type-annotation-spacing": "error",
210+
"@stylistic/type-annotation-spacing": "error",
210211
"@typescript-eslint/unified-signatures": "error",
211-
"@typescript-eslint/ban-types": "error",
212+
"@typescript-eslint/no-restricted-types": "error",
212213
"@typescript-eslint/no-floating-promises": "warn",
213214
"@typescript-eslint/no-misused-promises": "warn",
214215
"@typescript-eslint/restrict-plus-operands": "warn",
@@ -223,6 +224,7 @@
223224
"@typescript-eslint/no-unsafe-call": "off",
224225
"@typescript-eslint/no-unsafe-argument": "off",
225226
"@typescript-eslint/no-unsafe-return": "off",
227+
"@typescript-eslint/no-redundant-type-constituents": "off",
226228
"@typescript-eslint/restrict-template-expressions": "off",
227229
"@typescript-eslint/require-await": "off",
228230
"@typescript-eslint/no-base-to-string": [
@@ -235,7 +237,7 @@
235237
}
236238
],
237239

238-
"deprecation/deprecation": "warn",
240+
"@typescript-eslint/no-deprecated": "warn",
239241

240242
"simple-import-sort/imports": "error",
241243
"simple-import-sort/exports": "error",
@@ -264,7 +266,7 @@
264266
"method"
265267
],
266268

267-
"rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
269+
"@smarttools/rxjs/no-nested-subscribe": "off", // todo: go over _all_ cases
268270

269271
// Custom DSpace Angular rules
270272
"dspace-angular-ts/alias-imports": [
@@ -279,7 +281,7 @@
279281
]
280282
}
281283
],
282-
"dspace-angular-ts/themed-component-classes": "error",
284+
"dspace-angular-ts/no-default-standalone-value": "error",
283285
"dspace-angular-ts/themed-component-selectors": "error",
284286
"dspace-angular-ts/themed-component-usages": "error",
285287
"dspace-angular-ts/themed-decorators": [

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ updates:
1515
schedule:
1616
interval: "monthly"
1717
time: "05:00"
18+
# Allow updates to be delayed for a configurable number of days to mitigate
19+
# some classes of supply chain attacks
20+
cooldown:
21+
default-days: 7
1822
# Allow up to 10 open PRs for dependencies
1923
open-pull-requests-limit: 10
2024
# Group together Angular package upgrades
@@ -101,6 +105,10 @@ updates:
101105
schedule:
102106
interval: "monthly"
103107
time: "05:00"
108+
# Allow updates to be delayed for a configurable number of days to mitigate
109+
# some classes of supply chain attacks
110+
cooldown:
111+
default-days: 7
104112
# Allow up to 10 open PRs for dependencies
105113
open-pull-requests-limit: 10
106114
# Group together Angular package upgrades
@@ -188,6 +196,10 @@ updates:
188196
schedule:
189197
interval: "monthly"
190198
time: "05:00"
199+
# Allow updates to be delayed for a configurable number of days to mitigate
200+
# some classes of supply chain attacks
201+
cooldown:
202+
default-days: 7
191203
# Allow up to 10 open PRs for dependencies
192204
open-pull-requests-limit: 10
193205
# Group together Angular package upgrades
@@ -274,6 +286,10 @@ updates:
274286
schedule:
275287
interval: "monthly"
276288
time: "05:00"
289+
# Allow updates to be delayed for a configurable number of days to mitigate
290+
# some classes of supply chain attacks
291+
cooldown:
292+
default-days: 7
277293
# Allow up to 10 open PRs for dependencies
278294
open-pull-requests-limit: 10
279295
# Group together Angular package upgrades

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
DSPACE_REST_PORT: 8080
2222
DSPACE_REST_NAMESPACE: '/server'
2323
DSPACE_REST_SSL: false
24-
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
24+
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 20+
2525
DSPACE_UI_HOST: 127.0.0.1
2626
DSPACE_UI_PORT: 4000
2727
# Ensure all SSR caching is disabled in test environment
@@ -44,7 +44,7 @@ jobs:
4444
strategy:
4545
# Create a matrix of Node versions to test against (in parallel)
4646
matrix:
47-
node-version: [18.x, 20.x]
47+
node-version: [20.x, 22.x]
4848
# Do NOT exit immediately if one matrix job fails
4949
fail-fast: false
5050
# These are the actual CI steps to perform per job
@@ -114,7 +114,7 @@ jobs:
114114
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
115115
- name: Upload code coverage report to Artifact
116116
uses: actions/upload-artifact@v4
117-
if: matrix.node-version == '18.x'
117+
if: matrix.node-version == '20.x'
118118
with:
119119
name: coverage-report-${{ matrix.node-version }}
120120
path: 'coverage/dspace-angular/lcov.info'

.github/workflows/codescan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
jobs:
2626
analyze:
2727
name: Analyze Code
28-
runs-on: ubuntu-latest
28+
runs-on: ubuntu-slim
2929
# Limit permissions of this GitHub action. Can only write to security-events
3030
permissions:
3131
actions: read

.github/workflows/docker.yml

Lines changed: 115 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,118 @@ jobs:
5757
# Enable redeploy of sandbox & demo if the branch for this image matches the deployment branch of
5858
# these sites as specified in reusable-docker-build.xml
5959
REDEPLOY_SANDBOX_URL: ${{ secrets.REDEPLOY_SANDBOX_URL }}
60-
REDEPLOY_DEMO_URL: ${{ secrets.REDEPLOY_DEMO_URL }}
60+
REDEPLOY_DEMO_URL: ${{ secrets.REDEPLOY_DEMO_URL }}
61+
62+
#################################################################################
63+
# Test Deployment via Docker to ensure newly built images are working properly
64+
#################################################################################
65+
docker-deploy:
66+
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
67+
if: github.repository == 'dspace/dspace-angular'
68+
runs-on: ubuntu-latest
69+
# Must run after all major images are built
70+
needs: [dspace-angular, dspace-angular-dist]
71+
env:
72+
# Override default dspace.server.url & REST 'host' because backend starts at http://127.0.0.1:8080
73+
dspace__P__server__P__url: http://127.0.0.1:8080/server
74+
DSPACE_REST_HOST: 127.0.0.1
75+
# Override default dspace.ui.url to also use 127.0.0.1.
76+
dspace__P__ui__P__url: http://127.0.0.1:4000
77+
steps:
78+
# Checkout our codebase (to get access to Docker Compose scripts)
79+
- name: Checkout codebase
80+
uses: actions/checkout@v4
81+
# Download Docker image artifacts (which were just built by reusable-docker-build.yml)
82+
- name: Download Docker image artifacts
83+
uses: actions/download-artifact@v4
84+
with:
85+
# Download all amd64 Docker images (TAR files) into the /tmp/docker directory
86+
pattern: docker-image-*-linux-amd64
87+
path: /tmp/docker
88+
merge-multiple: true
89+
# Load each of the images into Docker by calling "docker image load" for each.
90+
# This ensures we are using the images just built & not any prior versions on DockerHub
91+
- name: Load all downloaded Docker images
92+
run: |
93+
find /tmp/docker -type f -name "*.tar" -exec docker image load --input "{}" \;
94+
docker image ls -a
95+
# Start backend using our compose script in the codebase.
96+
- name: Start backend in Docker
97+
# MUST use docker.io as we don't have a copy of this backend image in our GitHub Action,
98+
# and docker.io is the only public image. If we ever hit aggressive rate limits at DockerHub,
99+
# we may need to consider making the 'ghcr.io' images public & switch this to 'ghcr.io'
100+
env:
101+
DOCKER_REGISTRY: docker.io
102+
run: |
103+
docker compose -f docker/docker-compose-rest.yml up -d
104+
sleep 10
105+
docker container ls
106+
# Create a test admin account. Load test data from a simple set of AIPs as defined in cli.ingest.yml
107+
- name: Load test data into Backend
108+
run: |
109+
docker compose -f docker/cli.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en
110+
docker compose -f docker/cli.yml -f docker/cli.ingest.yml run --rm dspace-cli
111+
# Verify backend started successfully.
112+
# 1. Make sure root endpoint is responding (check for dspace.name defined in docker-compose.yml)
113+
# 2. Also check /collections endpoint to ensure the test data loaded properly (check for a collection name in AIPs)
114+
- name: Verify backend is responding properly
115+
run: |
116+
result=$(wget -O- -q http://127.0.0.1:8080/server/api)
117+
echo "$result"
118+
echo "$result" | grep -oE "\"DSpace Started with Docker Compose\""
119+
result=$(wget -O- -q http://127.0.0.1:8080/server/api/core/collections)
120+
echo "$result"
121+
echo "$result" | grep -oE "\"Dog in Yard\""
122+
# Start production frontend using our compose script in the codebase.
123+
- name: Start production frontend in Docker
124+
# Specify the GHCR copy of the production frontend, so that we use the newly built image
125+
env:
126+
DOCKER_REGISTRY: ghcr.io
127+
run: |
128+
docker compose -f docker/docker-compose-dist.yml up -d
129+
sleep 10
130+
docker container ls
131+
# Verify production frontend started successfully.
132+
# 1. Make sure /home path has "DSpace software" (this is in the footer of the page)
133+
# 2. Also check /community-list page lists one of the test Communities in the loaded test data
134+
- name: Verify production frontend is responding properly
135+
run: |
136+
result=$(wget -O- -q http://127.0.0.1:4000/home)
137+
echo "$result"
138+
echo "$result" | grep -oE "\"DSpace software\""
139+
- name: Error logs of production frontend (if error in startup)
140+
if: ${{ failure() }}
141+
run: |
142+
docker compose -f docker/docker-compose-dist.yml logs
143+
# Now shutdown the production frontend image and startup the development frontend image
144+
- name: Shutdown production frontend
145+
run: |
146+
docker compose -f docker/docker-compose-dist.yml down
147+
sleep 10
148+
docker container ls
149+
- name: Startup development frontend
150+
# Specify the GHCR copy of the development frontend, so that we use the newly built image
151+
env:
152+
DOCKER_REGISTRY: ghcr.io
153+
run: |
154+
docker compose -f docker/docker-compose.yml up -d
155+
sleep 10
156+
docker container ls
157+
# Verify development frontend started successfully.
158+
# 1. First, keep requesting the frontend every 10 seconds to wait until its up. Timeout after 10 minutes.
159+
# 2. Once it's responding, check to see if the word "DSpace" appears.
160+
# We cannot check for anything more specific because development mode doesn't have SSR.
161+
- name: Verify development frontend is responding properly
162+
run: |
163+
timeout 10m wget --retry-connrefused -t 0 --waitretry=10 http://127.0.0.1:4000
164+
result=$(wget -O- -q http://127.0.0.1:4000)
165+
echo "$result"
166+
echo "$result" | grep -oE "DSpace"
167+
- name: Error logs of development frontend (if error in startup)
168+
if: ${{ failure() }}
169+
run: |
170+
docker compose -f docker/docker-compose.yml logs
171+
# Shutdown our containers
172+
- name: Shutdown running Docker containers
173+
run: |
174+
docker compose -f docker/docker-compose.yml -f docker/docker-compose-rest.yml down

.github/workflows/issue_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
permissions: {}
99
jobs:
1010
automation:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-slim
1212
steps:
1313
# Add the new issue to a project board, if it needs triage
1414
# See https://github.com/actions/add-to-project

.github/workflows/label_merge_conflicts.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
triage:
1919
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
2020
if: github.repository == 'dspace/dspace-angular'
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-slim
2222
permissions:
2323
pull-requests: write
2424
steps:
@@ -36,4 +36,4 @@ jobs:
3636
conflict_comment: |
3737
Hi @${author},
3838
Conflicts have been detected against the base branch.
39-
Please [resolve these conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts) as soon as you can. Thanks!
39+
Please [resolve these conflicts](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts) as soon as you can. Thanks!

.github/workflows/port_merged_pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ permissions:
1818

1919
jobs:
2020
port_pr:
21-
runs-on: ubuntu-latest
21+
runs-on: ubuntu-slim
2222
# Don't run on closed *unmerged* pull requests
2323
if: github.event.pull_request.merged
2424
steps:
@@ -43,4 +43,4 @@ jobs:
4343
merge_commits: 'skip'
4444
# Use a personal access token (PAT) to create PR as 'dspace-bot' user.
4545
# A PAT is required in order for the new PR to trigger its own actions (for CI checks)
46-
github_token: ${{ secrets.PR_PORT_TOKEN }}
46+
github_token: ${{ secrets.PR_PORT_TOKEN }}

.github/workflows/pull_request_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ permissions:
1616

1717
jobs:
1818
automation:
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-slim
2020
steps:
2121
# Assign the PR to whomever created it. This is useful for visualizing assignments on project boards
2222
# See https://github.com/toshimaru/auto-author-assign

0 commit comments

Comments
 (0)