Skip to content

Commit 4df0008

Browse files
committed
Merge branch 'dspace-cris-7' into DSC-1336-improve-handling-of-dynamic-content-in-ssr
# Conflicts: # src/app/collection-page/collection-page.component.ts # src/app/search-page/search-tracker.component.ts # src/app/shared/search/search.component.ts # src/app/shared/search/themed-search.component.ts
2 parents a454efc + 8a3781e commit 4df0008

1,166 files changed

Lines changed: 56200 additions & 32422 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: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"eslint-plugin-jsdoc",
88
"eslint-plugin-deprecation",
99
"unused-imports",
10-
"eslint-plugin-lodash"
10+
"eslint-plugin-lodash",
11+
"eslint-plugin-jsonc"
1112
],
1213
"overrides": [
1314
{
@@ -224,6 +225,42 @@
224225
"@angular-eslint/template/no-negated-async": "off",
225226
"@angular-eslint/template/eqeqeq": "off"
226227
}
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+
}
227264
}
228265
]
229266
}

.github/disabled-workflows/pull_request_opened.yml

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

.github/workflows/build.yml

Lines changed: 50 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,24 @@ jobs:
1515
env:
1616
# The ci step will test the dspace-angular code against DSpace REST.
1717
# Direct that step to utilize a DSpace REST service that has been started in docker.
18+
# NOTE: These settings should be kept in sync with those in [src]/docker/docker-compose-ci.yml
1819
DSPACE_REST_HOST: 127.0.0.1
1920
DSPACE_REST_PORT: 8080
2021
DSPACE_REST_NAMESPACE: '/server'
2122
DSPACE_REST_SSL: false
2223
# Spin up UI on 127.0.0.1 to avoid host resolution issues in e2e tests with Node 18+
2324
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
2431
# When Chrome version is specified, we pin to a specific version of Chrome
2532
# Comment this out to use the latest release
2633
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'
2736
strategy:
2837
# Create a matrix of Node versions to test against (in parallel)
2938
matrix:
@@ -61,7 +70,7 @@ jobs:
6170
# https://github.com/actions/cache/blob/main/examples.md#node---yarn
6271
- name: Get Yarn cache directory
6372
id: yarn-cache-dir-path
64-
run: echo "::set-output name=dir::$(yarn cache dir)"
73+
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
6574
- name: Cache Yarn dependencies
6675
uses: actions/cache@v3
6776
with:
@@ -86,12 +95,16 @@ jobs:
8695
- name: Run specs (unit tests)
8796
run: yarn run test:headless
8897

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)
89100
# NOTE: Angular CLI only supports code coverage for specs. See https://github.com/angular/angular-cli/issues/6286
90-
# Upload coverage reports to Codecov (for one version of Node only)
91-
# https://github.com/codecov/codecov-action
92-
- name: Upload coverage to Codecov.io
93-
uses: codecov/codecov-action@v3
94-
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
95108

96109
# Using docker-compose start backend using CI configuration
97110
# and load assetstore from a cached copy
@@ -105,11 +118,10 @@ jobs:
105118
# https://github.com/cypress-io/github-action
106119
# (NOTE: to run these e2e tests locally, just use 'ng e2e')
107120
- name: Run e2e tests (integration tests)
108-
uses: cypress-io/github-action@v4
121+
uses: cypress-io/github-action@v5
109122
with:
110-
# Run tests in Chrome, headless mode
123+
# Run tests in Chrome, headless mode (default)
111124
browser: chrome
112-
headless: true
113125
# Start app before running tests (will be stopped automatically after tests finish)
114126
start: yarn run serve:ssr
115127
# Wait for backend & frontend to be available
@@ -169,3 +181,32 @@ jobs:
169181

170182
- name: Shutdown Docker containers
171183
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: 7 additions & 3 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'

.github/workflows/docker.yml

Lines changed: 83 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,29 +15,35 @@ on:
1515
permissions:
1616
contents: read # to fetch code (actions/checkout)
1717

18+
19+
env:
20+
# Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action)
21+
# For a new commit on default branch (main), use the literal tag 'latest' on Docker image.
22+
# For a new commit on other branches, use the branch name as the tag for Docker image.
23+
# For a new tag, copy that tag name as the tag for Docker image.
24+
IMAGE_TAGS: |
25+
type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
26+
type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
27+
type=ref,event=tag
28+
# Define default tag "flavor" for docker/metadata-action per
29+
# https://github.com/docker/metadata-action#flavor-input
30+
# We manage the 'latest' tag ourselves to the 'main' branch (see settings above)
31+
TAGS_FLAVOR: |
32+
latest=false
33+
# Architectures / Platforms for which we will build Docker images
34+
# If this is a PR, we ONLY build for AMD64. For PRs we only do a sanity check test to ensure Docker builds work.
35+
# If this is NOT a PR (e.g. a tag or merge commit), also build for ARM64.
36+
PLATFORMS: linux/amd64${{ github.event_name != 'pull_request' && ', linux/arm64' || '' }}
37+
38+
1839
jobs:
19-
docker:
40+
###############################################
41+
# Build/Push the 'dspace/dspace-angular' image
42+
###############################################
43+
dspace-angular:
2044
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
2145
if: github.repository == 'dspace/dspace-angular'
2246
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' || '' }}
4147

