Skip to content

Commit

Permalink
Merge branch 'main' into feat/refresh-token
Browse files Browse the repository at this point in the history
  • Loading branch information
MatKuhr authored Apr 25, 2024
2 parents 2f29699 + 6c6da15 commit 708d480
Show file tree
Hide file tree
Showing 67 changed files with 210 additions and 82 deletions.
30 changes: 23 additions & 7 deletions .github/actions/pr-is-mergeable/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ inputs:
required: false
default: ${{ github.token }}
excluded-check-runs:
description: "A comma-separated list of workflow names that are excluded from the Check Runs check"
description: "A JSON object, where the keys are the names of the workflows to exclude. The values are a list of step names to ignore. If the list is empty, all steps of the workflow will be ignored."
required: false
default: ${{ github.workflow }}
default: '{\"${{ github.workflow }}\": []}'

outputs:
pr-number:
Expand All @@ -34,7 +34,7 @@ runs:
using: composite
steps:
- name: "Print Action Start"
run: echo ">>>>> Starting PR Is Mergeable Action; inputs = ${{ toJson(inputs) }}"
run: echo ">>>>> Starting PR Is Mergeable Action; Not printing inputs, as they might contain sensitive information"
shell: bash

- name: "Check Whether PR Is Mergeable"
Expand Down Expand Up @@ -65,14 +65,30 @@ runs:
# check runs are things like our CI pipeline
FAILED_CHECK_RUNS=$(jq -r '.[] | select(.__typename == "CheckRun" and .conclusion != "SUCCESS" and .conclusion != "NEUTRAL")' <<< "$PR_CHECKS")
IFS=',' read -ra EXCLUDED_WORKFLOWS <<< "${{ inputs.excluded-check-runs }}"
for EXCLUDED_WORKFLOW in "${EXCLUDED_WORKFLOWS[@]}"; do
EXCLUDED_WORKFLOWS=$(jq -r 'keys[]' <<< "${{ inputs.excluded-check-runs }}")
while IFS= read -r EXCLUDED_WORKFLOW; do
if [[ -z "$EXCLUDED_WORKFLOW" ]]; then
continue
fi
if [[ -z "$FAILED_CHECK_RUNS" ]]; then
break
fi
FAILED_CHECK_RUNS=$(jq -r 'select(.workflowName != "$EXCLUDED_WORKFLOW")' <<< "$FAILED_CHECK_RUNS")
done
EXCLUDED_STEPS=$(jq -r --arg workflow "$EXCLUDED_WORKFLOW" '.[$workflow] | .[]' <<< "${{ inputs.excluded-check-runs }}")
if [[ -z "$EXCLUDED_STEPS" ]]; then
# the provided list is empty, so ignore all steps of the workflow
FAILED_CHECK_RUNS=$(jq -r --arg workflow "$EXCLUDED_WORKFLOW" 'select(.workflowName != $workflow)' <<< "$FAILED_CHECK_RUNS")
else
while IFS= read -r EXCLUDED_STEP; do
if [[ -z "$EXCLUDED_STEP" ]]; then
continue
fi
FAILED_CHECK_RUNS=$(jq -r --arg workflow "$EXCLUDED_WORKFLOW" --arg step "$EXCLUDED_STEP" 'select(.workflowName != $workflow and .name != $step)' <<< "$FAILED_CHECK_RUNS")
done <<< "$EXCLUDED_STEPS"
fi
done <<< "$EXCLUDED_WORKFLOWS"
if [[ -n "$FAILED_CHECK_RUNS" ]]; then
echo "PR #$PR_NUMBER (in ${{ inputs.repo }}) contains failed check runs: "
Expand Down
94 changes: 94 additions & 0 deletions .github/actions/workflow-succeeded/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: "Workflow Succeeded"
description: "Checks whether the latest run of a given workflow for a given commit SHA succeeded"

inputs:
workflow:
description: "The name of the workflow to check"
required: true
sha:
description: "The commit SHA to check the workflow for"
required: true
repo:
description: "The repository of the workflow"
required: false
default: ${{ github.repository }}
token:
description: "The GitHub access token (with workflow read permissions) to access the workflow"
required: false
default: ${{ github.token }}
excluded-jobs:
description: "A JSON list of job names to ignore"
required: false
default: '[]'
outputs:
run-id:
description: "The ID of the latest run of the workflow"
value: ${{ steps.find-run-id.outputs.RUN_ID }}
succeeded:
description: "Whether the latest run of the workflow succeeded"
value: ${{ steps.set-result.outputs.RESULT }}

runs:
using: composite
steps:
- name: "Print Action Start"
run: echo ">>>>> Starting Workflow Succeeded Action; Not printing inputs, as they might contain sensitive information"
shell: bash

