From 24bee0722df7df8509271d1d7bc1ad7d0df524f3 Mon Sep 17 00:00:00 2001
From: Camelia Dumitru <62257307+Camelia-Orcid@users.noreply.github.com>
Date: Wed, 6 Nov 2024 14:30:00 +0000
Subject: [PATCH 1/8] Fixed typo and the properties to match the papi ones
(#7127)
---
.../orcid/scheduler/report/PapiDailyLimitReport.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/report/PapiDailyLimitReport.java b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/report/PapiDailyLimitReport.java
index 0e63e4f905..898a1896c8 100644
--- a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/report/PapiDailyLimitReport.java
+++ b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/report/PapiDailyLimitReport.java
@@ -37,13 +37,13 @@ public class PapiDailyLimitReport {
@Value("${org.orcid.core.orgs.load.slackUser}")
private String slackUser;
- @Value("${rate.limit.anonymous.requests}")
+ @Value("${org.orcid.papi.rate.limit.anonymous.requests:10000}")
private int anonymousRequestLimit;
- @Value("${rate.limit.known.requests}")
+ @Value("${org.orcid.papi.rate.limit.known.requests:40000}")
private int knownRequestLimit;
- @Value("${rate.limit.enabled:false}")
+ @Value("${org.orcid.papi.rate.limit.enabled:false}")
private boolean enableRateLimiting;
@Autowired
@@ -72,12 +72,12 @@ public void papiDailyLimitReport() {
LocalDate yesterday = LocalDate.now().minusDays(1);
String mode = Features.ENABLE_PAPI_RATE_LIMITING.isActive() ? "ENFORCEMENT" : "MONITORING";
String SLACK_INTRO_MSG = "Public API Rate limit report - Date: " + yesterday.toString() + "\n Current Anonymous Requests Limit: " + anonymousRequestLimit
- + "\n Current Public API Clients Limit: " + knownRequestLimit + "\n Mode: " + mode;
+ + "\nCurrent Public API Clients Limit: " + knownRequestLimit + "\n Mode: " + mode;
LOG .info(SLACK_INTRO_MSG);
slackManager.sendAlert(SLACK_INTRO_MSG, slackChannel, webhookUrl, webhookUrl);
String SLACK_STATS_MSG = "Count of Anonymous IPs blocked: " + papiRateLimitingDao.countAnonymousRequestsWithLimitExceeded(yesterday, anonymousRequestLimit)
- + "\n Count of Public API clients that have exceeded the limit: "
+ + "\nCount of Public API clients that have exceeded the limit: "
+ papiRateLimitingDao.countClientRequestsWithLimitExceeded(yesterday, knownRequestLimit);
LOG .info(SLACK_STATS_MSG);
slackManager.sendAlert(SLACK_STATS_MSG, slackChannel, webhookUrl, webhookUrl);
From 98baf91c883c9ae0ca4ef7c813daa35318534fdf Mon Sep 17 00:00:00 2001
From: github actions
Date: Wed, 6 Nov 2024 14:43:57 +0000
Subject: [PATCH 2/8] v2.67.12 changelog update
---
CHANGELOG.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3cd68e158f..aec7e03e17 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## v2.67.12 - 2024-11-06
+
+[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.67.11...v2.67.12)
+
## v2.67.11 - 2024-11-05
[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.67.10...v2.67.11)
From 5911fed787d8a07c7d4a02f2f68b07bf95c2351a Mon Sep 17 00:00:00 2001
From: Giles Westwood
Date: Thu, 7 Nov 2024 15:21:52 +0000
Subject: [PATCH 3/8] use matrix method and if cases to reduce workflow counts
and complexity
---
.github/workflows/bld_all.yml | 185 -----------
.github/workflows/bld_all_matrix.yml | 293 ------------------
.../workflows/{bld_maven.yml => bld_mvn.yml} | 68 ++--
.github/workflows/build_debug.yml | 101 ------
.github/workflows/build_test_release.yml | 119 -------
.github/workflows/build_test_release_tag.yml | 26 +-
.../workflows/install_maven_dependencies.yml | 6 +-
.github/workflows/lint.yml | 15 +-
.github/workflows/maven_test_artifact.yml | 167 ----------
.github/workflows/maven_test_report.yml | 30 --
.../{maven_test_publish.yml => mvn_test.yml} | 66 ++--
.github/workflows/pr.yml | 7 +-
.github/workflows/pr_completed.yml | 32 --
.github/workflows/rel_tag.yml | 2 +-
.github/workflows/seed_maven_cache.yml | 6 +-
.github/workflows/unit_tests_artifact.yml | 144 ---------
.github/workflows/unit_tests_publish.yml | 180 -----------
.github/workflows/unit_tests_report.yml | 78 -----
18 files changed, 111 insertions(+), 1414 deletions(-)
delete mode 100644 .github/workflows/bld_all.yml
delete mode 100644 .github/workflows/bld_all_matrix.yml
rename .github/workflows/{bld_maven.yml => bld_mvn.yml} (85%)
delete mode 100644 .github/workflows/build_debug.yml
delete mode 100644 .github/workflows/build_test_release.yml
delete mode 100644 .github/workflows/maven_test_artifact.yml
delete mode 100644 .github/workflows/maven_test_report.yml
rename .github/workflows/{maven_test_publish.yml => mvn_test.yml} (73%)
delete mode 100644 .github/workflows/pr_completed.yml
delete mode 100644 .github/workflows/unit_tests_artifact.yml
delete mode 100644 .github/workflows/unit_tests_publish.yml
delete mode 100644 .github/workflows/unit_tests_report.yml
diff --git a/.github/workflows/bld_all.yml b/.github/workflows/bld_all.yml
deleted file mode 100644
index ab01a41f63..0000000000
--- a/.github/workflows/bld_all.yml
+++ /dev/null
@@ -1,185 +0,0 @@
-name: bld_all
-
-permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
-
-on:
- workflow_call:
- inputs:
- version_tag:
- description: 'Version tag to use: (bump must also be set to none to keep a specific version'
- required: false
- default: 'latest'
- type: string
- bump:
- description: 'whether to bump the version number by a major minor patch'
- required: false
- default: 'patch'
- type: string
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
- seed_maven_cache:
- description: Whether to seed cache
- type: boolean
- required: false
- default: true
- install_maven_dependencies:
- description: Whether to install dependencies or use a previous cache
- type: boolean
- required: false
- default: true
-
- workflow_dispatch:
- inputs:
- version_tag:
- description: 'Version tag to use: (bump must also be set to none to keep a specific version'
- required: false
- default: 'latest'
- type: string
- bump:
- description: |
- How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for
- '#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version
- required: false
- options:
- - patch
- - minor
- - major
- - none
- type: choice
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
- seed_maven_cache:
- description: Whether to seed cache
- type: boolean
- required: false
- default: true
- install_maven_dependencies:
- description: Whether to install dependencies or use a previous cache
- type: boolean
- required: false
- default: true
-
-jobs:
-
- bld_ml:
- uses: ./.github/workflows/bld_maven.yml
- secrets: inherit # pass all secrets
- permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
- with:
- project: orcid-message-listener
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- bld_amq:
- uses: ./.github/workflows/bld_maven.yml
- secrets: inherit # pass all secrets
- permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
- with:
- project: orcid-activemq
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- bld_api:
- uses: ./.github/workflows/bld_maven.yml
- secrets: inherit # pass all secrets
- permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
- with:
- project: orcid-api-web
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- bld_iapi:
- uses: ./.github/workflows/bld_maven.yml
- secrets: inherit # pass all secrets
- permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
- with:
- project: orcid-internal-api
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- bld_pubweb:
- uses: ./.github/workflows/bld_maven.yml
- secrets: inherit # pass all secrets
- permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
- with:
- project: orcid-pub-web
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- bld_sched:
- uses: ./.github/workflows/bld_maven.yml
- secrets: inherit # pass all secrets
- permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
- with:
- project: orcid-scheduler-web
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- bld_web:
- uses: ./.github/workflows/bld_maven.yml
- secrets: inherit # pass all secrets
- permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
- with:
- project: orcid-web
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
diff --git a/.github/workflows/bld_all_matrix.yml b/.github/workflows/bld_all_matrix.yml
deleted file mode 100644
index f4f09df488..0000000000
--- a/.github/workflows/bld_all_matrix.yml
+++ /dev/null
@@ -1,293 +0,0 @@
-name: bld_all_matrix
-
-permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
-
-on:
- workflow_call:
- inputs:
- version_tag:
- description: 'Version tag to use: (bump must also be set to none to keep a specific version'
- required: false
- default: 'latest'
- type: string
- bump:
- description: 'whether to bump the version number by a major minor patch'
- required: false
- default: 'patch'
- type: string
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
-
- workflow_dispatch:
- inputs:
- version_tag:
- description: 'Version tag to use: (bump must also be set to none to keep a specific version'
- required: false
- default: 'latest'
- type: string
- bump:
- description: |
- How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for
- '#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version
- required: false
- options:
- - patch
- - minor
- - major
- - none
- type: choice
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
-
-jobs:
-
- bld:
- strategy:
- matrix:
- # The include keyword that adds a new variable
- include:
- - artifact_name: orcid-message-listener
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- - artifact_name: orcid-activemq
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- - artifact_name: orcid-api-web
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- - artifact_name: orcid-internal-api
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- - artifact_name: orcid-pub-web
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- - artifact_name: orcid-scheduler-web
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- - artifact_name: orcid-web
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
-
- runs-on: ubuntu-latest
- steps:
-
- - name: git-checkout-ref-action
- id: ref
- uses: ORCID/git-checkout-ref-action@main
- with:
- default_branch: ${{ github.event.repository.default_branch }}
- ref: ${{ inputs.ref }}
-
- - uses: actions/checkout@v3
- with:
- ref: ${{ steps.ref.outputs.ref }}
- # checkout some history so we can scan commits for bump messages
- # NOTE: history does not include tags!
- fetch-depth: 100
-
- - name: find next version
- id: version
- uses: ORCID/version-bump-action@main
- with:
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
-
- - name: Set up Open JDK 11
- uses: actions/setup-java@v3
- with:
- distribution: 'temurin'
- java-version: '11'
- cache: 'maven'
-
- - name: show path
- run: |
- echo "$PATH"
- which java
- echo "$JAVA_HOME"
- echo "$tag_numeric"
- echo "$project"
- shell: bash
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
- project: "${{ matrix.artifact_name }}"
-
- - name: populate orcid-persistence/src/main/resources/release_name.txt with numeric tag
- run: |
- echo "$version_tag_numeric" > orcid-persistence/src/main/resources/release_name.txt
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
-
- - name: bump version of the parent pom and connected projects
- run: |
- mvn -T 1C --batch-mode versions:set \
- -DnewVersion="$version_tag_numeric" -DgenerateBackupPoms=false -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
-
- - name: bump the tagged version in the poms of projects not tied to the parent pom (orcid-test)
- run: |
- mvn -T 1C --batch-mode versions:set \
- -DnewVersion="$version_tag_numeric" -DgenerateBackupPoms=false -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
- --projects orcid-test
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
-
- - name: install orcid-parent into our local maven repo because the builds depend a version release
- run: |
- mvn -T 1C --batch-mode --non-recursive clean install -DskipTests \
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
-
- - name: install orcid-test into our local maven repo because the builds depend a version release
- run: |
- mvn -T 1C --batch-mode clean install -DskipTests\
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
- --projects orcid-test
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
-
- - name: install orcid-utils into our local maven repo because the builds depend a version release
- run: |
- mvn -T 1C --batch-mode clean install -DskipTests \
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
- --projects orcid-utils
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
-
- - name: install orcid-persistence into our local maven repo because orcid-core depends on it
- run: |
- mvn -T 1C --batch-mode clean install -DskipTests \
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
- --projects orcid-persistence
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
-
- - name: install orcid-core into our local maven repo because the builds depend a version release
- run: |
- mvn -T 1C --batch-mode clean install -DskipTests \
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
- --projects orcid-core
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
-
- - name: check some build related things
- run: |
- git --version
- git config user.name "GitHub Actions Bot"
- git config user.email "<>"
- git status
- git diff
-
- - name: build our project
- run: |
- mvn -T 1C --batch-mode -am package -DskipTests \
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
- --projects "$project"
- echo "------------------------------------------------------"
-
- find . -name '*.war'
- find . -name '*.jar'
- env:
- project: "${{ matrix.artifact_name }}"
-
-#
-# orcid-web customization
-#
-
- - name: setup node for angular static file
- if: ${{ matrix.artifact_name == 'orcid-web' }}
- uses: actions/setup-node@v3
- with:
- node-version: 18.7.0
-
- - name: build angular parts if we are building orcid-web
- if: ${{ matrix.artifact_name == 'orcid-web' }}
- run: |
- echo "Build angular_orcid_generated.js"
- cd orcid-nodejs
- mvn -T 1C --batch-mode -P ci clean compile \
- -Dnodejs.workingDirectory="${{ github.workspace }}/orcid-web/src/main/webapp/static/javascript/ng1Orcid" \
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
-
- echo "Copying angular_orcid_generated to its final destination"
- cp ${{ github.workspace }}/orcid-web/src/main/webapp/static/javascript/ng1Orcid/angular_orcid_generated.js ${{ github.workspace }}/orcid-web/target/orcid-web/static/javascript/ng1Orcid/
-
- echo "Packaging orcid-web"
- rm -f ${{ github.workspace }}/orcid-web/target/orcid-web.war
- cd ${{ github.workspace }}/orcid-web/target/orcid-web
-
- # have a file on the webserver we can hit
- echo "$version_tag_numeric" > ${{ github.workspace }}/orcid-web/target/orcid-web/static/version
-
- echo "Creating the war file"
- jar -cf orcid-web.war .
-
- # check_error "Creating the orcid-web.war file"
- echo "Moving war file to the target folder"
- cp orcid-web.war ${{ github.workspace }}/orcid-web/target/
- echo "orcid-web.war is ready"
-
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
- project: "${{ matrix.artifact_name }}"
-
-##################################################################################################################
-
-
- - name: install orcid-api-common into our local maven repo because the deploy depends on this orcid-web orcid-iapi orcid-api
- if: ${{ matrix.artifact_name == 'orcid-web' }} || ${{ matrix.artifact_name == 'orcid-internal-api' }} || ${{ matrix.artifact_name == 'orcid-api-web' }} || ${{ matrix.artifact_name == 'orcid-pub-web' }}
- run: |
- mvn -T 1C --batch-mode clean install -DskipTests \
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
- --projects orcid-api-common
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
-
-
- - name: deploy war file
- run: |
- mvn --batch-mode \
- --settings settings-deploy.xml \
- --file "${project}/pom.xml" \
- -Dmaven.test.skip \
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
- -DaltReleaseDeploymentRepository="github::${ARTIFACT_URL}${ARTIFACT_REPO_PATH}" \
- deploy -Dmaven.test.skip
- env:
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- ARTIFACT_URL: "${{ secrets.ARTIFACT_URL }}"
- ARTIFACT_REPO_PATH: "${{ secrets.ARTIFACT_REPO_PATH }}"
- ARTIFACT_USER: "${{ secrets.ARTIFACT_USER }}"
- ARTIFACT_PASSWORD: "${{ secrets.ARTIFACT_PASSWORD }}"
- project: "${{ matrix.artifact_name }}"
-
-
-
-
-
-
diff --git a/.github/workflows/bld_maven.yml b/.github/workflows/bld_mvn.yml
similarity index 85%
rename from .github/workflows/bld_maven.yml
rename to .github/workflows/bld_mvn.yml
index 4683cb8898..5638a7b0dc 100644
--- a/.github/workflows/bld_maven.yml
+++ b/.github/workflows/bld_mvn.yml
@@ -1,5 +1,4 @@
-name: bld_maven
-run-name: bld-{{ inputs.project }}
+name: bld_mvn
permissions:
checks: write
@@ -10,18 +9,13 @@ permissions:
on:
workflow_call:
inputs:
- project:
- description: 'Name of the artifact env'
- required: false
- default: 'prod'
- type: string
version_tag:
- description: 'Name of the tag to build'
+ description: 'Version tag to use: (bump must also be set to none to keep a specific version'
required: false
default: 'latest'
type: string
bump:
- description: 'whether to bump the version number by a major minor patch amount or none'
+ description: 'whether to bump the version number by a major minor patch'
required: false
default: 'patch'
type: string
@@ -40,15 +34,14 @@ on:
type: boolean
required: false
default: true
-
+ deploy:
+ description: Whether to deploy the build to artifact repo
+ type: boolean
+ required: false
+ default: true
workflow_dispatch:
inputs:
- project:
- description: 'Name of the artifact env'
- required: false
- default: 'prod'
- type: string
version_tag:
description: 'Version tag to use: (bump must also be set to none to keep a specific version'
required: false
@@ -80,10 +73,29 @@ on:
type: boolean
required: false
default: true
-
+ deploy:
+ description: Whether to deploy the build to artifact repo
+ type: boolean
+ required: false
+ default: true
jobs:
- bld_maven:
+ bld_mvn:
+ strategy:
+ matrix:
+ include:
+ - project: orcid-message-listener
+ - project: orcid-activemq
+ - project: orcid-api-web
+ - project: orcid-internal-api
+ - project: orcid-pub-web
+ - project: orcid-scheduler-web
+ - project: orcid-web
+ - project: orcid-utils
+ - project: orcid-core
+ - project: orcid-persistence
+ - project: orcid-api-common
+
runs-on: ubuntu-latest
steps:
- name: git-checkout-ref-action
@@ -93,7 +105,7 @@ jobs:
default_branch: ${{ github.event.repository.default_branch }}
ref: ${{ inputs.ref }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.ref }}
# checkout some history so we can scan commits for bump messages
@@ -108,7 +120,7 @@ jobs:
bump: ${{ inputs.bump }}
- name: Set up Open JDK 11
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
@@ -117,7 +129,7 @@ jobs:
- name: if not installing dependencies restore special previous git_sha cache
if: ${{ ! inputs.install_maven_dependencies }}
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }}
@@ -136,7 +148,7 @@ jobs:
- name: if installing dependencies use a standard cache key name
if: ${{ inputs.install_maven_dependencies }}
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache
@@ -167,20 +179,20 @@ jobs:
find . -name '*.war'
find . -name '*.jar'
env:
- project: "${{ inputs.project }}"
+ project: "${{ matrix.project }}"
#
# orcid-web customization
#
- name: setup node for angular static file
- if: ${{ inputs.project == 'orcid-web' }}
- uses: actions/setup-node@v3
+ if: ${{ matrix.project == 'orcid-web' }}
+ uses: actions/setup-node@v4
with:
node-version: 18.7.0
- name: build angular parts if we are building orcid-web
- if: ${{ inputs.project == 'orcid-web' }}
+ if: ${{ matrix.project == 'orcid-web' }}
run: |
echo "Build angular_orcid_generated.js"
cd orcid-nodejs
@@ -208,11 +220,12 @@ jobs:
env:
version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
- project: "${{ inputs.project }}"
+ project: "${{ matrix.project }}"
##################################################################################################################
- name: deploy war file
+ if: ${{ inputs.deploy }}
run: |
mvn --batch-mode \
--settings settings-deploy.xml \
@@ -227,5 +240,6 @@ jobs:
ARTIFACT_REPO_PATH: "${{ secrets.ARTIFACT_REPO_PATH }}"
ARTIFACT_USER: "${{ secrets.ARTIFACT_USER }}"
ARTIFACT_PASSWORD: "${{ secrets.ARTIFACT_PASSWORD }}"
- project: "${{ inputs.project }}"
+ project: "${{ matrix.project }}"
+
diff --git a/.github/workflows/build_debug.yml b/.github/workflows/build_debug.yml
deleted file mode 100644
index fd8f1815b5..0000000000
--- a/.github/workflows/build_debug.yml
+++ /dev/null
@@ -1,101 +0,0 @@
-name: build_debug
-
-on:
- workflow_call:
- inputs:
- version_tag:
- description: 'version tag to use(vx.x.x)'
- required: false
- default: "latest"
- type: string
- bump:
- description: 'whether to bump the version number by a major minor patch amount or try gitlog'
- required: false
- default: "patch"
- type: string
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
-
- workflow_dispatch:
- inputs:
- version_tag:
- description: 'version tag to use(vx.x.x)'
- required: false
- default: "latest"
- type: string
- bump:
- description: |
- How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for
- '#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version
- required: false
- options:
- - patch
- - minor
- - major
- - none
- type: choice
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default_branch"
- type: string
-
-
-# cancel running job if another commit comes in
-concurrency:
- group: main-${{ github.ref }}-1
- cancel-in-progress: true
-
-jobs:
- seed_maven_cache:
- uses: ./.github/workflows/seed_maven_cache.yml
- with:
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- install_maven_dependencies:
- uses: ./.github/workflows/install_maven_dependencies.yml
- with:
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- needs:
- - seed_maven_cache
-
-
-##############################################################################
-
- unit_tests_publish:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- project: orcid-message-listener
- seed_maven_cache: false
- install_maven_dependencies: false
- needs:
- - install_maven_dependencies
-
- bld_ml:
- uses: ./.github/workflows/bld_maven.yml
- secrets: inherit # pass all secrets for uploading assets
- needs:
- - seed_maven_cache
- - unit_tests_publish
- permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
- with:
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- project: orcid-message-listener
- seed_maven_cache: false
- install_maven_dependencies: false
diff --git a/.github/workflows/build_test_release.yml b/.github/workflows/build_test_release.yml
deleted file mode 100644
index 8b7ef2b2e6..0000000000
--- a/.github/workflows/build_test_release.yml
+++ /dev/null
@@ -1,119 +0,0 @@
-name: build_test_release
-
-on:
- workflow_call:
- inputs:
- version_tag:
- description: 'version tag to use(vx.x.x)'
- required: false
- default: "latest"
- type: string
- bump:
- description: 'whether to bump the version number by a major minor patch amount or try gitlog'
- required: false
- default: "patch"
- type: string
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
-
- workflow_dispatch:
- inputs:
- version_tag:
- description: 'version tag to use(vx.x.x)'
- required: false
- default: "latest"
- type: string
- bump:
- description: |
- How to optionally bump the semver version ( Major.Minor.Patch ) : git log will be searched for
- '#major #minor #patch' or feat/ or fix/ branch names to optionally override the bump. Set to none to keep a specific version
- required: false
- options:
- - patch
- - minor
- - major
- - none
- type: choice
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default_branch"
- type: string
-
-
-# cancel running job if another commit comes in
-concurrency:
- group: main-${{ github.ref }}-1
- cancel-in-progress: true
-
-jobs:
-
- lint:
- uses: ./.github/workflows/lint.yml
-
- seed_maven_cache:
- uses: ./.github/workflows/seed_maven_cache.yml
- with:
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- install_maven_dependencies:
- uses: ./.github/workflows/install_maven_dependencies.yml
- with:
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- needs:
- - seed_maven_cache
-
- unit_tests_publish:
- uses: ./.github/workflows/unit_tests_publish.yml
- with:
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- seed_maven_cache: false
- install_maven_dependencies: false
- needs:
- - lint
- - seed_maven_cache
- - install_maven_dependencies
-##############################################################################
- bld_all:
- uses: ./.github/workflows/bld_all.yml
- secrets: inherit # pass all secrets for uploading assets
- needs:
- - lint
- - unit_tests_publish
- - install_maven_dependencies
- permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
- with:
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
- seed_maven_cache: false
- install_maven_dependencies: false
-
-##############################################################################
-
-# rel_tag:
-# uses: ./.github/workflows/rel_tag.yml
-# needs: bld_all
-# with:
-# version_tag: ${{ inputs.version_tag }}
-# bump: ${{ inputs.bump }}
-# ref: ${{ inputs.ref }}
-# secrets: inherit # pass all secrets
-# permissions:
-# checks: write
-# contents: write
-# issues: read
-# pull-requests: write
diff --git a/.github/workflows/build_test_release_tag.yml b/.github/workflows/build_test_release_tag.yml
index 5a1665df61..209e0d9991 100644
--- a/.github/workflows/build_test_release_tag.yml
+++ b/.github/workflows/build_test_release_tag.yml
@@ -18,6 +18,12 @@ on:
required: false
default: "default"
type: string
+ rel_tag:
+ description: Whether to tag the code
+ type: boolean
+ required: false
+ default: true
+
workflow_dispatch:
inputs:
@@ -42,7 +48,11 @@ on:
required: false
default: "default_branch"
type: string
-
+ rel_tag:
+ description: Whether to tag the code
+ type: boolean
+ required: false
+ default: true
# cancel running job if another commit comes in
concurrency:
@@ -70,8 +80,8 @@ jobs:
needs:
- seed_maven_cache
- unit_tests_publish:
- uses: ./.github/workflows/unit_tests_publish.yml
+ mvn_test:
+ uses: ./.github/workflows/mvn_test.yml
with:
version_tag: ${{ inputs.version_tag }}
bump: ${{ inputs.bump }}
@@ -83,12 +93,12 @@ jobs:
- seed_maven_cache
- install_maven_dependencies
##############################################################################
- bld_all:
- uses: ./.github/workflows/bld_all.yml
+ bld_mvn:
+ uses: ./.github/workflows/bld_mvn.yml
secrets: inherit # pass all secrets for uploading assets
needs:
- lint
- - unit_tests_publish
+ - mvn_test
- install_maven_dependencies
permissions:
checks: write
@@ -106,7 +116,8 @@ jobs:
rel_tag:
uses: ./.github/workflows/rel_tag.yml
- needs: bld_all
+ needs: bld_mvn
+ if: ${{ inputs.rel_tag }}
with:
version_tag: ${{ inputs.version_tag }}
bump: ${{ inputs.bump }}
@@ -117,3 +128,4 @@ jobs:
contents: write
issues: read
pull-requests: write
+
diff --git a/.github/workflows/install_maven_dependencies.yml b/.github/workflows/install_maven_dependencies.yml
index 265c72c3a2..7c3332bdbd 100644
--- a/.github/workflows/install_maven_dependencies.yml
+++ b/.github/workflows/install_maven_dependencies.yml
@@ -73,7 +73,7 @@ jobs:
default_branch: ${{ github.event.repository.default_branch }}
ref: ${{ inputs.ref }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.ref }}
# checkout some history so we can scan commits for bump messages
@@ -88,13 +88,13 @@ jobs:
bump: ${{ inputs.bump }}
- name: Set up Open JDK 11
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Restore the seeded cache but save dependencies into a new unique git sha hash with the expected version of the build
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }}
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index a75a9f27b1..f7e9c0d9a3 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -16,17 +16,8 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-python@v4
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
with:
python-version: '3.10'
- - name: set PY
- run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV"
- - uses: actions/cache@v3
- with:
- path: ~/.cache
- key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
- # lockdown all 3rd party repos to git shas
- #- uses: cloudposse/github-action-pre-commit@32acf3179b9eda817c0f549e8057477d320827db
- # migrate to standard pre-commit
- - uses: pre-commit/action@5f528da5c95691c4cf42ff76a4d10854b62cbb82
+ - uses: pre-commit/action@576ff52938d158a24ac7e009dfa94b1455e7df99
diff --git a/.github/workflows/maven_test_artifact.yml b/.github/workflows/maven_test_artifact.yml
deleted file mode 100644
index c13b03e653..0000000000
--- a/.github/workflows/maven_test_artifact.yml
+++ /dev/null
@@ -1,167 +0,0 @@
-name: maven_test_artifact
-
-# run maven tests and upload results as an artifact
-# can be run from a pr
-
-permissions:
- checks: write
- contents: read
- issues: read
- pull-requests: write
-
-on:
- workflow_call:
- inputs:
- project:
- description: 'Name of the artifact env'
- required: false
- default: 'prod'
- type: string
- version_tag:
- description: 'Name of the tag to build'
- required: false
- default: 'latest'
- type: string
- bump:
- description: 'whether to bump the version number by a major minor patch amount or none'
- required: false
- default: 'patch'
- type: string
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
- seed_maven_cache:
- description: Whether to seed cache
- type: boolean
- required: false
- default: true
- install_maven_dependencies:
- description: Whether to install dependencies or use a previous cache
- type: boolean
- required: false
- default: true
-
- workflow_dispatch:
- inputs:
- project:
- description: 'Name of the artifact env'
- required: false
- default: 'prod'
- type: string
- version_tag:
- description: 'Name of the tag to build'
- required: false
- default: 'latest'
- type: string
- bump:
- description: 'whether to bump the version number by a major minor patch amount or none'
- required: false
- default: 'patch'
- type: string
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
- seed_maven_cache:
- description: Whether to seed cache
- type: boolean
- required: false
- default: true
- install_maven_dependencies:
- description: Whether to install dependencies or use a previous cache
- type: boolean
- required: false
- default: true
-
-
-jobs:
- maven_test:
- runs-on: ubuntu-latest
- steps:
- - name: git-checkout-ref-action
- id: ref
- uses: ORCID/git-checkout-ref-action@main
- with:
- default_branch: ${{ github.event.repository.default_branch }}
- ref: ${{ inputs.ref }}
-
- - uses: actions/checkout@v3
- with:
- ref: ${{ steps.ref.outputs.ref }}
- # checkout some history so we can scan commits for bump messages
- # NOTE: history does not include tags!
- fetch-depth: 100
-
- - name: find next version
- id: version
- uses: ORCID/version-bump-action@main
- with:
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
-
- - name: Set up Open JDK 11
- uses: actions/setup-java@v3
- with:
- distribution: 'temurin'
- java-version: '11'
-
-########################################################################################
-# handle restoring a custom gha cache
-
- - name: if not installing dependencies restore special previous git_sha cache
- if: ${{ ! inputs.install_maven_dependencies }}
- uses: actions/cache@v3
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }}
-
- - name: bump version of the parent pom and connected projects
- if: ${{ ! inputs.install_maven_dependencies }}
- run: |
- mvn -T 1C --batch-mode versions:set -DskipTests \
- -DnewVersion="$version_tag_numeric" -DgenerateBackupPoms=false
- env:
- version_tag_numeric: "${{ steps.version.outputs.version_tag_numeric }}"
-
-########################################################################################
-
- - name: if installing dependencies use a standard cache key name
- if: ${{ inputs.install_maven_dependencies }}
- uses: actions/cache@v3
- with:
- path: ~/.m2/repository
- key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache
- restore-keys: |
- ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache
-
- - name: seed_maven_cache
- if: ${{ inputs.seed_maven_cache }}
- id: cache
- uses: ORCID/ORCID-Source-cache-action@main
- with:
- version_tag_numeric: ${{ steps.version.outputs.version_tag_numeric }}
-
- - name: install_dependencies and bump version
- if: ${{ inputs.install_maven_dependencies }}
- id: install_dependencies
- uses: ORCID/ORCID-Source-dependencies-action@main
- with:
- version_tag_numeric: ${{ steps.version.outputs.version_tag_numeric }}
-
-########################################################################################
- - name: "Test ${{ inputs.project }}"
- run: |
- mvn -T 1C --batch-mode -Dmaven.test.failure.ignore=true test \
- -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
- --projects ${{ inputs.project }}
-
- - uses: actions/upload-artifact@v3 # upload test results
- if: success() || failure() # run this step even if previous step failed
- with:
- name: ${{ inputs.project }}
- path: ${{ inputs.project }}/target/surefire-reports/*.xml
diff --git a/.github/workflows/maven_test_report.yml b/.github/workflows/maven_test_report.yml
deleted file mode 100644
index e44b1f70c9..0000000000
--- a/.github/workflows/maven_test_report.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-name: unit_test_report
-
-on:
- workflow_call:
- inputs:
- project:
- description: 'Name of the project in the repo'
- required: false
- default: "."
- type: string
-
- workflow_dispatch:
- inputs:
- project:
- description: 'Name of the project in the repo'
- required: false
- default: "."
- type: string
-
-jobs:
- report:
- runs-on: ubuntu-latest
- steps:
- - uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203
- with:
- artifact: ${{ inputs.project }}
- name: "maven_test_report_${{ inputs.project }}" # Name of the check run which will be created
- path: '*.xml' # Path to test results (inside artifact .zip)
- reporter: java-junit # Format of test results
-
diff --git a/.github/workflows/maven_test_publish.yml b/.github/workflows/mvn_test.yml
similarity index 73%
rename from .github/workflows/maven_test_publish.yml
rename to .github/workflows/mvn_test.yml
index 33a6c1132d..edb2f8d37a 100644
--- a/.github/workflows/maven_test_publish.yml
+++ b/.github/workflows/mvn_test.yml
@@ -1,22 +1,13 @@
-name: maven_test_publish
-
-# run maven tests and publish results in one step
-# run from privileged branch
+name: mvn_test
permissions:
checks: write
contents: read
- issues: read
- pull-requests: write
+ actions: read
on:
workflow_call:
inputs:
- project:
- description: 'Name of the artifact env'
- required: false
- default: 'prod'
- type: string
version_tag:
description: 'Name of the tag to build'
required: false
@@ -45,11 +36,6 @@ on:
workflow_dispatch:
inputs:
- project:
- description: 'Name of the artifact env'
- required: false
- default: 'prod'
- type: string
version_tag:
description: 'Name of the tag to build'
required: false
@@ -78,7 +64,22 @@ on:
jobs:
- maven_test:
+ mvn_test:
+ strategy:
+ matrix:
+ include:
+ - project: orcid-message-listener
+ - project: orcid-activemq
+ - project: orcid-api-web
+ - project: orcid-internal-api
+ - project: orcid-pub-web
+ - project: orcid-scheduler-web
+ - project: orcid-web
+ - project: orcid-utils
+ - project: orcid-core
+ - project: orcid-persistence
+ - project: orcid-api-common
+
runs-on: ubuntu-latest
steps:
- name: git-checkout-ref-action
@@ -88,7 +89,7 @@ jobs:
default_branch: ${{ github.event.repository.default_branch }}
ref: ${{ inputs.ref }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.ref }}
# checkout some history so we can scan commits for bump messages
@@ -103,7 +104,7 @@ jobs:
bump: ${{ inputs.bump }}
- name: Set up Open JDK 11
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
@@ -113,7 +114,7 @@ jobs:
- name: if not installing dependencies restore special previous git_sha cache
if: ${{ ! inputs.install_maven_dependencies }}
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-${{ steps.version.outputs.version_tag_numeric }}-${{ github.sha }}
@@ -132,7 +133,7 @@ jobs:
- name: if installing dependencies use a standard cache key name
if: ${{ inputs.install_maven_dependencies }}
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache
@@ -154,19 +155,24 @@ jobs:
version_tag_numeric: ${{ steps.version.outputs.version_tag_numeric }}
########################################################################################
- - name: "Test ${{ inputs.project }}"
+ - name: "Test ${{ matrix.project }}"
run: |
- mvn -T 1C --batch-mode -Dmaven.test.failure.ignore=true test \
+ mvn -T 1C --batch-mode test \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
- --projects ${{ inputs.project }}
+ --projects ${{ matrix.project }} --fail-at-end
- # NOTE: if the above test fail then this step will report that failure and stop the run
- - name: Publish Unit Test Results
- uses: dorny/test-reporter@e9fa2f582c0ebbe2e263fd18fad744d52e0b0203
- if: always()
+ - name: Publish unit test report for non forked repo
+ if: ${{ failure() && (github.event.pull_request.head.repo.full_name == github.repository) }} # only report if a test has failed and we are a non forked repo
+ uses: dorny/test-reporter@31a54ee7ebcacc03a09ea97a7e5465a47b84aea5 # v1.9.1
with:
- name: "maven_test_publish_${{ inputs.project }}"
- path: ${{ inputs.project }}/target/surefire-reports/*.xml
+ name: "Unit test report for ${{ matrix.project }}"
+ path: ${{ matrix.project }}/target/surefire-reports/*.xml
reporter: java-junit
fail-on-error: true
+ - name: Annotate only test report for forked repo
+ uses: mikepenz/action-junit-report@ec3a351c13e080dc4fa94c49ab7ad5bf778a9668 # v5
+ if: ${{ failure() && (github.event.pull_request.head.repo.full_name != github.repository) }} # only report if a test has failed and we are a forked repo
+ with:
+ report_paths: ${{ matrix.project }}/target/surefire-reports/*.xml
+ annotate_only: true # forked repo cannot write to checks so just do annotations
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index c243064af8..f151c70e62 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -17,8 +17,11 @@ concurrency:
cancel-in-progress: true
jobs:
- unit_tests_artifact:
- uses: ./.github/workflows/unit_tests_artifact.yml
+ lint:
+ uses: ./.github/workflows/lint.yml
+
+ mvn_test:
+ uses: ./.github/workflows/mvn_test.yml
with:
seed_maven_cache: true
install_maven_dependencies: true
diff --git a/.github/workflows/pr_completed.yml b/.github/workflows/pr_completed.yml
deleted file mode 100644
index 3d007a3769..0000000000
--- a/.github/workflows/pr_completed.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: pr_completed
-
-# this is a privileged workflow that can run with secrets
-# to perform actions on work carried out in the pull_request workflow
-
-on:
- workflow_run:
- workflows:
- - pr
- types:
- - completed
-
- workflow_call:
- inputs:
- version_tag:
- description: 'version tag to use(vx.x.x)'
- required: false
- default: "next_tag"
- type: string
-
- workflow_dispatch:
- inputs:
- version_tag:
- description: 'version tag to use(vx.x.x)'
- required: false
- default: "next_tag"
- type: string
-
-jobs:
- unit_tests_report:
- uses: ./.github/workflows/unit_tests_report.yml
-
diff --git a/.github/workflows/rel_tag.yml b/.github/workflows/rel_tag.yml
index e125ac11d9..529dc0bafb 100644
--- a/.github/workflows/rel_tag.yml
+++ b/.github/workflows/rel_tag.yml
@@ -64,7 +64,7 @@ jobs:
ref: ${{ inputs.ref }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
# token with write permissions to protected branches
# standard github token does not allow this
diff --git a/.github/workflows/seed_maven_cache.yml b/.github/workflows/seed_maven_cache.yml
index aaf8d64d3b..55eae9d17e 100644
--- a/.github/workflows/seed_maven_cache.yml
+++ b/.github/workflows/seed_maven_cache.yml
@@ -71,7 +71,7 @@ jobs:
default_branch: ${{ github.event.repository.default_branch }}
ref: ${{ inputs.ref }}
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.ref }}
# checkout some history so we can scan commits for bump messages
@@ -86,13 +86,13 @@ jobs:
bump: ${{ inputs.bump }}
- name: Set up Open JDK 11
- uses: actions/setup-java@v3
+ uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
- name: Cache local Maven repository keyed off the pom
- uses: actions/cache@v3
+ uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-seed-cache
diff --git a/.github/workflows/unit_tests_artifact.yml b/.github/workflows/unit_tests_artifact.yml
deleted file mode 100644
index 2340da6979..0000000000
--- a/.github/workflows/unit_tests_artifact.yml
+++ /dev/null
@@ -1,144 +0,0 @@
-name: unit_tests_artifact
-
-# Run tests and upload the results as an artifact
-# Can be run from a unprivileged pull_request action
-# Reporting is done in the pr_completed.yml workflow
-
-on:
- workflow_call:
- inputs:
- version_tag:
- description: 'Name of the tag to build'
- required: false
- default: 'latest'
- type: string
- bump:
- description: 'whether to bump the version number by a major minor patch amount or none'
- required: false
- default: 'patch'
- type: string
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
- seed_maven_cache:
- description: Whether to seed cache
- type: boolean
- required: false
- default: true
- install_maven_dependencies:
- description: Whether to install dependencies or use a previous cache
- type: boolean
- required: false
- default: true
-
-
- workflow_dispatch:
- inputs:
- version_tag:
- description: 'Name of the tag to build'
- required: false
- default: 'latest'
- type: string
- bump:
- description: 'whether to bump the version number by a major minor patch amount or none'
- required: false
- default: 'patch'
- type: string
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
- seed_maven_cache:
- description: Whether to seed cache
- type: boolean
- required: false
- default: true
- install_maven_dependencies:
- description: Whether to install dependencies or use a previous cache
- type: boolean
- required: false
- default: true
-
-jobs:
- tst_ml:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-message-listener
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- tst_amq:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-activemq
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- tst_api:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-api-web
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- tst_iapi:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-internal-api
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- tst_pubweb:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-pub-web
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- tst_sched:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-scheduler-web
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- tst_web:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-web
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-##########################################################
-
- tst_utils:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-utils
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- tst_core:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-core
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- tst_persistence:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-persistence
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
- tst_api_common:
- uses: ./.github/workflows/maven_test_artifact.yml
- with:
- project: orcid-api-common
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
-
-
diff --git a/.github/workflows/unit_tests_publish.yml b/.github/workflows/unit_tests_publish.yml
deleted file mode 100644
index e8cdbcdf91..0000000000
--- a/.github/workflows/unit_tests_publish.yml
+++ /dev/null
@@ -1,180 +0,0 @@
-name: unit_tests_publish
-
-# full unit tests with report publishing
-
-on:
- workflow_call:
- inputs:
- version_tag:
- description: 'Name of the tag to build'
- required: false
- default: 'latest'
- type: string
- bump:
- description: 'whether to bump the version number by a major minor patch amount or none'
- required: false
- default: 'patch'
- type: string
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
- seed_maven_cache:
- description: Whether to seed cache
- type: boolean
- required: false
- default: true
- install_maven_dependencies:
- description: Whether to install dependencies or use a previous cache
- type: boolean
- required: false
- default: true
-
-
- workflow_dispatch:
- inputs:
- version_tag:
- description: 'Name of the tag to build'
- required: false
- default: 'latest'
- type: string
- bump:
- description: 'whether to bump the version number by a major minor patch amount or none'
- required: false
- default: 'patch'
- type: string
- ref:
- description: 'git reference to use with the checkout use default_branch to have that calculated'
- required: false
- default: "default"
- type: string
- seed_maven_cache:
- description: Whether to seed cache
- type: boolean
- required: false
- default: true
- install_maven_dependencies:
- description: Whether to install dependencies or use a previous cache
- type: boolean
- required: false
- default: true
-
-jobs:
-
-
- tst_ml:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-message-listener
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- tst_amq:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-activemq
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- tst_api:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-api-web
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- tst_iapi:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-internal-api
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- tst_pubweb:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-pub-web
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- tst_sched:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-scheduler-web
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- tst_web:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-web
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
-####################################################################
-
- tst_utils:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-utils
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- tst_core:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-core
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- tst_persistence:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-persistence
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
- tst_api_common:
- uses: ./.github/workflows/maven_test_publish.yml
- with:
- project: orcid-api-common
- seed_maven_cache: ${{ inputs.seed_maven_cache }}
- install_maven_dependencies: ${{ inputs.install_maven_dependencies }}
- version_tag: ${{ inputs.version_tag }}
- bump: ${{ inputs.bump }}
- ref: ${{ inputs.ref }}
-
-# codeql:
-# uses: ./.github/workflows/codeql.yml
-#
diff --git a/.github/workflows/unit_tests_report.yml b/.github/workflows/unit_tests_report.yml
deleted file mode 100644
index f3c5149dd0..0000000000
--- a/.github/workflows/unit_tests_report.yml
+++ /dev/null
@@ -1,78 +0,0 @@
-name: unit_tests_report
-
-on:
- workflow_call:
- inputs:
- version_tag:
- description: 'version tag to use(vx.x.x)'
- required: false
- default: latest
- type: string
-
- workflow_dispatch:
- inputs:
- version_tag:
- description: 'version tag to use(vx.x.x)'
- required: false
- default: latest
- type: string
-
-jobs:
-
- tst_ml:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-message-listener
-
- tst_amq:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-activemq
-
- tst_api:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-api-web
-
- tst_iapi:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-internal-api
-
- tst_pubweb:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-pub-web
-
- tst_sched:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-scheduler-web
-
- tst_web:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-web
-
-#########################################################################################
-
- tst_utils:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-utils
-
- tst_core:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-core
-
- tst_persistence:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-persistence
-
- tst_api_common:
- uses: ./.github/workflows/maven_test_report.yml
- with:
- project: orcid-api-common
-
From 501dab79bb3e6952c67732fa485e623dc7811560 Mon Sep 17 00:00:00 2001
From: Camelia Dumitru <62257307+Camelia-Orcid@users.noreply.github.com>
Date: Thu, 7 Nov 2024 17:07:29 +0000
Subject: [PATCH 4/8] Fixed the 500 when client reached the limit. (#7128)
* Fixed the 500 when client reached the limit.
* Remove extrawhite space
---
.../orcid/core/template/papi_rate_limit_email.ftl | 2 +-
.../core/template/papi_rate_limit_email_html.ftl | 3 ---
.../org/orcid/api/filters/ApiRateLimitFilter.java | 12 +++++++++---
.../orcid/scheduler/report/PapiDailyLimitReport.java | 4 ++--
4 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email.ftl b/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email.ftl
index 0c4345237c..942550a889 100644
--- a/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email.ftl
+++ b/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email.ftl
@@ -15,5 +15,5 @@ To minimize any disruption to your ORCID integration in the future, we would rec
Warm Regards,
ORCID Support Team
https://support.orcid.org
-<@emailMacros.msg "email.common.you_have_received_this_email" />
+
<#include "email_footer.ftl"/>
diff --git a/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email_html.ftl b/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email_html.ftl
index 569cb86ebe..f7d4ebca59 100644
--- a/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email_html.ftl
+++ b/orcid-core/src/main/resources/org/orcid/core/template/papi_rate_limit_email_html.ftl
@@ -25,9 +25,6 @@
- <@emailMacros.msg "email.common.you_have_received_this_email" />
-
-
<#include "email_footer_html.ftl"/>
diff --git a/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java b/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java
index daa982cae3..e2f9aae1dd 100644
--- a/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java
+++ b/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java
@@ -37,6 +37,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.MessageSource;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
@@ -79,6 +80,9 @@ public class ApiRateLimitFilter extends OncePerRequestFilter {
@Autowired
private OrcidTokenStore orcidTokenStore;
+
+ @Autowired
+ private MessageSource messageSource;
@Value("${org.orcid.papi.rate.limit.anonymous.requests:10000}")
private int anonymousRequestLimit;
@@ -202,8 +206,10 @@ private void rateLimitClientRequest(String clientId, LocalDate today) {
private Map createTemplateParams(String clientId, String clientName, String emailName, String orcidId) {
Map templateParams = new HashMap();
+ templateParams.put("messages", messageSource);
+ templateParams.put("messageArgs", new Object[0]);
templateParams.put("clientId", clientId);
- templateParams.put("clientId", clientName);
+ templateParams.put("clientName", clientName);
templateParams.put("emailName", emailName);
templateParams.put("locale", LocaleUtils.toLocale("en"));
templateParams.put("baseUri", orcidUrlManager.getBaseUrl());
@@ -218,9 +224,9 @@ private void sendEmail(String clientId, LocalDate requestDate) {
String emailName = recordNameManager.deriveEmailFriendlyName(profile.getId());
Map templateParams = this.createTemplateParams(clientId, clientDetailsEntity.getClientName(), emailName, profile.getId());
// Generate body from template
- String body = templateManager.processTemplate("bad_orgs_email.ftl", templateParams);
+ String body = templateManager.processTemplate("papi_rate_limit_email.ftl", templateParams);
// Generate html from template
- String html = templateManager.processTemplate("bad_orgs_email_html.ftl", templateParams);
+ String html = templateManager.processTemplate("papi_rate_limit_email_html.ftl", templateParams);
String email = emailManager.findPrimaryEmail(profile.getId()).getEmail();
LOG.info("text email={}", body);
diff --git a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/report/PapiDailyLimitReport.java b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/report/PapiDailyLimitReport.java
index 898a1896c8..73b1b4258c 100644
--- a/orcid-scheduler-web/src/main/java/org/orcid/scheduler/report/PapiDailyLimitReport.java
+++ b/orcid-scheduler-web/src/main/java/org/orcid/scheduler/report/PapiDailyLimitReport.java
@@ -71,8 +71,8 @@ public void papiDailyLimitReport() {
if (enableRateLimiting) {
LocalDate yesterday = LocalDate.now().minusDays(1);
String mode = Features.ENABLE_PAPI_RATE_LIMITING.isActive() ? "ENFORCEMENT" : "MONITORING";
- String SLACK_INTRO_MSG = "Public API Rate limit report - Date: " + yesterday.toString() + "\n Current Anonymous Requests Limit: " + anonymousRequestLimit
- + "\nCurrent Public API Clients Limit: " + knownRequestLimit + "\n Mode: " + mode;
+ String SLACK_INTRO_MSG = "Public API Rate limit report - Date: " + yesterday.toString() + "\nCurrent Anonymous Requests Limit: " + anonymousRequestLimit
+ + "\nCurrent Public API Clients Limit: " + knownRequestLimit + "\nMode: " + mode;
LOG .info(SLACK_INTRO_MSG);
slackManager.sendAlert(SLACK_INTRO_MSG, slackChannel, webhookUrl, webhookUrl);
From 471cb318737ca495992c538fb6ae8cf20384b858 Mon Sep 17 00:00:00 2001
From: github actions
Date: Thu, 7 Nov 2024 17:21:45 +0000
Subject: [PATCH 5/8] v2.67.13 changelog update
---
CHANGELOG.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index aec7e03e17..5231d45e93 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## v2.67.13 - 2024-11-07
+
+[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.67.12...v2.67.13)
+
## v2.67.12 - 2024-11-06
[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.67.11...v2.67.12)
From 7324940810fc282379b12e7bf0a499ffe694775e Mon Sep 17 00:00:00 2001
From: Giles Westwood
Date: Thu, 7 Nov 2024 18:04:54 +0000
Subject: [PATCH 6/8] more concistent naming
---
.github/workflows/build_test_release_tag.yml | 6 +++---
.github/workflows/pr.yml | 4 ++--
.github/workflows/{mvn_test.yml => test_mvn.yml} | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
rename .github/workflows/{mvn_test.yml => test_mvn.yml} (99%)
diff --git a/.github/workflows/build_test_release_tag.yml b/.github/workflows/build_test_release_tag.yml
index 209e0d9991..ce82197032 100644
--- a/.github/workflows/build_test_release_tag.yml
+++ b/.github/workflows/build_test_release_tag.yml
@@ -80,8 +80,8 @@ jobs:
needs:
- seed_maven_cache
- mvn_test:
- uses: ./.github/workflows/mvn_test.yml
+ test_mvn:
+ uses: ./.github/workflows/test_mvn.yml
with:
version_tag: ${{ inputs.version_tag }}
bump: ${{ inputs.bump }}
@@ -98,7 +98,7 @@ jobs:
secrets: inherit # pass all secrets for uploading assets
needs:
- lint
- - mvn_test
+ - test_mvn
- install_maven_dependencies
permissions:
checks: write
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index f151c70e62..4b13881b9b 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -20,8 +20,8 @@ jobs:
lint:
uses: ./.github/workflows/lint.yml
- mvn_test:
- uses: ./.github/workflows/mvn_test.yml
+ test_mvn:
+ uses: ./.github/workflows/test_mvn.yml
with:
seed_maven_cache: true
install_maven_dependencies: true
diff --git a/.github/workflows/mvn_test.yml b/.github/workflows/test_mvn.yml
similarity index 99%
rename from .github/workflows/mvn_test.yml
rename to .github/workflows/test_mvn.yml
index edb2f8d37a..65e1190174 100644
--- a/.github/workflows/mvn_test.yml
+++ b/.github/workflows/test_mvn.yml
@@ -1,4 +1,4 @@
-name: mvn_test
+name: test_mvn
permissions:
checks: write
@@ -64,7 +64,7 @@ on:
jobs:
- mvn_test:
+ test_mvn:
strategy:
matrix:
include:
From e5a5bfd6076eacd56d606e1e0dd949d8f27635c9 Mon Sep 17 00:00:00 2001
From: Camelia Dumitru <62257307+Camelia-Orcid@users.noreply.github.com>
Date: Thu, 7 Nov 2024 19:53:27 +0000
Subject: [PATCH 7/8] Exception catching for papi limit filter (#7132)
* Exception catching for papi limit filter
* Logging the email as well
---
.../orcid/api/filters/ApiRateLimitFilter.java | 51 ++++++++++---------
1 file changed, 27 insertions(+), 24 deletions(-)
diff --git a/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java b/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java
index e2f9aae1dd..58779274a4 100644
--- a/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java
+++ b/orcid-pub-web/src/main/java/org/orcid/api/filters/ApiRateLimitFilter.java
@@ -80,7 +80,7 @@ public class ApiRateLimitFilter extends OncePerRequestFilter {
@Autowired
private OrcidTokenStore orcidTokenStore;
-
+
@Autowired
private MessageSource messageSource;
@@ -95,9 +95,9 @@ public class ApiRateLimitFilter extends OncePerRequestFilter {
@Value("${org.orcid.persistence.panoply.papiExceededRate.production:false}")
private boolean enablePanoplyPapiExceededRateInProduction;
-
+
@Value("${org.orcid.papi.rate.limit.ip.whiteSpaceSeparatedWhiteList:127.0.0.1}")
- private String papiWhiteSpaceSeparatedWhiteList;
+ private String papiWhiteSpaceSeparatedWhiteList;
private static final String TOO_MANY_REQUESTS_MSG = "Too Many Requests - You have exceeded the daily allowance of API calls.\\n"
+ "You can increase your daily quota by registering for and using Public API client credentials "
@@ -127,20 +127,22 @@ protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServl
}
boolean isAnonymous = (clientId == null);
LocalDate today = LocalDate.now();
+ try {
+ if (isAnonymous) {
+ if (!isWhiteListed(ipAddress)) {
+ LOG.info("ApiRateLimitFilter anonymous request for ip: " + ipAddress);
+ this.rateLimitAnonymousRequest(ipAddress, today, httpServletResponse);
+ }
- if (isAnonymous ) {
- if(!isWhiteListed(ipAddress)) {
- LOG.info("ApiRateLimitFilter anonymous request for ip: " + ipAddress);
- this.rateLimitAnonymousRequest(ipAddress, today, httpServletResponse);
+ } else {
+ LOG.info("ApiRateLimitFilter client request with clientId: " + clientId);
+ this.rateLimitClientRequest(clientId, today);
}
-
- } else {
- LOG.info("ApiRateLimitFilter client request with clientId: " + clientId);
- this.rateLimitClientRequest(clientId, today);
+ } catch (Exception ex) {
+ LOG.error("Papi Limiting Filter unexpected error, ignore and chain request.", ex);
}
-
- filterChain.doFilter(httpServletRequest, httpServletResponse);
}
+ filterChain.doFilter(httpServletRequest, httpServletResponse);
}
private void rateLimitAnonymousRequest(String ipAddress, LocalDate today, HttpServletResponse httpServletResponse) throws IOException {
@@ -243,7 +245,7 @@ private void sendEmail(String clientId, LocalDate requestDate) {
// Send the email
boolean mailSent = mailGunManager.sendEmail(FROM_ADDRESS, email, SUBJECT, body, html);
if (!mailSent) {
- throw new RuntimeException("Failed to send email for papi limits, orcid=" + profile.getId());
+ LOG.error("Failed to send email for papi limits, orcid=" + profile.getId() + " email: " + email);
}
}
@@ -264,33 +266,34 @@ private void setPapiRateExceededItemInPanoply(PanoplyPapiDailyRateExceededItem i
});
}
-
- //gets actual client IP address, using the headers that the proxy server ads
+
+ // gets actual client IP address, using the headers that the proxy server
+ // ads
private String getClientIpAddress(HttpServletRequest request) {
String ipAddress = request.getHeader("X-FORWARDED-FOR");
if (ipAddress == null || ipAddress.isEmpty() || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("X-REAL-IP");
}
if (ipAddress == null || ipAddress.isEmpty() || "unknown".equalsIgnoreCase(ipAddress)) {
- ipAddress = request.getRemoteAddr();
+ ipAddress = request.getRemoteAddr();
}
if (ipAddress != null && ipAddress.contains(",")) {
ipAddress = ipAddress.split(",")[0].trim();
}
return ipAddress;
- }
-
+ }
+
private boolean isWhiteListed(String ipAddress) {
List papiIpWhiteList = null;
- if(StringUtils.isNotBlank(papiWhiteSpaceSeparatedWhiteList)) {
+ if (StringUtils.isNotBlank(papiWhiteSpaceSeparatedWhiteList)) {
papiIpWhiteList = Arrays.asList(papiWhiteSpaceSeparatedWhiteList.split("\\s"));
}
-
- if(papiIpWhiteList != null) {
+
+ if (papiIpWhiteList != null) {
return papiIpWhiteList.contains(ipAddress);
-
+
}
- return false;
+ return false;
}
}
From 8223bda6e603daf8e0e403bdc94cac411ef4306c Mon Sep 17 00:00:00 2001
From: github actions
Date: Thu, 7 Nov 2024 20:07:53 +0000
Subject: [PATCH 8/8] v2.67.14 changelog update
---
CHANGELOG.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5231d45e93..c529ed272a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## v2.67.14 - 2024-11-07
+
+[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.67.13...v2.67.14)
+
## v2.67.13 - 2024-11-07
[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.67.12...v2.67.13)