Skip to content

Commit 507fc4e

Browse files
authored
Merge branch 'main' into feature/cb-slow-call-threshold
2 parents e47fdd8 + 96aa459 commit 507fc4e

7 files changed

Lines changed: 211 additions & 127 deletions

File tree

.github/workflows/cache-maven-dependencies.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ env:
1313
jobs:
1414
update-cache:
1515
runs-on: ubuntu-latest
16+
permissions:
17+
actions: write # needed to delete caches
1618
steps:
1719
- name: "Checkout"
1820
uses: actions/checkout@v6
@@ -36,7 +38,7 @@ jobs:
3638
gh cache delete "${CACHE_ID}"
3739
done
3840
env:
39-
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
41+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4042

4143
- name: "Cache Dependencies"
4244
uses: actions/cache/save@v5

.github/workflows/dependabot-automerge.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,21 @@ env:
1414
jobs:
1515
review-prs:
1616
runs-on: ubuntu-latest
17-
permissions:
18-
pull-requests: write
19-
contents: write
2017
steps:
2118
- name: Checkout
2219
uses: actions/checkout@v6
2320

21+
- name: 'Create GitHub App Token'
22+
id: app-token
23+
uses: actions/create-github-app-token@v3
24+
with:
25+
client-id: ${{ secrets.SAP_CLOUD_SDK_BOT_CLIENT_ID }}
26+
private-key: ${{ secrets.SAP_CLOUD_SDK_BOT_PRIVATE_KEY }}
27+
owner: SAP
28+
repositories: cloud-sdk-java
29+
permission-contents: write
30+
permission-pull-requests: write
31+
2432
- name: Approve and Merge PRs
2533
run: |
2634
PRS=$(gh pr list --app "dependabot" --state "open" --json number,title)
@@ -29,14 +37,14 @@ jobs:
2937
if [[ -z "$GROUP" ]]; then
3038
continue
3139
fi
32-
40+
3341
MATCHES=$(jq -r --arg group "$GROUP" '.[] | select(.title | contains($group)) | .number' <<< "$PRS")
3442
echo "[DEBUG] Found PRs for group '$GROUP': '$MATCHES'"
35-
43+
3644
PR_NUMBERS="$MATCHES"$'\n'"$PR_NUMBERS"
3745
done <<< "${{ env.DEPENDABOT_GROUPS }}"
3846
echo "[DEBUG] Approving and Merging following PRs: '$PR_NUMBERS'"
39-
47+
4048
while IFS= read -r PR_NUMBER; do
4149
if [[ -z "$PR_NUMBER" ]]; then
4250
continue
@@ -47,4 +55,4 @@ jobs:
4755
gh pr review "$PR_NUMBER" --approve
4856
done <<< "$PR_NUMBERS"
4957
env:
50-
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
58+
GH_TOKEN: ${{ steps.app-token.outputs.token }}

.github/workflows/javadoc.yaml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,60 +11,71 @@ on:
1111
env:
1212
JAVA_VERSION: 17
1313
DOCS_REPO: SAP/cloud-sdk
14-
PROJECTS: "!:rfc,!:dwc-cf,!:datamodel-metadata-generator,!:odata-generator,!:odata-generator-maven-plugin,!:odata-generator-utility,!:odata-v4-generator,!:odata-v4-generator-maven-plugin,!:s4hana-connectivity,!:soap,!:testutil,!:s4hana-core"
14+
PROJECTS: '!:rfc,!:dwc-cf,!:datamodel-metadata-generator,!:odata-generator,!:odata-generator-maven-plugin,!:odata-generator-utility,!:odata-v4-generator,!:odata-v4-generator-maven-plugin,!:s4hana-connectivity,!:soap,!:testutil,!:s4hana-core'
1515

1616
jobs:
1717
build:
18-
name: "JavaDoc to Documentation Portal"
18+
name: 'JavaDoc to Documentation Portal'
1919
runs-on: ubuntu-latest
2020

2121
steps:
22-
- name: "Prepare git"
22+
- name: 'Prepare git'
2323
run: |
2424
git config --global user.email "cloudsdk@sap.com"
2525
git config --global user.name "SAP Cloud SDK Bot"
2626
27-
- name: "Checkout Repository"
27+
- name: 'Checkout Repository'
2828
uses: actions/checkout@v6
2929
with:
3030
fetch-depth: 0
31-
32-
- name: "Switch branch"
31+
32+
- name: 'Switch branch'
3333
run: git checkout "${{ github.event.inputs.branch || 'main' }}"
3434

