Skip to content

Commit 686d316

Browse files
authored
Merge pull request #62 from ufal/dataquest/conflict-resolved-dtq-dev
dataquest -> lindat sync
2 parents 9c59279 + 7c13392 commit 686d316

1,013 files changed

Lines changed: 56253 additions & 64066 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: 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/actions/import-db/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ inputs:
1414
description: 'location of assetstore folder'
1515
required: false
1616
type: string
17+
ADMIN_PASSWORD:
18+
description: 'Admin password for DSpace'
19+
required: true
20+
type: string
1721

1822
runs:
1923
using: "composite"
@@ -42,6 +46,8 @@ runs:
4246
DB5NAME: dspace-import-db5
4347
DB7PORT: 543${{ inputs.INSTANCE }}
4448
BEURL: http://dev-5.pc:8${{ inputs.INSTANCE }}/repository/server/api
49+
BEUSERNAME: dspace.admin.dev@dataquest.sk
50+
BEUSERPASSWORD: ${{ inputs.ADMIN_PASSWORD }}
4551
run: |
4652
docker stop $DB5NAME || true
4753
echo "====="
@@ -78,6 +84,8 @@ runs:
7884
args=(
7985
--resume=false
8086
--config=backend.endpoint=$BEURL
87+
--config=backend.user=$BEUSERNAME
88+
--config=backend.password=$BEUSERPASSWORD
8189
--config=db_dspace_7.port=$DB7PORT
8290
--config=db_dspace_5.port=$DB5PORT
8391
--config=db_utilities_5.port=$DB5PORT

.github/disabled-workflows/deploy.yml

Lines changed: 11 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
env:
4545
INSTANCE: '5'
4646
ENVFILE: /opt/dspace-envs/.env.dspace.dev-5
47+
ADMIN_PASSWORD: ${{ secrets.DSPACE_ADMIN_PASSWORD }}
48+
USER_PASSWORD: ${{ secrets.DSPACE_USER_PASSWORD }}
4749
steps:
4850
- uses: actions/checkout@v4
4951

@@ -73,6 +75,8 @@ jobs:
7375
# disable TSL checks = allowing to cooperate with https backend with invalid
7476
# certificate
7577
ENVFILE: /opt/dspace-envs/.env.dspace.imported.dev-5
78+
ADMIN_PASSWORD: ${{ secrets.DSPACE_ADMIN_PASSWORD }}
79+
USER_PASSWORD: ${{ secrets.DSPACE_USER_PASSWORD }}
7680
steps:
7781
- uses: actions/checkout@v4
7882

@@ -95,9 +99,6 @@ jobs:
9599
## !!!!! please remove this section if you do not want handle server !!!!!!!
96100
echo "====="
97101
echo "installing handle server"
98-
docker exec dspace${INSTANCE} apt update
99-
docker exec dspace${INSTANCE} apt install host -y
100-
echo "installed host from apt"
101102
docker exec dspace${INSTANCE} /dspace/bin/make-handle-config
102103
echo "made handle config:"
103104
docker exec dspace${INSTANCE} cat /dspace/handle-server/config.dct
@@ -122,6 +123,7 @@ jobs:
122123
DATADIR: /opt/dspace-data/clarin-dspace/
123124
ASSETSTORE: /opt/dspace-data/clarin-dspace/assetstore/
124125
LOGDIR: /log/
126+
ADMIN_PASSWORD: ${{ secrets.DSPACE_ADMIN_PASSWORD }}
125127

126128
- name: dspace basic command
127129
run: |
@@ -150,44 +152,15 @@ jobs:
150152
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace healthcheck -v"
151153
152154
playwright-after-deploy8:
153-
runs-on: dspace-test-1
154155
needs: deploy-8
155-
timeout-minutes: 45
156156
if: '!inputs.IMPORT'
157-
steps:
158-
- name: Checkout Playwright tests
159-
uses: actions/checkout@v4
160-
with:
161-
repository: dataquest-dev/dspace-ui-tests
162-
path: dspace-ui-tests
163-
token: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}
164-
165-
- name: Checkout main repository
166-
uses: actions/checkout@v4
167-
with:
168-
path: this-repository
169-
170-
- name: Copy customer config to UI tests repository for merging
171-
run: |
172-
cp this-repository/config/config.lindat.ui.tests.json dspace-ui-tests/customer-constants/
173-
174-
- name: test
175-
working-directory: dspace-ui-tests/scripts
176-
env:
177-
HOME_URL: https://dev-5.pc:8443/repository/
178-
NAME: LINDAT
179-
run: |
180-
./test.sh
181-
182-
- uses: mazoea/ga-maz/end@master
183-
with:
184-
CHOWN_DIR: ./
185-
if: ${{ always() }}
157+
uses: ./.github/workflows/playwright-tests.yml
158+
secrets: inherit
186159

