Skip to content

Commit 28fb578

Browse files
Upgrade CLARIN-DSpace to v7.6.5. (#941)
1 parent 9c58cf5 commit 28fb578

File tree

967 files changed

+130611
-32213
lines changed

Some content is hidden

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

967 files changed

+130611
-32213
lines changed

.eslintrc.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,13 @@
231231
"*.json5"
232232
],
233233
"extends": [
234-
"plugin:jsonc/recommended-with-jsonc"
234+
"plugin:jsonc/recommended-with-json5"
235235
],
236236
"rules": {
237-
"no-irregular-whitespace": "error",
237+
// The ESLint core no-irregular-whitespace rule doesn't work well in JSON
238+
// See: https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html
239+
"no-irregular-whitespace": "off",
240+
"jsonc/no-irregular-whitespace": "error",
238241
"no-trailing-spaces": "error",
239242
"jsonc/comma-dangle": [
240243
"error",

.github/workflows/build.yml

Lines changed: 131 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ on:
1515
workflow_dispatch:
1616

1717
permissions:
18-
contents: read # to fetch code (actions/checkout)
18+
contents: read # to fetch code (actions/checkout)
19+
packages: read # to fetch private images from GitHub Container Registry (GHCR)
1920

2021
jobs:
2122
tests:
@@ -39,17 +40,22 @@ jobs:
3940
DSPACE_CACHE_SERVERSIDE_ANONYMOUSCACHE_MAX: 0
4041
# Tell Cypress to run e2e tests using the same UI URL
4142
CYPRESS_BASE_URL: http://127.0.0.1:4000
43+
# Disable the cookie consent banner in e2e tests to avoid errors because of elements hidden by it
44+
DSPACE_INFO_ENABLECOOKIECONSENTPOPUP: false
4245
# When Chrome version is specified, we pin to a specific version of Chrome
4346
# Comment this out to use the latest release
4447
#CHROME_VERSION: "90.0.4430.212-1"
4548
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
4649
NODE_OPTIONS: '--max-old-space-size=4096'
47-
# Project name to use when running docker compose prior to e2e tests
50+
# Project name to use when running "docker compose" prior to e2e tests
4851
COMPOSE_PROJECT_NAME: 'ci'
52+
# Docker Registry to use for Docker compose scripts below.
53+
# We use GitHub's Container Registry to avoid aggressive rate limits at DockerHub.
54+
DOCKER_REGISTRY: ghcr.io
4955
strategy:
5056
# Create a matrix of Node versions to test against (in parallel)
5157
matrix:
52-
node-version: [16.x, 18.x]
58+
node-version: [18.x, 20.x]
5359
# Do NOT exit immediately if one matrix job fails
5460
fail-fast: false
5561
# These are the actual CI steps to perform per job
@@ -96,17 +102,17 @@ jobs:
96102
- name: Install Yarn dependencies
97103
run: yarn install --frozen-lockfile
98104

99-
- name: Run lint
100-
run: yarn run lint --quiet
105+
# - name: Run lint
106+
# run: yarn run lint --quiet
101107

102-
- name: Check for circular dependencies
103-
run: yarn run check-circ-deps
108+
# - name: Check for circular dependencies
109+
# run: yarn run check-circ-deps
104110

105111
- name: Run build
106112
run: yarn run build:prod
107113

108-
- name: Run specs (unit tests)
109-
run: yarn run test:headless
114+
# - name: Run specs (unit tests)
115+
# run: yarn run test:headless
110116

111117
# Upload code coverage report to artifact (for one version of Node only),
112118
# so that it can be shared with the 'codecov' job (see below)
@@ -119,7 +125,15 @@ jobs:
119125
path: 'coverage/dspace-angular/lcov.info'
120126
retention-days: 14
121127

122-
# Using docker compose start backend using CI configuration
128+
# Login to our Docker registry, so that we can access private Docker images using "docker compose" below.
129+
- name: Login to ${{ env.DOCKER_REGISTRY }}
130+
uses: docker/login-action@v3
131+
with:
132+
registry: ${{ env.DOCKER_REGISTRY }}
133+
username: ${{ github.repository_owner }}
134+
password: ${{ secrets.GITHUB_TOKEN }}
135+
136+
# Using "docker compose" start backend using CI configuration
123137
# and load assetstore from a cached copy
124138
- name: Start DSpace REST Backend via Docker (for e2e tests)
125139
run: |
@@ -183,21 +197,124 @@ jobs:
183197
# Get homepage and verify that the <meta name="title"> tag includes "DSpace".
184198
# If it does, then SSR is working, as this tag is created by our MetadataService.
185199
# This step also prints entire HTML of homepage for easier debugging if grep fails.
186-
- name: Verify SSR (server-side rendering)
200+
- name: Verify SSR (server-side rendering) on Homepage
187201
run: |
188202
result=$(wget -O- -q http://127.0.0.1:4000/home)
189203
echo "$result"
190204
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep Home
191205
206+
# Get a specific community in our test data and verify that the "<h1>" tag includes "Publications" (the community name).
207+
# If it does, then SSR is working.
208+
- name: Verify SSR on a Community page
209+
run: |
210+
result=$(wget -O- -q http://127.0.0.1:4000/communities/0958c910-2037-42a9-81c7-dca80e3892b4)
211+
echo "$result"
212+
echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Publications
213+
214+
# Get a specific collection in our test data and verify that the "<h1>" tag includes "Articles" (the collection name).
215+
# If it does, then SSR is working.
216+
- name: Verify SSR on a Collection page
217+
run: |
218+
result=$(wget -O- -q http://127.0.0.1:4000/collections/282164f5-d325-4740-8dd1-fa4d6d3e7200)
219+
echo "$result"
220+
echo "$result" | grep -oE "<h1 [^>]*>[^><]*</h1>" | grep Articles
221+
222+
# Get a specific publication in our test data and verify that the <meta name="title"> tag includes
223+
# the title of this publication. If it does, then SSR is working.
224+
- name: Verify SSR on a Publication page
225+
run: |
226+
result=$(wget -O- -q http://127.0.0.1:4000/entities/publication/6160810f-1e53-40db-81ef-f6621a727398)
227+
echo "$result"
228+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "An Economic Model of Mortality Salience"
229+
230+
# Get a specific person in our test data and verify that the <meta name="title"> tag includes
231+
# the name of the person. If it does, then SSR is working.
232+
- name: Verify SSR on a Person page
233+
run: |
234+
result=$(wget -O- -q http://127.0.0.1:4000/entities/person/b1b2c768-bda1-448a-a073-fc541e8b24d9)
235+
echo "$result"
236+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Simmons, Cameron"
237+
238+
# Get a specific project in our test data and verify that the <meta name="title"> tag includes
239+
# the name of the project. If it does, then SSR is working.
240+
- name: Verify SSR on a Project page
241+
run: |
242+
result=$(wget -O- -q http://127.0.0.1:4000/entities/project/46ccb608-a74c-4bf6-bc7a-e29cc7defea9)
243+
echo "$result"
244+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "University Research Fellowship"
245+
246+
# Get a specific orgunit in our test data and verify that the <meta name="title"> tag includes
247+
# the name of the orgunit. If it does, then SSR is working.
248+
- name: Verify SSR on an OrgUnit page
249+
run: |
250+
result=$(wget -O- -q http://127.0.0.1:4000/entities/orgunit/9851674d-bd9a-467b-8d84-068deb568ccf)
251+
echo "$result"
252+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Law and Development"
253+
254+
# Get a specific journal in our test data and verify that the <meta name="title"> tag includes
255+
# the name of the journal. If it does, then SSR is working.
256+
- name: Verify SSR on a Journal page
257+
run: |
258+
result=$(wget -O- -q http://127.0.0.1:4000/entities/journal/d4af6c3e-53d0-4757-81eb-566f3b45d63a)
259+
echo "$result"
260+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology"
261+
262+
# Get a specific journal volume in our test data and verify that the <meta name="title"> tag includes
263+
# the name of the volume. If it does, then SSR is working.
264+
- name: Verify SSR on a Journal Volume page
265+
run: |
266+
result=$(wget -O- -q http://127.0.0.1:4000/entities/journalvolume/07c6249f-4bf7-494d-9ce3-6ffdb2aed538)
267+
echo "$result"
268+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology Volume 28 (2017)"
269+
270+
# Get a specific journal issue in our test data and verify that the <meta name="title"> tag includes
271+
# the name of the issue. If it does, then SSR is working.
272+
- name: Verify SSR on a Journal Issue page
273+
run: |
274+
result=$(wget -O- -q http://127.0.0.1:4000/entities/journalissue/44c29473-5de2-48fa-b005-e5029aa1a50b)
275+
echo "$result"
276+
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep "Environmental &amp; Architectural Phenomenology Vol. 28, No. 1"
277+
278+
# Verify 301 Handle redirect behavior
279+
# Note: /handle/123456789/260 is the same test Publication used by our e2e tests
280+
- name: Verify 301 redirect from '/handle' URLs
281+
run: |
282+
result=$(wget --server-response --quiet http://127.0.0.1:4000/handle/123456789/260 2>&1 | head -1 | awk '{print $2}')
283+
echo "$result"
284+
[[ "$result" -eq "301" ]]
285+
286+
# Verify 403 error code behavior
287+
- name: Verify 403 error code from '/403'
288+
run: |
289+
result=$(wget --server-response --quiet http://127.0.0.1:4000/403 2>&1 | head -1 | awk '{print $2}')
290+
echo "$result"
291+
[[ "$result" -eq "403" ]]
292+
293+
# Verify 404 error code behavior
294+
- name: Verify 404 error code from '/404' and on invalid pages
295+
run: |
296+
result=$(wget --server-response --quiet http://127.0.0.1:4000/404 2>&1 | head -1 | awk '{print $2}')
297+
echo "$result"
298+
result2=$(wget --server-response --quiet http://127.0.0.1:4000/invalidurl 2>&1 | head -1 | awk '{print $2}')
299+
echo "$result2"
300+
[[ "$result" -eq "404" && "$result2" -eq "404" ]]
301+
302+
# Verify 500 error code behavior
303+
- name: Verify 500 error code from '/500'
304+
run: |
305+
result=$(wget --server-response --quiet http://127.0.0.1:4000/500 2>&1 | head -1 | awk '{print $2}')
306+
echo "$result"
307+
[[ "$result" -eq "500" ]]
308+
192309
- name: Stop running app
193310
run: kill -9 $(lsof -t -i:4000)
194311

195312
- name: Shutdown Docker containers
196313
run: docker compose -f ./docker/docker-compose-ci.yml down
197314

198-
# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
199-
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
200-
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
315+
# # Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
316+
# # job above. This is necessary because Codecov uploads seem to randomly fail at times.
317+
# # See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
201318
# codecov:
202319
# # Must run after 'tests' job above
203320
# needs: tests

.github/workflows/codescan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
steps:
3636
# https://github.com/actions/checkout
3737
- name: Checkout repository
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3939

4040
# Initializes the CodeQL tools for scanning.
4141
# https://github.com/github/codeql-action

.github/workflows/docker.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Docker images
44
# Run this Build for all pushes to 'main' or maintenance branches, or tagged releases.
55
# Also run for PRs to ensure PR doesn't break Docker build process
66
# NOTE: uses "reusable-docker-build.yml" in DSpace/DSpace to actually build each of the Docker images
7-
# https://github.com/DSpace/DSpace/blob/main/.github/workflows/reusable-docker-build.yml
7+
# https://github.com/DSpace/DSpace/blob/dspace-7_x/.github/workflows/reusable-docker-build.yml
88
#
99
on:
1010
push:
@@ -15,12 +15,17 @@ on:
1515
workflow_dispatch:
1616

1717
permissions:
18-
contents: read # to fetch code (actions/checkout)
18+
contents: read # to fetch code (actions/checkout)
19+
packages: write # to write images to GitHub Container Registry (GHCR)
1920

2021
jobs:
22+
#############################################################
23+
# Build/Push the 'dspace/dspace-angular' image
24+
#############################################################
2125
dspace-angular:
2226
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
2327
if: github.repository == 'dataquest-dev/dspace-angular'
28+
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
2429
uses: dataquest-dev/DSpace/.github/workflows/reusable-docker-build.yml@dtq-dev
2530
with:
2631
build_id: dspace-angular
@@ -38,6 +43,7 @@ jobs:
3843
dspace-angular-dist:
3944
# Ensure this job never runs on forked repos. It's only executed for 'dataquest/dspace-angular'
4045
if: github.repository == 'dataquest-dev/dspace-angular' && false # not used for now
46+
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
4147
uses: dataquest-dev/DSpace/.github/workflows/reusable-docker-build.yml@dtq-dev
4248
with:
4349
build_id: dspace-angular-dist
@@ -51,6 +57,10 @@ jobs:
5157
secrets:
5258
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
5359
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
60+
# Enable redeploy of sandbox & demo if the branch for this image matches the deployment branch of
61+
# these sites as specified in reusable-docker-build.xml
62+
REDEPLOY_SANDBOX_URL: ${{ secrets.REDEPLOY_SANDBOX_URL }}
63+
REDEPLOY_DEMO_URL: ${{ secrets.REDEPLOY_DEMO_URL }}
5464

5565
deploy:
5666
needs: dspace-angular

.github/workflows/issue_opened.yml

Whitespace-only changes.

.github/workflows/port_merged_pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ jobs:
2323
if: github.event.pull_request.merged
2424
steps:
2525
# Checkout code
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
# Port PR to other branch (ONLY if labeled with "port to")
2828
# See https://github.com/korthout/backport-action
2929
- name: Create backport pull requests
30-
uses: korthout/backport-action@v1
30+
uses: korthout/backport-action@v2
3131
with:
3232
# Trigger based on a "port to [branch]" label on PR
3333
# (This label must specify the branch name to port to)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This image will be published as dspace/dspace-angular
22
# See https://github.com/DSpace/dspace-angular/tree/main/docker for usage details
33

4-
FROM node:18-alpine
4+
FROM docker.io/node:18-alpine
55

66
# Ensure Python and other build tools are available
77
# These are needed to install some node modules, especially on linux/arm64

Dockerfile.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Test build:
55
# docker build -f Dockerfile.dist -t dspace/dspace-angular:dspace-7_x-dist .
66

7-
FROM node:18-alpine AS build
7+
FROM docker.io/node:18-alpine AS build
88

99
# Ensure Python and other build tools are available
1010
# These are needed to install some node modules, especially on linux/arm64

angular.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"lodash",
3131
"jwt-decode",
3232
"uuid",
33-
"webfontloader",
3433
"zone.js"
3534
],
3635
"outputPath": "dist/browser",

0 commit comments

Comments
 (0)