35-
- name: "Set up JDK 17"
35+
- name: 'Set up JDK 17'
3636
uses: actions/setup-java@v5
3737
with:
3838
java-version: '17'
3939
distribution: 'temurin'
4040
cache: 'maven'
4141

42-
- name: "Determine Versions"
42+
- name: 'Determine Versions'
4343
id: determine-version
4444
run: |
4545
echo "MAJOR_VERSION=$(jq -r '.version' latest.json | cut -d '.' -f 1)" >> $GITHUB_OUTPUT
4646
echo "CURRENT_VERSION=$(jq -r '.version' latest.json)" >> $GITHUB_OUTPUT
4747
48-
- name: "Install project (skip tests)"
48+
- name: 'Install project (skip tests)'
4949
run: mvn install -DskipTests --quiet
5050

51-
- name: "Process sources"
51+
- name: 'Process sources'
5252
run: mvn process-sources -Drelease --fail-at-end --projects "${PROJECTS}" --quiet
5353

54-
- name: "Copy delombok sources"
54+
- name: 'Copy delombok sources'
5555
run: find . -type d -path "*/target/delombok" -exec sh -c 'cp -r "$1"/* "$(dirname $(dirname "$1"))/src/main/java/"' _ {} \;
5656

57-
- name: "Generate aggregated Javadoc"
57+
- name: 'Generate aggregated Javadoc'
5858
run: mvn clean javadoc:aggregate -Drelease -Djava.failOnWarning=false --projects "${PROJECTS}" --quiet
5959

60-
- name: "Checkout Docs Repository"
60+
- name: 'Create GitHub App Token'
61+
id: app-token
62+
uses: actions/create-github-app-token@v3
63+
with:
64+
client-id: ${{ secrets.SAP_CLOUD_SDK_BOT_CLIENT_ID }}
65+
private-key: ${{ secrets.SAP_CLOUD_SDK_BOT_PRIVATE_KEY }}
66+
owner: SAP
67+
repositories: cloud-sdk
68+
permission-contents: write
69+
permission-pull-requests: write
70+
71+
- name: 'Checkout Docs Repository'
6172
uses: actions/checkout@v6
6273
with:
6374
repository: ${{ env.DOCS_REPO }}
6475
path: .cloud-sdk-docs
65-
token: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
76+
token: ${{ steps.app-token.outputs.token }}
6677

67-
- name: "Replace JavaDoc"
78+
- name: 'Replace JavaDoc'
6879
id: replace-javadoc
6980
run: |
7081
TARGET_DIR=./.cloud-sdk-docs/static/java-api/v${{ steps.determine-version.outputs.MAJOR_VERSION }}
@@ -95,7 +106,7 @@ jobs:
95106
96107
git push origin $BRANCH_NAME
97108
98-
- name: "Create JavaDoc PR"
109+
- name: 'Create JavaDoc PR'
99110
id: create-javadoc-pr
100111
if: ${{ steps.replace-javadoc.outputs.CREATE_PR == 'true' }}
101112
working-directory: ./.cloud-sdk-docs
@@ -107,4 +118,4 @@ jobs:
107118
echo "PR_URL=$PR_URL" >> $GITHUB_OUTPUT
108119
echo "PR: $PR_URL" >> $GITHUB_STEP_SUMMARY
109120
env:
110-
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
121+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
Lines changed: 52 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: "Perform Release"
1+
name: 'Perform Release'
22

33
on:
44
workflow_dispatch:
55
inputs:
66
release_pr_number:
7-
description: "The PR number of the release PR"
7+
description: 'The PR number of the release PR'
88
required: true
99
skip-pr-merge:
10-
description: "Whether to skip merging the PRs"
10+
description: 'Whether to skip merging the PRs'
1111
required: false
1212
default: false
1313
type: boolean
@@ -19,7 +19,7 @@ env:
1919