- name: "Determine Run Id"
id: find-run-id
run: |
RUN_JSON=$(gh run list --commit "${{ inputs.sha }}" --workflow "${{ inputs.workflow }}" --repo "${{ inputs.repo }}" --status completed --limit 1 --json databaseId,conclusion | jq '.[0]')
if [[ "$(jq -r '.conclusion' <<< "$RUN_JSON")" != "success" ]]; then
exit 1
fi
echo "RUN_ID=$(jq -r '.databaseId' <<< "$RUN_JSON")" >> $GITHUB_OUTPUT
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}

- name: "Check Run Jobs"
id: check-run-jobs
run: |
JOBS_JSON=$(gh run view "${{ steps.find-run-id.outputs.RUN_ID }}" --json jobs)
NON_SUCCESSFUL_JOBS=$(jq -r '.jobs[] | select(.conclusion != "success" and .conclusion != "neutral")' <<< "$JOBS_JSON")
EXCLUDED_JOBS=$(jq -r '.[]' <<< "${{ inputs.excluded-jobs }}")
while IFS= read -r EXCLUDED_JOB; do
if [[ -z "$EXCLUDED_JOB" ]]; then
continue
fi
NON_SUCCESSFUL_JOBS=$(jq -r --arg name "$EXCLUDED_JOB" 'select(.name != $name)' <<< "$NON_SUCCESSFUL_JOBS")
done <<< "$EXCLUDED_JOBS"
if [[ -n "$NON_SUCCESSFUL_JOBS" ]]; then
echo "The following jobs did not succeed:"
echo "$NON_SUCCESSFUL_JOBS"
exit 1
fi
shell: bash
env:
GH_TOKEN: ${{ inputs.token }}

- name: "Set Result"
if: always()
id: set-result
run: |
if [[ "${{ steps.find-run-id.outcome }}" != "success" ]]; then
echo "RESULT=false" >> $GITHUB_OUTPUT
exit 0
fi
if [[ "${{ steps.check-run-jobs.outcome }}" != "success" ]]; then
echo "RESULT=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "RESULT=true" >> $GITHUB_OUTPUT
shell: bash

- name: "Print Action End"
if: always()
run: echo "<<<<< Finished Workflow Succeeded Action"
shell: bash
27 changes: 25 additions & 2 deletions .github/workflows/perform-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ jobs:
code-branch: ${{ steps.determine-branch-names.outputs.CODE_BRANCH_NAME }}
docs-branch: ${{ steps.determine-branch-names.outputs.DOCS_BRANCH_NAME }}
release-notes-branch: ${{ steps.determine-branch-names.outputs.RELEASE_NOTES_BRANCH_NAME }}
release-commit: ${{ steps.determine-branch-names.outputs.RELEASE_COMMIT }}
permissions:
pull-requests: read
contents: read
runs-on: ubuntu-latest
steps:
- name: "Determine Branch Names"
Expand All @@ -53,19 +55,32 @@ jobs:
echo "CODE_BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT
echo "DOCS_BRANCH_NAME=$DOCS_BRANCH" >> $GITHUB_OUTPUT
echo "RELEASE_NOTES_BRANCH_NAME=$RELEASE_NOTES_BRANCH" >> $GITHUB_OUTPUT
echo "RELEASE_COMMIT=$(gh release view "$RELEASE_TAG" --repo "${{ github.repository }}" --json targetCommitish | jq -r '.targetCommitish')" >> $GITHUB_OUTPUT
echo "[DEBUG] Current GITHUB_OUTPUT: '$(cat $GITHUB_OUTPUT)'"
env:
GH_TOKEN: ${{ github.token }}

- name: "Checkout Repository"
uses: actions/checkout@v4
with:
ref: ${{ steps.determine-branch-names.outputs.CODE_BRANCH_NAME }}

- name: "Check Whether Code PR Can Be Merged"
if: ${{ inputs.skip-pr-merge != 'true' }}
uses: ./.github/actions/pr-is-mergeable
with:
pr-ref: ${{ steps.determine-branch-names.outputs.CODE_BRANCH_NAME }}
excluded-check-runs: |
{
\"Continuous Integration\": [\"Run BlackDuck Scan\", \"Run Security Rating\"],
\"dependabot merger\": []
}
- name: "Check Code Release Commit Continuous Integration"
if: ${{ inputs.skip-pr-merge != 'true' }}
uses: ./.github/actions/workflow-succeeded
with:
workflow: "Continuous Integration"
sha: ${{ steps.determine-branch-names.outputs.RELEASE_COMMIT }}

