Skip to content

Commit ee1a8ad

Browse files
committed
Merge branch 'dspace-cris-7' into DSC-1093
# Conflicts: # src/assets/i18n/en.json5
2 parents 365673c + c706f4d commit ee1a8ad

2,032 files changed

Lines changed: 289238 additions & 83711 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.

.browserslistrc

Lines changed: 0 additions & 17 deletions
This file was deleted.

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ trim_trailing_whitespace = false
1515

1616
[*.ts]
1717
quote_type = single
18+
19+
[*.json5]
20+
ij_json_keep_blank_lines_in_code = 3

.eslintrc.json

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"eslint-plugin-import",
77
"eslint-plugin-jsdoc",
88
"eslint-plugin-deprecation",
9-
"eslint-plugin-unused-imports"
9+
"unused-imports",
10+
"eslint-plugin-lodash",
11+
"eslint-plugin-jsonc"
1012
],
1113
"overrides": [
1214
{
@@ -202,7 +204,13 @@
202204
"deprecation/deprecation": "warn",
203205

204206
"import/order": "off",
205-
"import/no-deprecated": "warn"
207+
"import/no-deprecated": "warn",
208+
"import/no-namespace": "error",
209+
"unused-imports/no-unused-imports": "error",
210+
"lodash/import-scope": [
211+
"error",
212+
"method"
213+
]
206214
}
207215
},
208216
{
@@ -217,6 +225,42 @@
217225
"@angular-eslint/template/no-negated-async": "off",
218226
"@angular-eslint/template/eqeqeq": "off"
219227
}
228+
},
229+
{
230+
"files": [
231+
"*.json5"
232+
],
233+
"extends": [
234+
"plugin:jsonc/recommended-with-jsonc"
235+
],
236+
"rules": {
237+
"no-irregular-whitespace": "error",
238+
"no-trailing-spaces": "error",
239+
"jsonc/comma-dangle": [
240+
"error",
241+
"always-multiline"
242+
],
243+
"jsonc/indent": [
244+
"error",
245+
2
246+
],
247+
"jsonc/key-spacing": [
248+
"error",
249+
{
250+
"beforeColon": false,
251+
"afterColon": true,
252+
"mode": "strict"
253+
}
254+
],
255+
"jsonc/no-dupe-keys": "off",
256+
"jsonc/quotes": [
257+
"error",
258+
"double",
259+
{
260+
"avoidEscape": false
261+
}
262+
]
263+
}
220264
}
221265
]
222266
}

.github/disabled-workflows/pull_request_opened.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## References
22
_Add references/links to any related issues or PRs. These may include:_
3-
* Fixes #[issue-number]
4-
* Requires DSpace/DSpace#[pr-number] (if a REST API PR is required to test this)
3+
* Fixes #`issue-number` (if this fixes an issue ticket)
4+
* Requires DSpace/DSpace#`pr-number` (if a REST API PR is required to test this)
55

66
## Description
77
Short summary of changes (1-2 sentences).
@@ -19,8 +19,10 @@ List of changes in this PR:
1919
_This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!_
2020