2020
jobs:
2121
prerequisites:
22-
name: "Prerequisites"
22+
name: 'Prerequisites'
2323
outputs:
2424
code-branch: ${{ steps.determine-branch-names.outputs.CODE_BRANCH_NAME }}
2525
docs-branch: ${{ steps.determine-branch-names.outputs.DOCS_BRANCH_NAME }}
@@ -30,7 +30,7 @@ jobs:
3030
permissions: write-all # contents and push are needed to see the draft release
3131
runs-on: ubuntu-latest
3232
steps:
33-
- name: "Determine Branch Names"
33+
- name: 'Determine Branch Names'
3434
id: determine-branch-names
3535
run: |
3636
CODE_BRANCH_NAME=$(gh pr view ${{github.event.inputs.release_pr_number}} --repo ${{github.repository}} --json headRefName --jq '.headRefName')
@@ -39,22 +39,22 @@ jobs:
3939
RELEASE_COMMIT=$(gh release view $RELEASE_TAG --repo ${{github.repository}} --json targetCommitish --jq '.targetCommitish')
4040
RELEASE_NOTES_BRANCH_NAME=java/release-notes-$RELEASE_VERSION
4141
RELEASE_JAVADOC_BRANCH_NAME=java/release-docs-$RELEASE_VERSION
42-
42+
4343
echo "CODE_BRANCH_NAME=$CODE_BRANCH_NAME" >> $GITHUB_OUTPUT
4444
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_OUTPUT
4545
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_OUTPUT
4646
echo "RELEASE_COMMIT=$RELEASE_COMMIT" >> $GITHUB_OUTPUT
4747
echo "RELEASE_NOTES_BRANCH_NAME=$RELEASE_NOTES_BRANCH_NAME" >> $GITHUB_OUTPUT
4848
echo "RELEASE_JAVADOC_BRANCH_NAME=$RELEASE_JAVADOC_BRANCH_NAME" >> $GITHUB_OUTPUT
49-
49+
5050
echo -e "[DEBUG] Current GITHUB_OUTPUT:\n$(cat $GITHUB_OUTPUT)"
5151
env:
5252
GH_TOKEN: ${{ github.token }}
5353

54-
- name: "Checkout Repository"
54+
- name: 'Checkout Repository'
5555
uses: actions/checkout@v6
5656

57-
- name: "Check Whether Code PR Can Be Merged"
57+
- name: 'Check Whether Code PR Can Be Merged'
5858
if: ${{ inputs.skip-pr-merge != 'true' }}
5959
uses: ./.github/actions/pr-is-mergeable
6060
with:
@@ -65,53 +65,72 @@ jobs:
6565
\"dependabot merger\": []
6666
}
6767
68-
- name: "Check Code Release Commit Continuous Integration"
68+
- name: 'Check Code Release Commit Continuous Integration'
6969
if: ${{ inputs.skip-pr-merge != 'true' }}
7070
uses: ./.github/actions/workflow-succeeded
7171
with:
72-
workflow: "Continuous Integration"
72+
workflow: 'Continuous Integration'
7373
sha: ${{ steps.determine-branch-names.outputs.RELEASE_COMMIT }}
74-
excluded-jobs: "[\"Run BlackDuck Scan\"]"
74+
excluded-jobs: '["Run BlackDuck Scan"]'
75+
76+
- name: 'Create GitHub App Token'
77+
id: app-token
78+
uses: actions/create-github-app-token@v3
79+
with:
80+
client-id: ${{ secrets.SAP_CLOUD_SDK_BOT_CLIENT_ID }}
81+
private-key: ${{ secrets.SAP_CLOUD_SDK_BOT_PRIVATE_KEY }}
82+
owner: SAP
83+
repositories: cloud-sdk
7584