- name: "Check Whether Docs PR Can Be Merged"
if: ${{ inputs.skip-pr-merge != 'true' }}
Expand All @@ -74,6 +89,10 @@ jobs:
pr-ref: ${{ steps.determine-branch-names.outputs.DOCS_BRANCH_NAME }}
repo: ${{ env.DOCS_REPO }}
token: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
excluded-check-runs: |
{
\"Build Cloud SDK Documentation\": [\"dependabot\"]
}
- name: "Check Whether Release Notes PR Can Be Merged"
if: ${{ inputs.skip-pr-merge != 'true' }}
Expand All @@ -82,6 +101,10 @@ jobs:
pr-ref: ${{ steps.determine-branch-names.outputs.RELEASE_NOTES_BRANCH_NAME }}
repo: ${{ env.DOCS_REPO }}
token: ${{ secrets.BOT_SDK_JS_FOR_DOCS_REPO_PR }}
excluded-check-runs: |
{
\"Build Cloud SDK Documentation\": [\"dependabot\"]
}
release:
name: "Release"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![build](https://github.com/SAP/cloud-sdk-java/actions/workflows/continuous-integration.yaml/badge.svg)
[![REUSE status](https://api.reuse.software/badge/github.com/SAP/cloud-sdk-java)](https://api.reuse.software/info/github.com/SAP/cloud-sdk-java)
[![Fosstars security rating](https://github.com/SAP/cloud-sdk-java/blob/fosstars-report/fosstars_badge.svg)](https://github.com/SAP/cloud-sdk-java/blob/fosstars-report/fosstars_report.md)
[![Maven Central](https://img.shields.io/badge/maven_central-5.7.0-blue.svg)](https://search.maven.org/search?q=g:com.sap.cloud.sdk%20AND%20a:sdk-core%20AND%20v:5.7.0)
[![Maven Central](https://img.shields.io/badge/maven_central-5.8.0-blue.svg)](https://search.maven.org/search?q=g:com.sap.cloud.sdk%20AND%20a:sdk-core%20AND%20v:5.8.0)

# SAP Cloud SDK for Java

Expand Down
2 changes: 1 addition & 1 deletion archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<groupId>com.sap.cloud.sdk.archetypes</groupId>
<artifactId>archetypes-parent</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion archetypes/spring-boot3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.archetypes</groupId>
<artifactId>archetypes-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>spring-boot3</artifactId>
<packaging>maven-archetype</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<spring-boot.version>3.2.0</spring-boot.version>

<java.version>17</java.version>
<cloud-sdk.version>5.8.0-SNAPSHOT</cloud-sdk.version>
<cloud-sdk.version>5.9.0-SNAPSHOT</cloud-sdk.version>

<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/caching/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>caching</artifactId>
<name>Business Technology Platform - Caching</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/cloudplatform-connectivity-scp-cf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>cloudplatform-connectivity-scp-cf</artifactId>
<name>(Deprecated) Cloud Platform - Connectivity SAP BTP Cloud Foundry</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/cloudplatform-connectivity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>cloudplatform-connectivity</artifactId>
<name>Business Technology Platform - Connectivity</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/cloudplatform-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>cloudplatform-core</artifactId>
<name>Cloud Platform - Core</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/connectivity-apache-httpclient4/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>connectivity-apache-httpclient4</artifactId>
<name>Connectivity - Apache HTTP Client 4</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/connectivity-apache-httpclient5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>connectivity-apache-httpclient5</artifactId>
<name>Apache version 5 Http Client integration</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/connectivity-destination-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>connectivity-destination-service</artifactId>
<name>Cloud Platform - Connectivity SAP BTP Cloud Foundry</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/connectivity-dwc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>connectivity-dwc</artifactId>
<name>Deploy with Confidence Connectivity</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/connectivity-oauth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>connectivity-oauth</artifactId>
<name>OAuth2 Connectivity</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/connectivity-ztis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>connectivity-ztis</artifactId>
<name>Connectivity - Zero Trust Identity Service</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/dwc-cf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>dwc-cf</artifactId>
<name>(Deprecated) Cloud Platform - SAP Deploy with Confidence on Cloud Foundry</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk</groupId>
<artifactId>sdk-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/resilience-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>resilience-api</artifactId>
<name>Cloud Platform - Resilience API</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/resilience/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>resilience</artifactId>
<name>Cloud Platform - Resilience API and Default Implementation</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/resilience4j/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>resilience4j</artifactId>
<name>Cloud Platform - Resilience4j</name>
Expand Down
2 changes: 1 addition & 1 deletion cloudplatform/scp-cf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.8.0-SNAPSHOT</version>
<version>5.9.0-SNAPSHOT</version>
</parent>
<artifactId>scp-cf</artifactId>
<name>(Deprecated) Business Technology Platform - SAP BTP Cloud Foundry</name>
Expand Down
Loading

0 comments on commit 708d480

Please sign in to comment.