Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/rsd-v2-release' into 923-add-sup…
Browse files Browse the repository at this point in the history
…port-for-categories-for-software-and-projects
  • Loading branch information
fembau committed Aug 28, 2023
2 parents 7439667 + ab1edac commit 56b3896
Show file tree
Hide file tree
Showing 642 changed files with 27,454 additions and 10,790 deletions.
27 changes: 26 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RSD_AUTH_URL=http://auth:7000
# Allowed values are: SURFCONEXT, HELMHOLTZAAI, ORCID or LOCAL
# if env value is not provided default provider is set to be SURFCONEXT
# if you add the value "LOCAL", then local accounts are enabled, USE THIS FOR TESTING PURPOSES ONLY
RSD_AUTH_PROVIDERS=SURFCONEXT;ORCID;LOCAL
RSD_AUTH_PROVIDERS=SURFCONEXT;ORCID;AZURE;LOCAL

# Define a semicolon-separated list of user email addresses (exact match incl. the letter casing) of RSD admins.
# When someome authenticates with an email address in this list,
Expand Down Expand Up @@ -120,6 +120,27 @@ ORCID_SCOPES=openid
# consumed by: frontend/utils/loginHelpers
ORCID_RESPONSE_MODE=query

# AZURE ACTIVE DIRECTORY
# consumed by: authentication, frontend/utils/loginHelpers
AZURE_CLIENT_ID=
# consumed by: authentication, frontend/utils/loginHelpers
AZURE_REDIRECT=http://localhost/auth/login/azure
# consumed by: authentication, frontend/utils/loginHelpers
AZURE_WELL_KNOWN_URL=
# consumed by: authentication, frontend/utils/loginHelpers
AZURE_SCOPES=openid+email+profile
# consumed by: authentication, frontend/utils/loginHelpers
AZURE_LOGIN_PROMPT=select_account
# consumed by: frontend
# the name displayed to users when multiple providers are configured
AZURE_DISPLAY_NAME="Imperial College Login"
# consumed by: frontend
# the description text displayed to users when multiple providers are configured
AZURE_DESCRIPTION_HTML="Sign in with your institutional credentials"
# consumed by: authentication
# the organisation recorded for users logged in via this provider
AZURE_ORGANISATION=

# max requests to the GitHub API per run, runs 10 times per hour
# optional, comment out if not available, a default of 6 will be used
# consumed by: scrapers
Expand Down Expand Up @@ -164,6 +185,10 @@ AUTH_HELMHOLTZAAI_CLIENT_SECRET=
# obtain the secret from the project team
AUTH_ORCID_CLIENT_SECRET=

# Azure Active Directory
# consumed by services: authentication
AUTH_AZURE_CLIENT_SECRET=

# POSTGREST JWT SECRET
# consumed by services: authentication, frontend (auth-node), auth-tests, scrapers
# generate random/strong password with at least 32 characters
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/authentication_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SPDX-FileCopyrightText: 2022 - 2023 Ewan Cahen (Netherlands eScience Center) <[email protected]>
# SPDX-FileCopyrightText: 2022 - 2023 Netherlands eScience Center
# SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all)
# SPDX-FileCopyrightText: 2022 dv4all
#
# SPDX-License-Identifier: Apache-2.0

name: authentication tests

on:
workflow_dispatch:
push:
branches:
- main
paths:
- "authentication/**"
pull_request:
paths:
- "authentication/**"

jobs:
authentication-tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: "Maven JUnit tests and JaCoCo test report"
working-directory: authentication
run: |
JAVA_HOME=$JAVA_HOME_17_X64 mvn verify
- name: SonarCloud Scan authentication
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
working-directory: authentication
run: JAVA_HOME=$JAVA_HOME_17_X64 mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=nl.research-software:authentication -Pcoverage
39 changes: 39 additions & 0 deletions .github/workflows/database_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# SPDX-FileCopyrightText: 2023 Ewan Cahen (Netherlands eScience Center) <[email protected]>
# SPDX-FileCopyrightText: 2023 Netherlands eScience Center
#
# SPDX-License-Identifier: Apache-2.0

name: database scan

on:
workflow_dispatch:
push:
branches:
- main
paths:
- "database/**"
pull_request:
paths:
- "database/**"

jobs:
build:
name: Build and analyse with SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: SonarCloud Scan database
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: database
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/frontend_tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# SPDX-FileCopyrightText: 2022 - 2023 Dusan Mijatovic (dv4all)
# SPDX-FileCopyrightText: 2022 - 2023 dv4all
# SPDX-FileCopyrightText: 2023 Dusan Mijatovic (Netherlands eScience Center)
# SPDX-FileCopyrightText: 2023 Ewan Cahen (Netherlands eScience Center) <[email protected]>
# SPDX-FileCopyrightText: 2023 Netherlands eScience Center
#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -21,6 +24,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: "install node v18.5 and cash yarn"
uses: actions/setup-node@v3
with:
Expand All @@ -30,9 +35,25 @@ jobs:
- name: "install dependencies"
working-directory: frontend
run: yarn install --frozen-lockfile
- name: "run eslint check"
working-directory: frontend
run: yarn lint
- name: "run unit test"
working-directory: frontend
run: yarn test:coverage
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: SonarCloud Scan frontend
uses: sonarsource/sonarcloud-github-action@master
with:
projectBaseDir: frontend
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: "run build test"
working-directory: frontend
run: yarn build
35 changes: 30 additions & 5 deletions .github/workflows/scrapers_tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# SPDX-FileCopyrightText: 2022 - 2023 Ewan Cahen (Netherlands eScience Center) <[email protected]>
# SPDX-FileCopyrightText: 2022 - 2023 Netherlands eScience Center
# SPDX-FileCopyrightText: 2022 Dusan Mijatovic (dv4all)
# SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) <[email protected]>
# SPDX-FileCopyrightText: 2022 Netherlands eScience Center
# SPDX-FileCopyrightText: 2022 dv4all
#
# SPDX-License-Identifier: Apache-2.0