2121
- [ ] My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
22-
- [ ] My PR passes [TSLint](https://palantir.github.io/tslint/) validation using `yarn run lint`
23-
- [ ] My PR doesn't introduce circular dependencies
22+
- [ ] My PR passes [ESLint](https://eslint.org/) validation using `yarn lint`
23+
- [ ] My PR doesn't introduce circular dependencies (verified via `yarn check-circ-deps`)
2424
- [ ] My PR includes [TypeDoc](https://typedoc.org/) comments for _all new (or modified) public methods and classes_. It also includes TypeDoc for large or complex private methods.
2525
- [ ] My PR passes all specs/tests and includes new/updated specs or tests based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
26-
- [ ] If my PR includes new, third-party dependencies (in `package.json`), I've made sure their licenses align with the [DSpace BSD License](https://github.com/DSpace/DSpace/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.
26+
- [ ] If my PR includes new libraries/dependencies (in `package.json`), I've made sure their licenses align with the [DSpace BSD License](https://github.com/DSpace/DSpace/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.
27+
- [ ] If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
28+
- [ ] If my PR fixes an issue ticket, I've [linked them together](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).

.github/workflows/build.yml

Lines changed: 66 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,48 @@ name: Build
66
# Run this Build for all pushes / PRs to current branch
77
on: [push, pull_request]
88

9+
permissions:
10+
contents: read # to fetch code (actions/checkout)
11+
912
jobs:
1013
tests:
1114
runs-on: ubuntu-latest
1215
env:
1316
# The ci step will test the dspace-angular code against DSpace REST.
1417
# Direct that step to utilize a DSpace REST service that has been started in docker.
15-
DSPACE_REST_HOST: localhost
18+
# NOTE: These settings should be kept in sync with those in [src]/docker/docker-compose-ci.yml
19+
DSPACE_REST_HOST: 127.0.0.1
1620
DSPACE_REST_PORT: 8080
1721
DSPACE_REST_NAMESPACE: '/server'
1822
DSPACE_REST_SSL: false
23+
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
24+
DSPACE_UI_HOST: 127.0.0.1
25+
DSPACE_UI_PORT: 4000
26+
# Ensure all SSR caching is disabled in test environment
27+
DSPACE_CACHE_SERVERSIDE_BOTCACHE_MAX: 0
28+
DSPACE_CACHE_SERVERSIDE_ANONYMOUSCACHE_MAX: 0
29+
# Tell Cypress to run e2e tests using the same UI URL
30+
CYPRESS_BASE_URL: http://127.0.0.1:4000
1931
# When Chrome version is specified, we pin to a specific version of Chrome
2032
# Comment this out to use the latest release
21-
#CHROME_VERSION: "90.0.4430.212-1"
33+
CHROME_VERSION: "116.0.5845.187-1"
34+
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
35+
NODE_OPTIONS: '--max-old-space-size=4096'
2236
strategy:
2337
# Create a matrix of Node versions to test against (in parallel)
2438
matrix:
25-
node-version: [14.x, 16.x]
39+
node-version: [16.x, 18.x]
2640
# Do NOT exit immediately if one matrix job fails
2741
fail-fast: false
2842
# These are the actual CI steps to perform per job
2943
steps:
3044
# https://github.com/actions/checkout
3145
- name: Checkout codebase
32-
uses: actions/checkout@v2
46+
uses: actions/checkout@v3
3347

3448
# https://github.com/actions/setup-node
3549
- name: Install Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v2
50+
uses: actions/setup-node@v3
3751
with:
3852
node-version: ${{ matrix.node-version }}
3953

@@ -56,9 +70,9 @@ jobs:
5670
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
5771
- name: Get Yarn cache directory
5872
id: yarn-cache-dir-path
59-
run: echo "::set-output name=dir::$(yarn cache dir)"
73+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
6074
- name: Cache Yarn dependencies
61-
uses: actions/cache@v2
75+
uses: actions/cache@v3
6276
with:
6377
# Cache entire Yarn cache directory (see previous step)
6478
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -81,12 +95,16 @@ jobs:
8195
- name: Run specs (unit tests)
8296
run: yarn run test:headless
8397

98+
# Upload code coverage report to artifact (for one version of Node only),
99+
# so that it can be shared with the 'codecov' job (see below)
84100
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
85-
# Upload coverage reports to Codecov (for one version of Node only)
86-
# https://github.com/codecov/codecov-action
87-
- name: Upload coverage to Codecov.io
88-
uses: codecov/codecov-action@v2
89-
if: matrix.node-version == '16.x'
101+
- name: Upload code coverage report to Artifact
102+
uses: actions/upload-artifact@v3
103+
if: matrix.node-version == '18.x'
104+
with:
105+
name: dspace-angular coverage report
106+
path: 'coverage/dspace-angular/lcov.info'
107+
retention-days: 14
90108

91109
# Using docker-compose start backend using CI configuration
92110
# and load assetstore from a cached copy
@@ -100,23 +118,22 @@ jobs:
100118
# https://github.com/cypress-io/github-action
101119
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
102120
- name: Run e2e tests (integration tests)
103-
uses: cypress-io/github-action@v2
121+
uses: cypress-io/github-action@v5
104122
with:
105-
# Run tests in Chrome, headless mode
123+
# Run tests in Chrome, headless mode (default)
106124
browser: chrome
107-
headless: true
108125
# Start app before running tests (will be stopped automatically after tests finish)
109126
start: yarn run serve:ssr
110127
# Wait for backend & frontend to be available
111128
# NOTE: We use the 'sites' REST endpoint to also ensure the database is ready
112-
wait-on: http://localhost:8080/server/api/core/sites, http://localhost:4000
129+
wait-on: http://127.0.0.1:8080/server/api/core/sites, http://127.0.0.1:4000
113130
# Wait for 2 mins max for everything to respond
114131
wait-on-timeout: 120
115132

116133
# Cypress always creates a video of all e2e tests (whether they succeeded or failed)
117134
# Save those in an Artifact
118135
- name: Upload e2e test videos to Artifacts
119-
uses: actions/upload-artifact@v2
136+
uses: actions/upload-artifact@v3
120137
if: always()
121138
with:
122139
name: e2e-test-videos
@@ -125,7 +142,7 @@ jobs:
125142
# If e2e tests fail, Cypress creates a screenshot of what happened
126143
# Save those in an Artifact
127144
- name: Upload e2e test failure screenshots to Artifacts
128-
uses: actions/upload-artifact@v2
145+
uses: actions/upload-artifact@v3
129146
if: failure()
130147
with:
131148
name: e2e-test-screenshots
@@ -144,7 +161,7 @@ jobs:
144161
run: |
145162
nohup yarn run serve:ssr &
146163
printf 'Waiting for app to start'
147-
until curl --output /dev/null --silent --head --fail http://localhost:4000/home; do
164+
until curl --output /dev/null --silent --head --fail http://127.0.0.1:4000/home; do
148165
printf '.'
149166
sleep 2
150167
done
@@ -155,7 +172,7 @@ jobs:
155172
# This step also prints entire HTML of homepage for easier debugging if grep fails.
156173
- name: Verify SSR (server-side rendering)
157174
run: |
158-
result=$(wget -O- -q http://localhost:4000/home)
175+
result=$(wget -O- -q http://127.0.0.1:4000/home)
159176
echo "$result"
160177
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace
161178
@@ -164,3 +181,32 @@ jobs:
164181

165182
- name: Shutdown Docker containers
166183
run: docker-compose -f ./docker/docker-compose-ci.yml down
184+
185+
# Codecov upload is a separate job in order to allow us to restart this separate from the entire build/test
186+
# job above. This is necessary because Codecov uploads seem to randomly fail at times.
187+
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
188+
codecov:
189+
# Must run after 'tests' job above
190+
needs: tests
191+
runs-on: ubuntu-latest
192+
steps:
193+
- name: Checkout
194+
uses: actions/checkout@v3
195+
196+
# Download artifacts from previous 'tests' job
197+
- name: Download coverage artifacts
198+
uses: actions/download-artifact@v3
199+
200+
# Now attempt upload to Codecov using its action.
201+
# NOTE: We use a retry action to retry the Codecov upload if it fails the first time.
202+
#
203+
# Retry action: https://github.com/marketplace/actions/retry-action
204+
# Codecov action: https://github.com/codecov/codecov-action
205+
- name: Upload coverage to Codecov.io
206+
uses: Wandalen/wretry.action@v1.0.36
207+
with:
208+
action: codecov/codecov-action@v3
209+
# Try upload 5 times max
210+
attempt_limit: 5
211+
# Run again in 30 seconds
212+
attempt_delay: 30000

.github/workflows/codescan.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# DSpace CodeQL code scanning configuration for GitHub
2+
# https://docs.github.com/en/code-security/code-scanning
3+
#
4+
# NOTE: Code scanning must be run separate from our default build.yml
5+
# because CodeQL requires a fresh build with all tests *disabled*.
6+
name: "Code Scanning"
7+
8+
# Run this code scan for all pushes / PRs to main or maintenance branches. Also run once a week.
9+
on:
10+
push:
11+
branches:
12+
- main
13+
- 'dspace-**'
14+
pull_request:
15+
branches:
16+
- main
17+
- 'dspace-**'
18+
# Don't run if PR is only updating static documentation
19+
paths-ignore:
20+
- '**/*.md'
21+
- '**/*.txt'
22+
schedule:
23+
- cron: "37 0 * * 1"
24+
25+
jobs:
26+
analyze:
27+
name: Analyze Code
28+
runs-on: ubuntu-latest
29+
# Limit permissions of this GitHub action. Can only write to security-events
30+
permissions:
31+
actions: read
32+
contents: read
33+
security-events: write
34+
35+
steps:
36+
# https://github.com/actions/checkout
37+
- name: Checkout repository
38+
uses: actions/checkout@v3
39+
40+
# Initializes the CodeQL tools for scanning.
41+
# https://github.com/github/codeql-action
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v2
44+
with:
45+
languages: javascript
46+
47+
# Autobuild attempts to build any compiled languages
48+
- name: Autobuild
49+
uses: github/codeql-action/autobuild@v2
50+
51+
# Perform GitHub Code Scanning.
52+
- name: Perform CodeQL Analysis
53+
uses: github/codeql-action/analyze@v2

0 commit comments

Comments
 (0)