Skip to content

Commit d8a8235

Browse files
Merge remote-tracking branch 'upstream/main' into fix-broken-item-mapper-pagination_contribute-main
# Conflicts: # src/app/collection-page/collection-item-mapper/collection-item-mapper.component.ts
2 parents 45e8977 + a8f3194 commit d8a8235

3,151 files changed

Lines changed: 109774 additions & 40427 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: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
"eslint-plugin-deprecation",
99
"unused-imports",
1010
"eslint-plugin-lodash",
11-
"eslint-plugin-jsonc"
11+
"eslint-plugin-jsonc",
12+
"eslint-plugin-rxjs",
13+
"eslint-plugin-simple-import-sort",
14+
"eslint-plugin-import-newlines"
1215
],
1316
"overrides": [
1417
{
@@ -27,17 +30,29 @@
2730
"plugin:@typescript-eslint/recommended",
2831
"plugin:@typescript-eslint/recommended-requiring-type-checking",
2932
"plugin:@angular-eslint/recommended",
30-
"plugin:@angular-eslint/template/process-inline-templates"
33+
"plugin:@angular-eslint/template/process-inline-templates",
34+
"plugin:rxjs/recommended"
3135
],
3236
"rules": {
37+
"indent": [
38+
"error",
39+
2,
40+
{
41+
"SwitchCase": 1
42+
}
43+
],
3344
"max-classes-per-file": [
3445
"error",
3546
1
3647
],
3748
"comma-dangle": [
38-
"off",
49+
"error",
3950
"always-multiline"
4051
],
52+
"object-curly-spacing": [
53+
"error",
54+
"always"
55+
],
4156
"eol-last": [
4257
"error",
4358
"always"
@@ -104,15 +119,13 @@
104119
"allowTernary": true
105120
}
106121
],
107-
"prefer-const": "off", // todo: re-enable & fix errors (more strict than it used to be in TSLint)
122+
"prefer-const": "error",
123+
"no-case-declarations": "error",
124+
"no-extra-boolean-cast": "error",
108125
"prefer-spread": "off",
109126
"no-underscore-dangle": "off",
110-
111-
// todo: disabled rules from eslint:recommended, consider re-enabling & fixing
112127
"no-prototype-builtins": "off",
113128
"no-useless-escape": "off",
114-
"no-case-declarations": "off",
115-
"no-extra-boolean-cast": "off",
116129

117130
"@angular-eslint/directive-selector": [
118131
"error",
@@ -183,7 +196,7 @@
183196
],
184197
"@typescript-eslint/type-annotation-spacing": "error",
185198
"@typescript-eslint/unified-signatures": "error",
186-
"@typescript-eslint/ban-types": "warn", // todo: deal with {} type issues & re-enable
199+
"@typescript-eslint/ban-types": "error",
187200
"@typescript-eslint/no-floating-promises": "warn",
188201
"@typescript-eslint/no-misused-promises": "warn",
189202
"@typescript-eslint/restrict-plus-operands": "warn",
@@ -203,14 +216,45 @@
203216

204217
"deprecation/deprecation": "warn",
205218

219+
"simple-import-sort/imports": "error",
220+
"simple-import-sort/exports": "error",
206221
"import/order": "off",
222+
"import/first": "error",
223+
"import/newline-after-import": "error",
224+
"import/no-duplicates": "error",
207225
"import/no-deprecated": "warn",
208226
"import/no-namespace": "error",
227+
"import-newlines/enforce": [
228+
"error",
229+
{
230+
"items": 1,
231+
"semi": true,
232+
"forceSingleLine": true
233+
}
234+
],
235+
209236
"unused-imports/no-unused-imports": "error",
210237
"lodash/import-scope": [
211238
"error",
212239
"method"
213-
]
240+
],
241+
242+
"rxjs/no-nested-subscribe": "off" // todo: go over _all_ cases
243+
}
244+
},
245+
{
246+
"files": [
247+
"*.spec.ts"
248+
],
249+
"parserOptions": {
250+
"project": [
251+
"./tsconfig.json",
252+
"./cypress/tsconfig.json"
253+
],
254+
"createDefaultProgram": true
255+
},
256+
"rules": {
257+
"prefer-const": "off"
214258
}
215259
},
216260
{
@@ -219,12 +263,7 @@
219263
],
220264
"extends": [
221265
"plugin:@angular-eslint/template/recommended"
222-
],
223-
"rules": {
224-
// todo: re-enable & fix errors
225-
"@angular-eslint/template/no-negated-async": "off",
226-
"@angular-eslint/template/eqeqeq": "off"
227-
}
266+
]
228267
},
229268
{
230269
"files": [

.github/disabled-workflows/pull_request_opened.yml

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

.github/workflows/build.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
#CHROME_VERSION: "90.0.4430.212-1"
3434
# Bump Node heap size (OOM in CI after upgrading to Angular 15)
3535
NODE_OPTIONS: '--max-old-space-size=4096'
36+
# Project name to use when running docker-compose prior to e2e tests
37+
COMPOSE_PROJECT_NAME: 'ci'
3638
strategy:
3739
# Create a matrix of Node versions to test against (in parallel)
3840
matrix:
@@ -43,11 +45,11 @@ jobs:
4345
steps:
4446
# https://github.com/actions/checkout
4547
- name: Checkout codebase
46-
uses: actions/checkout@v3
48+
uses: actions/checkout@v4
4749

4850
# https://github.com/actions/setup-node
4951
- name: Install Node.js ${{ matrix.node-version }}
50-
uses: actions/setup-node@v3
52+
uses: actions/setup-node@v4
5153
with:
5254
node-version: ${{ matrix.node-version }}
5355

@@ -118,7 +120,7 @@ jobs:
118120
# https://github.com/cypress-io/github-action
119121
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
120122
- name: Run e2e tests (integration tests)
121-
uses: cypress-io/github-action@v5
123+
uses: cypress-io/github-action@v6
122124
with:
123125
# Run tests in Chrome, headless mode (default)
124126
browser: chrome
@@ -191,7 +193,7 @@ jobs:
191193
runs-on: ubuntu-latest
192194
steps:
193195
- name: Checkout
194-
uses: actions/checkout@v3
196+
uses: actions/checkout@v4
195197

196198
# Download artifacts from previous 'tests' job
197199
- name: Download coverage artifacts
@@ -203,10 +205,14 @@ jobs:
203205
# Retry action: https://github.com/marketplace/actions/retry-action
204206
# Codecov action: https://github.com/codecov/codecov-action
205207
- name: Upload coverage to Codecov.io
206-
uses: Wandalen/wretry.action@v1.0.36
208+
uses: Wandalen/wretry.action@v1.3.0
207209
with:
208210
action: codecov/codecov-action@v3
209-
# Try upload 5 times max
211+
# Ensure codecov-action throws an error when it fails to upload
212+
# This allows us to auto-restart the action if an error is thrown
213+
with: |
214+
fail_ci_if_error: true
215+
# Try re-running action 5 times max
210216
attempt_limit: 5
211217
# Run again in 30 seconds
212218
attempt_delay: 30000

.github/workflows/codescan.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@
55
# because CodeQL requires a fresh build with all tests *disabled*.
66
name: "Code Scanning"
77

8-
# Run this code scan for all pushes / PRs to main branch. Also run once a week.
8+
# Run this code scan for all pushes / PRs to main or maintenance branches. Also run once a week.
99
on:
1010
push:
11-
branches: [ main ]
11+
branches:
12+
- main
13+
- 'dspace-**'
1214
pull_request:
13-
branches: [ main ]
15+
branches:
16+
- main
17+
- 'dspace-**'
1418
# Don't run if PR is only updating static documentation
1519
paths-ignore:
1620
- '**/*.md'
@@ -31,7 +35,7 @@ jobs:
3135
steps:
3236
# https://github.com/actions/checkout
3337
- name: Checkout repository
34-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3539

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

.github/workflows/docker.yml

Lines changed: 39 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Docker images
33

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
6+
# 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
8+
#
69
on:
710
push:
811
branches:
@@ -16,105 +19,41 @@ permissions:
1619
contents: read # to fetch code (actions/checkout)
1720

1821
jobs:
19-
docker:
22+
#############################################################
23+
# Build/Push the 'dspace/dspace-angular' image
24+
#############################################################
25+
dspace-angular:
2026
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
2127
if: github.repository == 'dspace/dspace-angular'
22-
runs-on: ubuntu-latest
23-
env:
24-
# Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action)
25-
# For a new commit on default branch (main), use the literal tag 'dspace-7_x' on Docker image.
26-
# For a new commit on other branches, use the branch name as the tag for Docker image.
27-
# For a new tag, copy that tag name as the tag for Docker image.
28-
IMAGE_TAGS: |
29-
type=raw,value=dspace-7_x,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
30-
type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
31-
type=ref,event=tag
32-
# Define default tag "flavor" for docker/metadata-action per
33-
# https://github.com/docker/metadata-action#flavor-input
34-
# We turn off 'latest' tag by default.
35-
TAGS_FLAVOR: |
36-
latest=false
37-
# Architectures / Platforms for which we will build Docker images
38-
# If this is a PR, we ONLY build for AMD64. For PRs we only do a sanity check test to ensure Docker builds work.
39-
# If this is NOT a PR (e.g. a tag or merge commit), also build for ARM64.
40-
PLATFORMS: linux/amd64${{ github.event_name != 'pull_request' && ', linux/arm64' || '' }}
41-
42-
steps:
43-
# https://github.com/actions/checkout
44-
- name: Checkout codebase
45-
uses: actions/checkout@v3
46-
47-
# https://github.com/docker/setup-buildx-action
48-
- name: Setup Docker Buildx
49-
uses: docker/setup-buildx-action@v2
50-
51-
# https://github.com/docker/setup-qemu-action
52-
- name: Set up QEMU emulation to build for multiple architectures
53-
uses: docker/setup-qemu-action@v2
54-
55-
# https://github.com/docker/login-action
56-
- name: Login to DockerHub
57-
# Only login if not a PR, as PRs only trigger a Docker build and not a push
58-
if: github.event_name != 'pull_request'
59-
uses: docker/login-action@v2
60-
with:
61-
username: ${{ secrets.DOCKER_USERNAME }}
62-
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
63-
64-
###############################################
65-
# Build/Push the 'dspace/dspace-angular' image
66-
###############################################
67-
# https://github.com/docker/metadata-action
68-
# Get Metadata for docker_build step below
69-
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular' image
70-
id: meta_build
71-
uses: docker/metadata-action@v4
72-
with:
73-
images: dspace/dspace-angular
74-
tags: ${{ env.IMAGE_TAGS }}
75-
flavor: ${{ env.TAGS_FLAVOR }}
76-
77-
# https://github.com/docker/build-push-action
78-
- name: Build and push 'dspace-angular' image
79-
id: docker_build
80-
uses: docker/build-push-action@v3
81-
with:
82-
context: .
83-
file: ./Dockerfile
84-
platforms: ${{ env.PLATFORMS }}
85-
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
86-
# but we ONLY do an image push to DockerHub if it's NOT a PR
87-
push: ${{ github.event_name != 'pull_request' }}
88-
# Use tags / labels provided by 'docker/metadata-action' above
89-
tags: ${{ steps.meta_build.outputs.tags }}
90-
labels: ${{ steps.meta_build.outputs.labels }}
91-
92-
#####################################################
93-
# Build/Push the 'dspace/dspace-angular' image ('-dist' tag)
94-
#####################################################
95-
# https://github.com/docker/metadata-action
96-
# Get Metadata for docker_build_dist step below
97-
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular-dist' image
98-
id: meta_build_dist
99-
uses: docker/metadata-action@v4
100-
with:
101-
images: dspace/dspace-angular
102-
tags: ${{ env.IMAGE_TAGS }}
103-
# As this is a "dist" image, its tags are all suffixed with "-dist". Otherwise, it uses the same
104-
# tagging logic as the primary 'dspace/dspace-angular' image above.
105-
flavor: ${{ env.TAGS_FLAVOR }}
106-
suffix=-dist
107-
108-
- name: Build and push 'dspace-angular-dist' image
109-
id: docker_build_dist
110-
uses: docker/build-push-action@v3
111-
with:
112-
context: .
113-
file: ./Dockerfile.dist
114-
platforms: ${{ env.PLATFORMS }}
115-
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
116-
# but we ONLY do an image push to DockerHub if it's NOT a PR
117-
push: ${{ github.event_name != 'pull_request' }}
118-
# Use tags / labels provided by 'docker/metadata-action' above
119-
tags: ${{ steps.meta_build_dist.outputs.tags }}
120-
labels: ${{ steps.meta_build_dist.outputs.labels }}
28+
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
29+
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@main
30+
with:
31+
build_id: dspace-angular
32+
image_name: dspace/dspace-angular
33+
dockerfile_path: ./Dockerfile
34+
secrets:
35+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
36+
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
37+
38+
#############################################################
39+
# Build/Push the 'dspace/dspace-angular' image ('-dist' tag)
40+
#############################################################
41+
dspace-angular-dist:
42+
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
43+
if: github.repository == 'dspace/dspace-angular'
44+
# Use the reusable-docker-build.yml script from DSpace/DSpace repo to build our Docker image
45+
uses: DSpace/DSpace/.github/workflows/reusable-docker-build.yml@main
46+
with:
47+
build_id: dspace-angular-dist
48+
image_name: dspace/dspace-angular
49+
dockerfile_path: ./Dockerfile.dist
50+
# As this is a "dist" image, its tags are all suffixed with "-dist". Otherwise, it uses the same
51+
# tagging logic as the primary 'dspace/dspace-angular' image above.
52+
tags_flavor: suffix=-dist
53+
secrets:
54+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
55+
DOCKER_ACCESS_TOKEN: ${{ secrets.DOCKER_ACCESS_TOKEN }}
56+
# Enable redeploy of sandbox & demo if the branch for this image matches the deployment branch of
57+
# these sites as specified in reusable-docker-build.xml
58+
REDEPLOY_SANDBOX_URL: ${{ secrets.REDEPLOY_SANDBOX_URL }}
59+
REDEPLOY_DEMO_URL: ${{ secrets.REDEPLOY_DEMO_URL }}

0 commit comments

Comments
 (0)