From afbd1fafbfc9171eae40ad61ff4f0e5a99e22a08 Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 14:23:04 +0200 Subject: [PATCH 01/12] ci: test patches for older minor versions with correct dependencies --- .github/workflows/INTEGRATION_TEST.yml | 71 +++++++++++++++++++++----- .github/workflows/helm-git-refs.json | 7 +++ 2 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/helm-git-refs.json diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index 309dd830e4..4908b5d779 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -2,12 +2,17 @@ name: Integration test on: + push: + branches: + - release/* workflow_dispatch: inputs: - connectors_version: - description: 'The version of the connectors to test' - required: true - default: 'SNAPSHOT' + connectors-version: + description: 'The version of the connectors to test. If not provided, the version is determined based on the Maven project version. On main branch, the default is SNAPSHOT' + required: false + helm-branch: + description: 'The branch of the Helm chart to test against. If not provided, the branch is determined based on the ref (see helm-git-refs.json)' + required: false defaults: run: @@ -17,13 +22,51 @@ defaults: jobs: helm-deploy: - name: Helm chart Integration Tests - uses: camunda/camunda-platform-helm/.github/workflows/test-integration-template.yaml@main - secrets: inherit - with: - identifier: connectors-int - test-enabled: true - extra-values: | - connectors: - image: - tag: ${{ github.event.inputs.connectors_version }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Install jq + run: sudo apt-get install jq + + - name: Determine current Maven project version + id: maven-version + run: | + echo "::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" + + - name: Determine version of the Connectors image to use + id: connectors-version + run: | + if [ -z "${{ github.event.inputs.connectors-version }}" ]; then + if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then + echo "::set-output name=connectors-version::SNAPSHOT" + else + echo "::set-output name=connectors-version::${{ steps.maven-version.outputs.version }}" + fi + else + echo "::set-output name=connectors-version::${{ github.event.inputs.connectors-version }}" + fi + + - name: Determine Helm chart ref to use + run: | + if [ -z "${{ github.event.inputs.helm-branch }}" ]; then + helm_branch=$(jq -r ".[\"${{ github.ref }}\"]" .github/workflows/helm-git-refs.json) + if [ -z "$helm_branch" ]; then + echo "::error::Could not determine Helm chart branch to use, please provide helm-branch input or adjust the mappings in .github/workflows/helm-git-refs.json" + exit 1 + fi + echo "::set-output name=helm-branch::$helm_branch" + else + echo "::set-output name=helm-branch::${{ github.event.inputs.helm-branch }}" + fi + - name: Helm chart Integration Tests + uses: camunda/camunda-platform-helm/.github/workflows/test-integration-template.yaml@main + secrets: inherit + with: + identifier: connectors-int + camunda-helm-git-ref: ${{ steps.helm-branch.outputs.helm-branch }} + test-enabled: true + extra-values: | + connectors: + image: + tag: ${{ steps.connectors-version.outputs.connectors-version }} diff --git a/.github/workflows/helm-git-refs.json b/.github/workflows/helm-git-refs.json new file mode 100644 index 0000000000..8d53315ef9 --- /dev/null +++ b/.github/workflows/helm-git-refs.json @@ -0,0 +1,7 @@ +{ + "refs/heads/main": "main", + "refs/heads/release/8.6": "main", + "refs/heads/release/8.5": "main", + "refs/heads/release/8.4": "camunda-platform-8.4", + "refs/heads/release/8.3": "camunda-platform-8.3" +} \ No newline at end of file From f72f9bc495c1c04a1814bcd2237006195e8908ad Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 14:31:09 +0200 Subject: [PATCH 02/12] fix workflow --- .github/workflows/INTEGRATION_TEST.yml | 31 ++++++++++++++++---------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index 4908b5d779..34198bb627 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -21,8 +21,12 @@ defaults: shell: bash jobs: - helm-deploy: + prepare-inputs: runs-on: ubuntu-latest + name: Prepare inputs + outputs: + connectors-version: ${{ steps.maven-version.outputs.version }} + helm-branch: ${{ steps.helm-branch.outputs.helm-branch }} steps: - uses: actions/checkout@v2 @@ -59,14 +63,17 @@ jobs: else echo "::set-output name=helm-branch::${{ github.event.inputs.helm-branch }}" fi - - name: Helm chart Integration Tests - uses: camunda/camunda-platform-helm/.github/workflows/test-integration-template.yaml@main - secrets: inherit - with: - identifier: connectors-int - camunda-helm-git-ref: ${{ steps.helm-branch.outputs.helm-branch }} - test-enabled: true - extra-values: | - connectors: - image: - tag: ${{ steps.connectors-version.outputs.connectors-version }} + + helm-deploy: + needs: prepare-inputs + name: Helm chart Integration Tests + uses: camunda/camunda-platform-helm/.github/workflows/test-integration-template.yaml@main + secrets: inherit + with: + identifier: connectors-int + camunda-helm-git-ref: ${{ needs.prepare-inputs.outputs.helm-branch }} + test-enabled: true + extra-values: | + connectors: + image: + tag: ${{ needs.prepare-inputs.outputs.connectors-version }} From b08908e756215769b6af3c5c126d69e9451031dc Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 14:34:06 +0200 Subject: [PATCH 03/12] add prepare java --- .github/workflows/INTEGRATION_TEST.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index 34198bb627..c23cb392e8 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -33,6 +33,12 @@ jobs: - name: Install jq run: sudo apt-get install jq + - name: Prepare Java and Maven settings + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Determine current Maven project version id: maven-version run: | From b06b5bd29587ca7c319be826cbc76ad4ff1e4668 Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 14:35:31 +0200 Subject: [PATCH 04/12] add result logging --- .github/workflows/INTEGRATION_TEST.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index c23cb392e8..32988352f6 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -33,12 +33,6 @@ jobs: - name: Install jq run: sudo apt-get install jq - - name: Prepare Java and Maven settings - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - - name: Determine current Maven project version id: maven-version run: | @@ -70,6 +64,11 @@ jobs: echo "::set-output name=helm-branch::${{ github.event.inputs.helm-branch }}" fi + - name: Log results + run: | + echo "Connectors version: ${{ steps.connectors-version.outputs.connectors-version }}" + echo "Helm branch: ${{ steps.helm-branch.outputs.helm-branch }}" + helm-deploy: needs: prepare-inputs name: Helm chart Integration Tests From 1f166cfd41eac3e0799d8e971457036c1dee30f2 Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 14:39:48 +0200 Subject: [PATCH 05/12] add result logging --- .github/workflows/INTEGRATION_TEST.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index 32988352f6..0a0a4c157f 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -55,7 +55,7 @@ jobs: run: | if [ -z "${{ github.event.inputs.helm-branch }}" ]; then helm_branch=$(jq -r ".[\"${{ github.ref }}\"]" .github/workflows/helm-git-refs.json) - if [ -z "$helm_branch" ]; then + if [ -z "$helm_branch" ] || [ "$helm_branch" == "null" ]; then echo "::error::Could not determine Helm chart branch to use, please provide helm-branch input or adjust the mappings in .github/workflows/helm-git-refs.json" exit 1 fi From d1368b1a82d7de85670bbd3bb5183c645d73358a Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 14:40:09 +0200 Subject: [PATCH 06/12] setup java --- .github/workflows/INTEGRATION_TEST.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index 0a0a4c157f..cecee9bc9e 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -33,6 +33,12 @@ jobs: - name: Install jq run: sudo apt-get install jq + - name: Prepare Java and Maven settings + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + - name: Determine current Maven project version id: maven-version run: | From ac08e2ef73e0927ffbf93a2fdfccc8047ccb1117 Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 14:58:12 +0200 Subject: [PATCH 07/12] use newer syntax to set outputs --- .github/workflows/INTEGRATION_TEST.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index cecee9bc9e..b0d99ef003 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -42,19 +42,19 @@ jobs: - name: Determine current Maven project version id: maven-version run: | - echo "::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" + echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT - name: Determine version of the Connectors image to use id: connectors-version run: | if [ -z "${{ github.event.inputs.connectors-version }}" ]; then if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then - echo "::set-output name=connectors-version::SNAPSHOT" + echo "connectors-version=SNAPSHOT" >> $GITHUB_OUTPUT else - echo "::set-output name=connectors-version::${{ steps.maven-version.outputs.version }}" + echo "connectors-version=${{ steps.maven-version.outputs.version }}" >> $GITHUB_OUTPUT fi else - echo "::set-output name=connectors-version::${{ github.event.inputs.connectors-version }}" + echo "connectors-version=${{ github.event.inputs.connectors-version }}" >> $GITHUB_OUTPUT fi - name: Determine Helm chart ref to use @@ -65,9 +65,9 @@ jobs: echo "::error::Could not determine Helm chart branch to use, please provide helm-branch input or adjust the mappings in .github/workflows/helm-git-refs.json" exit 1 fi - echo "::set-output name=helm-branch::$helm_branch" + echo "helm-branch=$helm_branch" >> $GITHUB_OUTPUT else - echo "::set-output name=helm-branch::${{ github.event.inputs.helm-branch }}" + echo "helm-branch=${{ github.event.inputs.helm-branch }}" >> $GITHUB_OUTPUT fi - name: Log results From f7e49aee8de3f73c52e18833c661b4abbd78daee Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 15:09:39 +0200 Subject: [PATCH 08/12] try running mvn in offline mode for faster execution --- .github/workflows/INTEGRATION_TEST.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index b0d99ef003..bb729eb72f 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -42,7 +42,7 @@ jobs: - name: Determine current Maven project version id: maven-version run: | - echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT + echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -o)" >> $GITHUB_OUTPUT - name: Determine version of the Connectors image to use id: connectors-version From 7df1daaef7c0ca24edb3210ffa246a0d1561dab2 Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 15:10:22 +0200 Subject: [PATCH 09/12] fix id --- .github/workflows/INTEGRATION_TEST.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index bb729eb72f..9009b20a2e 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -58,6 +58,7 @@ jobs: fi - name: Determine Helm chart ref to use + id: helm-branch run: | if [ -z "${{ github.event.inputs.helm-branch }}" ]; then helm_branch=$(jq -r ".[\"${{ github.ref }}\"]" .github/workflows/helm-git-refs.json) From 089865c03ea1da04d8ed9584e3914d687b0b82e1 Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 16:31:43 +0200 Subject: [PATCH 10/12] simplify mvn version check --- .github/workflows/INTEGRATION_TEST.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index 9009b20a2e..5467498496 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -33,16 +33,10 @@ jobs: - name: Install jq run: sudo apt-get install jq - - name: Prepare Java and Maven settings - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '21' - - name: Determine current Maven project version id: maven-version run: | - echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -o)" >> $GITHUB_OUTPUT + echo "version=$(grep -oPm1 "(?<=)[^<]+" "pom.xml")" >> $GITHUB_OUTPUT - name: Determine version of the Connectors image to use id: connectors-version From 08ba2f2188d8e821908ec4ec118186b8b780e6b4 Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky Date: Wed, 22 May 2024 16:58:46 +0200 Subject: [PATCH 11/12] fix connectors version --- .github/workflows/INTEGRATION_TEST.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index 5467498496..552d770725 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest name: Prepare inputs outputs: - connectors-version: ${{ steps.maven-version.outputs.version }} + connectors-version: ${{ steps.connectors-version.outputs.connectors-version }} helm-branch: ${{ steps.helm-branch.outputs.helm-branch }} steps: - uses: actions/checkout@v2 From 7e5315a2d468336fddce6c9d0f9bdea48c2510ee Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky <38818382+chillleader@users.noreply.github.com> Date: Wed, 22 May 2024 21:42:23 +0200 Subject: [PATCH 12/12] Apply branding :) Co-authored-by: Igor Petrov <108870003+igpetrov@users.noreply.github.com> --- .github/workflows/INTEGRATION_TEST.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/INTEGRATION_TEST.yml b/.github/workflows/INTEGRATION_TEST.yml index 552d770725..daebe54013 100644 --- a/.github/workflows/INTEGRATION_TEST.yml +++ b/.github/workflows/INTEGRATION_TEST.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: inputs: connectors-version: - description: 'The version of the connectors to test. If not provided, the version is determined based on the Maven project version. On main branch, the default is SNAPSHOT' + description: 'The version of the Connectors to test. If not provided, the version is determined based on the Maven project version. On main branch, the default is SNAPSHOT' required: false helm-branch: description: 'The branch of the Helm chart to test against. If not provided, the branch is determined based on the ref (see helm-git-refs.json)'