name: scrapers tests

on:
workflow_dispatch:
push:
branches:
- main
paths:
- "scrapers/**"
pull_request:
paths:
- "scrapers/**"
Expand All @@ -17,8 +23,27 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: "Maven JUnit tests"
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: "Maven JUnit tests and JaCoCo test report"
working-directory: scrapers
run: |
JAVA_HOME=$JAVA_HOME_17_X64 mvn test
JAVA_HOME=$JAVA_HOME_17_X64 mvn verify
- name: SonarCloud Scan scrapers
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
working-directory: scrapers
run: JAVA_HOME=$JAVA_HOME_17_X64 mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=nl.research-software:scrapers -Pcoverage
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# SPDX-FileCopyrightText: 2021 - 2022 Dusan Mijatovic (dv4all)
# SPDX-FileCopyrightText: 2021 - 2022 Ewan Cahen (Netherlands eScience Center) <[email protected]>
# SPDX-FileCopyrightText: 2021 - 2022 Netherlands eScience Center
# SPDX-FileCopyrightText: 2021 - 2022 dv4all
# SPDX-FileCopyrightText: 2021 - 2023 Netherlands eScience Center
# SPDX-FileCopyrightText: 2023 Dusan Mijatovic (Netherlands eScience Center)
#
# SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -52,3 +53,4 @@ yarn-error.log*

# typescript
*.tsbuildinfo
.history
14 changes: 11 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"editor.quickSuggestions": {
"strings": true
},
"tailwindCSS.includeLanguages":{
"tailwindCSS.includeLanguages": {
"plaintext": "html"
},
"[java]": {
Expand All @@ -39,5 +39,13 @@
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false
}
}
},
"[typescriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
}
6 changes: 5 additions & 1 deletion .vscode/settings.json.license
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
SPDX-FileCopyrightText: 2022 Netherlands eScience Center
SPDX-FileCopyrightText: 2022 - 2023 Netherlands eScience Center
SPDX-FileCopyrightText: 2023 Dusan Mijatovic (Netherlands eScience Center)
SPDX-FileCopyrightText: 2023 Dusan Mijatovic (dv4all)
SPDX-FileCopyrightText: 2023 dv4all

SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: CC0-1.0
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# SPDX-FileCopyrightText: 2022 - 2023 Netherlands eScience Center
# SPDX-FileCopyrightText: 2022 - 2023 dv4all
# SPDX-FileCopyrightText: 2022 Jesús García Gonzalez (Netherlands eScience Center) <[email protected]>
# SPDX-FileCopyrightText: 2023 Dusan Mijatovic (Netherlands eScience Center)
#
# SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -45,11 +46,6 @@ install: clean
clean:
docker compose down --volumes


dev:
docker compose up --scale scrapers=0 --detach
make -j 2 dev-docs dev-frontend # Run concurrently

stop:
docker compose down

Expand All @@ -73,7 +69,10 @@ frontend/.env.local: .env
sed -i 's/POSTGREST_URL=http:\/\/backend:3500/POSTGREST_URL=http:\/\/localhost\/api\/v1/g' frontend/.env.local
sed -i 's/RSD_AUTH_URL=http:\/\/auth:7000/RSD_AUTH_URL=http:\/\/localhost\/auth/g' frontend/.env.local

dev-frontend: frontend/.env.local
dev: frontend/.env.local
docker compose build # build all services
docker compose up --scale data-generation=1 --scale scrapers=0 --scale frontend=0 --detach
# open http://localhost:3000 to see the application running
cd frontend && yarn dev

# run end-to-end test locally
Expand Down
32 changes: 30 additions & 2 deletions authentication/pom.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
SPDX-FileCopyrightText: 2021 - 2022 Ewan Cahen (Netherlands eScience Center) <[email protected]>
SPDX-FileCopyrightText: 2021 - 2022 Netherlands eScience Center
SPDX-FileCopyrightText: 2021 - 2023 Ewan Cahen (Netherlands eScience Center) <[email protected]>
SPDX-FileCopyrightText: 2021 - 2023 Netherlands eScience Center
SPDX-FileCopyrightText: 2022 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences
SPDX-FileCopyrightText: 2022 Matthias Rüster (GFZ) <[email protected]>
Expand All @@ -22,6 +22,8 @@ SPDX-License-Identifier: Apache-2.0
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<sonar.organization>research-software-directory</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
</properties>

<build>
Expand Down Expand Up @@ -61,6 +63,32 @@ SPDX-License-Identifier: Apache-2.0
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M6</version>
</plugin>

<!-- https://docs.sonarcloud.io/enriching/test-coverage/java-test-coverage/ -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.10</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>XML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
Loading

0 comments on commit 56b3896

Please sign in to comment.