187160
rest-tests-after-deploy8:
188161
runs-on: ubuntu-latest
189162
needs: playwright-after-deploy8
190-
timeout-minutes: 45
163+
timeout-minutes: 120
191164
steps:
192165
- name: run rest-tests
193166
run: |
@@ -219,44 +192,15 @@ jobs:
219192
220193
221194
playwright-after-import8:
222-
runs-on: dspace-test-1
223195
needs: import-8
224196
if: inputs.IMPORT
225-
timeout-minutes: 45
226-
steps:
227-
- name: Checkout Playwright tests
228-
uses: actions/checkout@v4
229-
with:
230-
repository: dataquest-dev/dspace-ui-tests
231-
path: dspace-ui-tests
232-
token: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}
233-
234-
- name: Checkout main repository
235-
uses: actions/checkout@v4
236-
with:
237-
path: this-repository
238-
239-
- name: Copy customer config to UI tests repository for merging
240-
run: |
241-
cp this-repository/config/config.lindat.ui.tests.json dspace-ui-tests/customer-constants/
242-
243-
- name: test
244-
working-directory: dspace-ui-tests/scripts
245-
env:
246-
HOME_URL: https://dev-5.pc:8443/repository/
247-
NAME: LINDAT
248-
run: |
249-
./test.sh
250-
251-
- uses: mazoea/ga-maz/end@master
252-
with:
253-
CHOWN_DIR: ./
254-
if: ${{ always() }}
197+
uses: ./.github/workflows/playwright-tests.yml
198+
secrets: inherit
255199

256200
rest-tests-after-import8:
257201
runs-on: ubuntu-latest
258202
needs: playwright-after-import8
259-
timeout-minutes: 45
203+
timeout-minutes: 120
260204
steps:
261205
- name: run rest-tests
262206
run: |

.github/pull_request_template.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
| Phases | MP | MM | MB | MR | JM | Total |
2-
|-----------------|----:|----:|----:|-----:|-----:|-------:|
3-
| ETA | 0 | 0 | 0 | 0 | 0 | 0 |
4-
| Developing | 0 | 0 | 0 | 0 | 0 | 0 |
5-
| Review | 0 | 0 | 0 | 0 | 0 | 0 |
6-
| Total | - | - | - | - | - | 0 |
7-
| ETA est. | | | | | | 0 |
8-
| ETA cust. | - | - | - | - | - | 0 |
91
## Problem description
10-
### Reported issues
11-
### Not-reported issues
2+
123
## Analysis
134
(Write here, if there is needed describe some specific problem. Erase it, when it is not needed.)
145
## Problems
156
(Write here, if some unexpected problems occur during solving issues. Erase it, when it is not needed.)
7+
8+
### Sync verification
9+
If en.json5 or cs.json5 translation files were updated:
10+
- [ ] Run `yarn run sync-i18n -t src/assets/i18n/cs.json5 -i` to synchronize messages, and changes are included in this PR.
11+
12+
### Manual Testing (if applicable)
13+
- [ ] Added to [testing scenarios](https://github.com/dataquest-dev/dspace-customers/issues/55)
14+
15+
### Copilot review
16+
- [ ] Requested review from Copilot

.github/workflows/build.yml

Lines changed: 125 additions & 8 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
@@ -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

0 commit comments

Comments
 (0)