76-
- name: "Check Whether Release Notes PR Can Be Merged"
85+
- name: 'Check Whether Release Notes PR Can Be Merged'
7786
if: ${{ inputs.skip-pr-merge != 'true' }}
7887
uses: ./.github/actions/pr-is-mergeable
7988
with:
8089
pr-ref: ${{ steps.determine-branch-names.outputs.RELEASE_NOTES_BRANCH_NAME }}
8190
repo: ${{ env.DOCS_REPO }}
82-
token: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
91+
token: ${{ steps.app-token.outputs.token }}
8392
excluded-check-runs: |
8493
{
8594
\"Build Cloud SDK Documentation\": [\"dependabot\"]
8695
}
8796
88-
- name: "Check Whether JavaDoc PR Can Be Merged"
97+
- name: 'Check Whether JavaDoc PR Can Be Merged'
8998
if: ${{ inputs.skip-pr-merge != 'true' }}
9099
uses: ./.github/actions/pr-is-mergeable
91100
with:
92101
pr-ref: ${{ steps.determine-branch-names.outputs.RELEASE_JAVADOC_BRANCH_NAME }}
93102
repo: ${{ env.DOCS_REPO }}
94-
token: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
103+
token: ${{ steps.app-token.outputs.token }}
95104
excluded-check-runs: |
96105
{
97106
\"Build Cloud SDK Documentation\": [\"dependabot\"]
98107
}
99108
100109
release:
101-
name: "Release"
102-
needs: [ prerequisites ]
110+
name: 'Release'
111+
needs: [prerequisites]
103112
runs-on: ubuntu-latest
104113
permissions:
105114
contents: write # needed to modify the release draft
106-
pull-requests: write # needed to merge the release PR
107115
steps:
108-
- name: "Setup java"
116+
- name: 'Create GitHub App Token'
117+
id: app-token
118+
uses: actions/create-github-app-token@v3
119+
with:
120+
client-id: ${{ secrets.SAP_CLOUD_SDK_BOT_CLIENT_ID }}
121+
private-key: ${{ secrets.SAP_CLOUD_SDK_BOT_PRIVATE_KEY }}
122+
owner: SAP
123+
repositories: cloud-sdk-java,cloud-sdk
124+
permission-contents: write
125+
permission-pull-requests: write # needed to merge the release PR
126+
127+
- name: 'Setup java'
109128
uses: actions/setup-java@v5
110129
with:
111-
distribution: "sapmachine"
130+
distribution: 'sapmachine'
112131
java-version: ${{ env.JAVA_VERSION }}
113132

114-
- name: "Download Release Asset"
133+
- name: 'Download Release Asset'
115134
id: download-asset
116135
run: |
117136
gh release download ${{ needs.prerequisites.outputs.release-tag }} --dir ./ --repo "${{ github.repository }}"
@@ -120,42 +139,42 @@ jobs:
120139
env:
121140
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122141

123-
- name: "Import GPG Key"
142+
- name: 'Import GPG Key'
124143
run: |
125144
echo "${{ secrets.PGP_PRIVATE_KEY }}" | gpg --batch --passphrase "$MAVEN_GPG_PASSPHRASE" --import
126145
env:
127146
MAVEN_GPG_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
128147

129-
- name: "Create settings.xml"
148+
- name: 'Create settings.xml'
130149
run: |
131150
echo '${{ secrets.CENTRAL_SONATYPE_SETTINGS_XML }}' > settings.xml
132151
133-
- name: "Deploy"
152+
- name: 'Deploy'
134153
run: |
135154
MVN_ARGS="${{ env.MVN_CLI_ARGS }} -Drelease -s settings.xml"
136155
mvn deploy $MVN_ARGS
137156
env:
138157
MAVEN_GPG_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
139158

140-
- name: "Merge Code PR"
159+
- name: 'Merge Code PR'
141160
if: ${{ inputs.skip-pr-merge != 'true' }}
142161
run: gh pr merge --squash "${{ needs.prerequisites.outputs.code-branch }}" --delete-branch --repo "${{ github.repository }}"
143162
env:
144-
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
163+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
145164

146-
- name: "Publish the Draft Release"
165+
- name: 'Publish the Draft Release'
147166
run: gh release edit ${{ needs.prerequisites.outputs.release-tag }} --draft=false --repo "${{ github.repository }}"
148167
env:
149-
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
168+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
150169

151-
- name: "Merge Release Notes PR"
170+
- name: 'Merge Release Notes PR'
152171
if: ${{ inputs.skip-pr-merge != 'true' }}
153172
run: gh pr merge --squash "${{ needs.prerequisites.outputs.release-notes-branch }}" --delete-branch --repo "${{ env.DOCS_REPO }}"
154173
env:
155-
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
174+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
156175

157-
- name: "Merge JavaDoc PR"
176+
- name: 'Merge JavaDoc PR'
158177
if: ${{ inputs.skip-pr-merge != 'true' }}
159178
run: gh pr merge --squash "${{ needs.prerequisites.outputs.release-javadoc-branch }}" --delete-branch --repo "${{ env.DOCS_REPO }}"
160179
env:
161-
GH_TOKEN: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
180+
GH_TOKEN: ${{ steps.app-token.outputs.token }}

0 commit comments

Comments
 (0)