Skip to content

Commit 3851884

Browse files
committed
Merge remote-tracking branch 'upstream/main' into w2p-100302_Live-import-issues-7.5
2 parents 153a53f + d0ccec9 commit 3851884

1,028 files changed

Lines changed: 49300 additions & 22304 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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"eslint-plugin-import",
77
"eslint-plugin-jsdoc",
88
"eslint-plugin-deprecation",
9-
"eslint-plugin-unused-imports"
9+
"unused-imports",
10+
"eslint-plugin-lodash"
1011
],
1112
"overrides": [
1213
{
@@ -202,7 +203,13 @@
202203
"deprecation/deprecation": "warn",
203204

204205
"import/order": "off",
205-
"import/no-deprecated": "warn"
206+
"import/no-deprecated": "warn",
207+
"import/no-namespace": "error",
208+
"unused-imports/no-unused-imports": "error",
209+
"lodash/import-scope": [
210+
"error",
211+
"method"
212+
]
206213
}
207214
},
208215
{

.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: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,39 @@ 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+
DSPACE_REST_HOST: 127.0.0.1
1619
DSPACE_REST_PORT: 8080
1720
DSPACE_REST_NAMESPACE: '/server'
1821
DSPACE_REST_SSL: false
22+
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
23+
DSPACE_UI_HOST: 127.0.0.1
1924
# When Chrome version is specified, we pin to a specific version of Chrome
2025
# Comment this out to use the latest release
2126
#CHROME_VERSION: "90.0.4430.212-1"
2227
strategy:
2328
# Create a matrix of Node versions to test against (in parallel)
2429
matrix:
25-
node-version: [14.x, 16.x]
30+
node-version: [16.x, 18.x]
2631
# Do NOT exit immediately if one matrix job fails
2732
fail-fast: false
2833
# These are the actual CI steps to perform per job
2934
steps:
3035
# https://github.com/actions/checkout
3136
- name: Checkout codebase
32-
uses: actions/checkout@v2
37+
uses: actions/checkout@v3
3338

3439
# https://github.com/actions/setup-node
3540
- name: Install Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v2
41+
uses: actions/setup-node@v3
3742
with:
3843
node-version: ${{ matrix.node-version }}
3944

@@ -58,7 +63,7 @@ jobs:
5863
id: yarn-cache-dir-path
5964
run: echo "::set-output name=dir::$(yarn cache dir)"
6065
- name: Cache Yarn dependencies
61-
uses: actions/cache@v2
66+
uses: actions/cache@v3
6267
with:
6368
# Cache entire Yarn cache directory (see previous step)
6469
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -85,7 +90,7 @@ jobs:
8590
# Upload coverage reports to Codecov (for one version of Node only)
8691
# https://github.com/codecov/codecov-action
8792
- name: Upload coverage to Codecov.io
88-
uses: codecov/codecov-action@v2
93+
uses: codecov/codecov-action@v3
8994
if: matrix.node-version == '16.x'
9095

9196
# Using docker-compose start backend using CI configuration
@@ -100,7 +105,7 @@ jobs:
100105
# https://github.com/cypress-io/github-action
101106
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
102107
- name: Run e2e tests (integration tests)
103-
uses: cypress-io/github-action@v2
108+
uses: cypress-io/github-action@v4
104109
with:
105110
# Run tests in Chrome, headless mode
106111
browser: chrome
@@ -109,14 +114,14 @@ jobs:
109114
start: yarn run serve:ssr
110115
# Wait for backend & frontend to be available
111116
# 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
117+
wait-on: http://127.0.0.1:8080/server/api/core/sites, http://127.0.0.1:4000
113118
# Wait for 2 mins max for everything to respond
114119
wait-on-timeout: 120
115120

116121
# Cypress always creates a video of all e2e tests (whether they succeeded or failed)
117122
# Save those in an Artifact
118123
- name: Upload e2e test videos to Artifacts
119-
uses: actions/upload-artifact@v2
124+
uses: actions/upload-artifact@v3
120125
if: always()
121126
with:
122127
name: e2e-test-videos
@@ -125,7 +130,7 @@ jobs:
125130
# If e2e tests fail, Cypress creates a screenshot of what happened
126131
# Save those in an Artifact
127132
- name: Upload e2e test failure screenshots to Artifacts
128-
uses: actions/upload-artifact@v2
133+
uses: actions/upload-artifact@v3
129134
if: failure()
130135
with:
131136
name: e2e-test-screenshots
@@ -144,7 +149,7 @@ jobs:
144149
run: |
145150
nohup yarn run serve:ssr &
146151
printf 'Waiting for app to start'
147-
until curl --output /dev/null --silent --head --fail http://localhost:4000/home; do
152+
until curl --output /dev/null --silent --head --fail http://127.0.0.1:4000/home; do
148153
printf '.'
149154
sleep 2
150155
done
@@ -155,7 +160,7 @@ jobs:
155160
# This step also prints entire HTML of homepage for easier debugging if grep fails.
156161
- name: Verify SSR (server-side rendering)
157162
run: |
158-
result=$(wget -O- -q http://localhost:4000/home)
163+
result=$(wget -O- -q http://127.0.0.1:4000/home)
159164
echo "$result"
160165
echo "$result" | grep -oE "<meta name=\"title\" [^>]*>" | grep DSpace
161166

.github/workflows/codescan.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 branch. Also run once a week.
9+
on:
10+
push:
11+
branches: [ main ]
12+
pull_request:
13+
branches: [ main ]
14+
# Don't run if PR is only updating static documentation
15+
paths-ignore:
16+
- '**/*.md'
17+
- '**/*.txt'
18+
schedule:
19+
- cron: "37 0 * * 1"
20+
21+
jobs:
22+
analyze:
23+
name: Analyze Code
24+
runs-on: ubuntu-latest
25+
# Limit permissions of this GitHub action. Can only write to security-events
26+
permissions:
27+
actions: read
28+
contents: read
29+
security-events: write
30+
31+
steps:
32+
# https://github.com/actions/checkout
33+
- name: Checkout repository
34+
uses: actions/checkout@v3
35+
36+
# Initializes the CodeQL tools for scanning.
37+
# https://github.com/github/codeql-action
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v2
40+
with:
41+
languages: javascript
42+
43+
# Autobuild attempts to build any compiled languages
44+
- name: Autobuild
45+
uses: github/codeql-action/autobuild@v2
46+
47+
# Perform GitHub Code Scanning.
48+
- name: Perform CodeQL Analysis
49+
uses: github/codeql-action/analyze@v2

.github/workflows/docker.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- 'dspace-**'
1313
pull_request:
1414

15+
permissions:
16+
contents: read # to fetch code (actions/checkout)
17+
1518
jobs:
1619
docker:
1720
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
@@ -39,11 +42,11 @@ jobs:
3942
steps:
4043
# https://github.com/actions/checkout
4144
- name: Checkout codebase
42-
uses: actions/checkout@v2
45+
uses: actions/checkout@v3
4346

4447
# https://github.com/docker/setup-buildx-action
4548
- name: Setup Docker Buildx
46-
uses: docker/setup-buildx-action@v1
49+
uses: docker/setup-buildx-action@v2
4750

4851
# https://github.com/docker/setup-qemu-action
4952
- name: Set up QEMU emulation to build for multiple architectures
@@ -53,7 +56,7 @@ jobs:
5356
- name: Login to DockerHub
5457
# Only login if not a PR, as PRs only trigger a Docker build and not a push
5558
if: github.event_name != 'pull_request'
56-
uses: docker/login-action@v1
59+
uses: docker/login-action@v2
5760
with:
5861
username: ${{ secrets.DOCKER_USERNAME }}
5962
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
@@ -65,7 +68,7 @@ jobs:
6568
# Get Metadata for docker_build step below
6669
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular' image
6770
id: meta_build
68-
uses: docker/metadata-action@v3
71+
uses: docker/metadata-action@v4
6972
with:
7073
images: dspace/dspace-angular
7174
tags: ${{ env.IMAGE_TAGS }}
@@ -74,7 +77,7 @@ jobs:
7477
# https://github.com/docker/build-push-action
7578
- name: Build and push 'dspace-angular' image
7679
id: docker_build
77-
uses: docker/build-push-action@v2
80+
uses: docker/build-push-action@v3
7881
with:
7982
context: .
8083
file: ./Dockerfile

.github/workflows/issue_opened.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,22 @@ on:
55
issues:
66
types: [opened]
77

8+
permissions: {}
89
jobs:
910
automation:
1011
runs-on: ubuntu-latest
1112
steps:
1213
# Add the new issue to a project board, if it needs triage
13-
# See https://github.com/marketplace/actions/create-project-card-action
14-
- name: Add issue to project board
14+
# See https://github.com/actions/add-to-project
15+
- name: Add issue to triage board
1516
# Only add to project board if issue is flagged as "needs triage" or has no labels
1617
# NOTE: By default we flag new issues as "needs triage" in our issue template
1718
if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '')
18-
uses: technote-space/create-project-card-action@v1
19+
uses: actions/add-to-project@v0.3.0
1920
# Note, the authentication token below is an ORG level Secret.
20-
# It must be created/recreated manually via a personal access token with "public_repo" and "admin:org" permissions
21+
# It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions
2122
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token
2223
# This is necessary because the "DSpace Backlog" project is an org level project (i.e. not repo specific)
2324
with:
24-
GITHUB_TOKEN: ${{ secrets.ORG_PROJECT_TOKEN }}
25-
PROJECT: DSpace Backlog
26-
COLUMN: Triage
27-
CHECK_ORG_PROJECT: true
28-
# Ignore errors
29-
continue-on-error: true
25+
github-token: ${{ secrets.TRIAGE_PROJECT_TOKEN }}
26+
project-url: https://github.com/orgs/DSpace/projects/24

.github/workflows/label_merge_conflicts.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,32 @@ name: Check for merge conflicts
55
# NOTE: This means merge conflicts are only checked for when a PR is merged to main.
66
on:
77
push:
8-
branches:
9-
- main
8+
branches: [ main ]
9+
# So that the `conflict_label_name` is removed if conflicts are resolved,
10+
# we allow this to run for `pull_request_target` so that github secrets are available.
11+
pull_request_target:
12+
types: [ synchronize ]
13+
14+
permissions: {}
1015

1116
jobs:
1217
triage:
18+
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
19+
if: github.repository == 'dspace/dspace-angular'
1320
runs-on: ubuntu-latest
21+
permissions:
22+
pull-requests: write
1423
steps:
15-
# See: https://github.com/mschilde/auto-label-merge-conflicts/
24+
# See: https://github.com/prince-chrismc/label-merge-conflicts-action
1625
- name: Auto-label PRs with merge conflicts
17-
uses: mschilde/auto-label-merge-conflicts@v2.0
26+
uses: prince-chrismc/label-merge-conflicts-action@v2
1827
# Add "merge conflict" label if a merge conflict is detected. Remove it when resolved.
1928
# Note, the authentication token is created automatically
2029
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token
2130
with:
22-
CONFLICT_LABEL_NAME: 'merge conflict'
23-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24-
# Ignore errors
25-
continue-on-error: true
31+
conflict_label_name: 'merge conflict'
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
conflict_comment: |
34+
Hi @${author},
35+
Conflicts have been detected against the base branch.
36+
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!

CONTRIBUTING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# How to Contribute
2+
3+
DSpace is a community built and supported project. We do not have a centralized development or support team, but have a dedicated group of volunteers who help us improve the software, documentation, resources, etc.
4+
5+
* [Contribute new code via a Pull Request](#contribute-new-code-via-a-pull-request)
6+
* [Contribute documentation](#contribute-documentation)
7+
* [Help others on mailing lists or Slack](#help-others-on-mailing-lists-or-slack)
8+
* [Join a working or interest group](#join-a-working-or-interest-group)
9+
10+
## Contribute new code via a Pull Request
11+
12+
We accept [GitHub Pull Requests (PRs)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) at any time from anyone.
13+
Contributors to each release are recognized in our [Release Notes](https://wiki.lyrasis.org/display/DSDOC7x/Release+Notes).
14+
15+
Code Contribution Checklist
16+
- [ ] PRs _should_ be smaller in size (ideally less than 1,000 lines of code, not including comments & tests)
17+
- [ ] PRs **must** pass [ESLint](https://eslint.org/) validation using `yarn lint`
18+
- [ ] PRs **must** not introduce circular dependencies (verified via `yarn check-circ-deps`)
19+
- [ ] PRs **must** include [TypeDoc](https://typedoc.org/) comments for _all new (or modified) public methods and classes_. Large or complex private methods should also have TypeDoc.
20+
- [ ] PRs **must** pass all automated pecs/tests and includes new/updated specs or tests based on the [Code Testing Guide](https://wiki.lyrasis.org/display/DSPACE/Code+Testing+Guide).
21+
- [ ] If a PR includes new libraries/dependencies (in `package.json`), then their software licenses **must** align with the [DSpace BSD License](https://github.com/DSpace/dspace-angular/blob/main/LICENSE) based on the [Licensing of Contributions](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines#CodeContributionGuidelines-LicensingofContributions) documentation.
22+
- [ ] Basic technical documentation _should_ be provided for any new features or configuration, either in the PR itself or in the DSpace Wiki documentation.
23+
- [ ] If a PR fixes an issue ticket, please [link them together](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue).
24+
25+
Additional details on the code contribution process can be found in our [Code Contribution Guidelines](https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines)
26+
27+
## Contribute documentation
28+
29+
DSpace Documentation is a collaborative effort in a shared Wiki. The latest documentation is at https://wiki.lyrasis.org/display/DSDOC7x
30+
31+
If you find areas of the DSpace Documentation which you wish to improve, please request a Wiki account by emailing wikihelp@lyrasis.org.
32+
Once you have an account setup, contact @tdonohue (via [Slack](https://wiki.lyrasis.org/display/DSPACE/Slack) or email) for access to edit our Documentation.
33+
34+
## Help others on mailing lists or Slack
35+
36+
DSpace has our own [Slack](https://wiki.lyrasis.org/display/DSPACE/Slack) community and [Mailing Lists](https://wiki.lyrasis.org/display/DSPACE/Mailing+Lists) where discussions take place and questions are answered.
37+
Anyone is welcome to join and help others. We just ask you to follow our [Code of Conduct](https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx) (adopted via LYRASIS).
38+
39+
## Join a working or interest group
40+
41+
Most of the work in building/improving DSpace comes via [Working Groups](https://wiki.lyrasis.org/display/DSPACE/DSpace+Working+Groups) or [Interest Groups](https://wiki.lyrasis.org/display/DSPACE/DSpace+Interest+Groups).
42+
43+
All working/interest groups are open to anyone to join and participate. A few key groups to be aware of include:
44+
45+
* [DSpace 7 Working Group](https://wiki.lyrasis.org/display/DSPACE/DSpace+7+Working+Group) - This is the main (mostly volunteer) development team. We meet weekly to review our current development [project board](https://github.com/orgs/DSpace/projects), assigning tickets and/or PRs.
46+
* [DSpace Community Advisory Team (DCAT)](https://wiki.lyrasis.org/display/cmtygp/DSpace+Community+Advisory+Team) - This is an interest group for repository managers/administrators. We meet monthly to discuss DSpace, share tips & provide feedback back to developers.

0 commit comments

Comments
 (0)