4248
steps:
4349
# https://github.com/actions/checkout
@@ -61,9 +67,6 @@ jobs:
6167
username: ${{ secrets.DOCKER_USERNAME }}
6268
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
6369

64-
###############################################
65-
# Build/Push the 'dspace/dspace-angular' image
66-
###############################################
6770
# https://github.com/docker/metadata-action
6871
# Get Metadata for docker_build step below
6972
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular' image
@@ -77,7 +80,7 @@ jobs:
7780
# https://github.com/docker/build-push-action
7881
- name: Build and push 'dspace-angular' image
7982
id: docker_build
80-
uses: docker/build-push-action@v3
83+
uses: docker/build-push-action@v4
8184
with:
8285
context: .
8386
file: ./Dockerfile
@@ -88,3 +91,60 @@ jobs:
8891
# Use tags / labels provided by 'docker/metadata-action' above
8992
tags: ${{ steps.meta_build.outputs.tags }}
9093
labels: ${{ steps.meta_build.outputs.labels }}
94+
95+
#############################################################
96+
# Build/Push the 'dspace/dspace-angular' image ('-dist' tag)
97+
#############################################################
98+
dspace-angular-dist:
99+
# Ensure this job never runs on forked repos. It's only executed for 'dspace/dspace-angular'
100+
if: github.repository == 'dspace/dspace-angular'
101+
runs-on: ubuntu-latest
102+
103+
steps:
104+
# https://github.com/actions/checkout
105+
- name: Checkout codebase
106+
uses: actions/checkout@v3
107+
108+
# https://github.com/docker/setup-buildx-action
109+
- name: Setup Docker Buildx
110+
uses: docker/setup-buildx-action@v2
111+
112+
# https://github.com/docker/setup-qemu-action
113+
- name: Set up QEMU emulation to build for multiple architectures
114+
uses: docker/setup-qemu-action@v2
115+
116+
# https://github.com/docker/login-action
117+
- name: Login to DockerHub
118+
# Only login if not a PR, as PRs only trigger a Docker build and not a push
119+
if: github.event_name != 'pull_request'
120+
uses: docker/login-action@v2
121+
with:
122+
username: ${{ secrets.DOCKER_USERNAME }}
123+
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
124+
125+
# https://github.com/docker/metadata-action
126+
# Get Metadata for docker_build_dist step below
127+
- name: Sync metadata (tags, labels) from GitHub to Docker for 'dspace-angular-dist' image
128+
id: meta_build_dist
129+
uses: docker/metadata-action@v4
130+
with:
131+
images: dspace/dspace-angular
132+
tags: ${{ env.IMAGE_TAGS }}
133+
# As this is a "dist" image, its tags are all suffixed with "-dist". Otherwise, it uses the same
134+
# tagging logic as the primary 'dspace/dspace-angular' image above.
135+
flavor: ${{ env.TAGS_FLAVOR }}
136+
suffix=-dist
137+
138+
- name: Build and push 'dspace-angular-dist' image
139+
id: docker_build_dist
140+
uses: docker/build-push-action@v4
141+
with:
142+
context: .
143+
file: ./Dockerfile.dist
144+
platforms: ${{ env.PLATFORMS }}
145+
# For pull requests, we run the Docker build (to ensure no PR changes break the build),
146+
# but we ONLY do an image push to DockerHub if it's NOT a PR
147+
push: ${{ github.event_name != 'pull_request' }}
148+
# Use tags / labels provided by 'docker/metadata-action' above
149+
tags: ${{ steps.meta_build_dist.outputs.tags }}
150+
labels: ${{ steps.meta_build_dist.outputs.labels }}

.github/workflows/issue_opened.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
# Only add to project board if issue is flagged as "needs triage" or has no labels
1717
# NOTE: By default we flag new issues as "needs triage" in our issue template
1818
if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '')
19-
uses: actions/add-to-project@v0.3.0
19+
uses: actions/add-to-project@v0.5.0
2020
# Note, the authentication token below is an ORG level Secret.
2121
# It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions
2222
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token

.github/workflows/label_merge_conflicts.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# This workflow checks open PRs for merge conflicts and labels them when conflicts are found
22
name: Check for merge conflicts
33

4-
# Run whenever the "main" branch is updated
5-
# NOTE: This means merge conflicts are only checked for when a PR is merged to main.
4+
# Run this for all pushes (i.e. merges) to 'main' or maintenance branches
65
on:
76
push:
8-
branches: [ main ]
7+
branches:
8+
- main
9+
- 'dspace-**'
910
# So that the `conflict_label_name` is removed if conflicts are resolved,
1011
# we allow this to run for `pull_request_target` so that github secrets are available.
1112
pull_request_target:
@@ -23,7 +24,9 @@ jobs:
2324
steps:
2425
# See: https://github.com/prince-chrismc/label-merge-conflicts-action
2526
- name: Auto-label PRs with merge conflicts
26-
uses: prince-chrismc/label-merge-conflicts-action@v2
27+
uses: prince-chrismc/label-merge-conflicts-action@v3
28+
# Ignore any failures -- may occur (randomly?) for older, outdated PRs.
29+
continue-on-error: true
2730
# Add "merge conflict" label if a merge conflict is detected. Remove it when resolved.
2831
# Note, the authentication token is created automatically
2932
# See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token

0 commit comments

Comments
 (0)