From 18d18939c7243ba95f34333a818f887eb10fa5af Mon Sep 17 00:00:00 2001 From: Jesse Simpson Date: Tue, 27 Feb 2024 08:00:08 -0500 Subject: [PATCH] fix: resolves github deployment git ref when it differs from helm repo (#1276) --- .github/workflows/dispatch-integration.yaml | 12 +++++++++--- .github/workflows/test-integration-template.yaml | 16 ++++++++++------ .github/workflows/test-integration.yaml | 3 ++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dispatch-integration.yaml b/.github/workflows/dispatch-integration.yaml index 4916b5ab47..51af1f5e3d 100644 --- a/.github/workflows/dispatch-integration.yaml +++ b/.github/workflows/dispatch-integration.yaml @@ -7,8 +7,13 @@ on: description: The unique identifier of used in the deployment hostname. required: true type: string - git-ref: - description: Git ref + camunda-helm-git-ref: + description: Git ref of the helm chart repo + required: false + default: main + type: string + caller-git-ref: + description: Git ref of the repo calling the template required: false default: main type: string @@ -52,7 +57,8 @@ jobs: secrets: inherit with: identifier: ${{ github.event.inputs.identifier }} - git-ref: ${{ github.event.inputs.git-ref }} + caller-git-ref: ${{ github.event.inputs.caller-git-ref }} + camunda-helm-git-ref: ${{ github.event.inputs.camunda-helm-git-ref }} persistent: ${{ github.event.inputs.persistent == 'true' }} platforms: ${{ github.event.inputs.platforms }} flows: ${{ github.event.inputs.flows }} diff --git a/.github/workflows/test-integration-template.yaml b/.github/workflows/test-integration-template.yaml index 8a7c581078..086f4f9e5d 100644 --- a/.github/workflows/test-integration-template.yaml +++ b/.github/workflows/test-integration-template.yaml @@ -7,7 +7,11 @@ on: description: The unique identifier of used in the deployment hostname. required: true type: string - git-ref: + camunda-helm-git-ref: + required: false + default: main + type: string + caller-git-ref: required: false default: main type: string @@ -105,7 +109,7 @@ jobs: with: # This is needed to load repo GH composite actions if the workflow triggered by workflow_call. repository: camunda/camunda-platform-helm - ref: ${{ inputs.git-ref }} + ref: ${{ inputs.camunda-helm-git-ref }} # TODO: Later, find a way to abstract the auth for different platforms. - name: Authenticate to GKE if: matrix.distro.platform == 'gke' @@ -158,7 +162,7 @@ jobs: step: start token: ${{ secrets.GITHUB_TOKEN }} env: ${{ steps.vars.outputs.identifier }} - ref: ${{ inputs.git-ref }} + ref: ${{ inputs.caller-git-ref }} - name: Pre setup timeout-minutes: 5 env: @@ -204,7 +208,7 @@ jobs: deployment_id: ${{ steps.deployment.outputs.deployment_id }} env_url: https://${{ steps.vars.outputs.ingress-host }} env: ${{ steps.vars.outputs.identifier }} - ref: ${{ inputs.git-ref }} + ref: ${{ inputs.caller-git-ref }} - name: ⭐️ Run Preflight TestSuite ⭐️ if: inputs.test-enabled timeout-minutes: 10 @@ -228,7 +232,7 @@ jobs: step: deactivate-env token: ${{ secrets.GITHUB_TOKEN }} env: ${{ steps.vars.outputs.identifier }} - ref: ${{ inputs.git-ref }} + ref: ${{ inputs.caller-git-ref }} - name: Cleanup test namespace if: always() && (env.TEST_PERSISTENT == 'false' || matrix.distro.type != 'kubernetes') run: | @@ -268,7 +272,7 @@ jobs: step: deactivate-env token: ${{ secrets.GITHUB_TOKEN }} env: ${{ steps.vars.outputs.identifier }} - ref: ${{ inputs.git-ref }} + ref: ${{ inputs.caller-git-ref }} - name: Cleanup test namespace if: always() run: | diff --git a/.github/workflows/test-integration.yaml b/.github/workflows/test-integration.yaml index 936c968ab1..c94bddd3ac 100644 --- a/.github/workflows/test-integration.yaml +++ b/.github/workflows/test-integration.yaml @@ -28,4 +28,5 @@ jobs: persistent: "${{ contains(github.event.*.labels.*.name, 'test-persistent') }}" platforms: "gke,rosa" flows: "install,upgrade" - git-ref: ${{ github.event.pull_request.head.sha }} + caller-git-ref: ${{ github.event.pull_request.head.sha }} + camunda-helm-git-ref: ${{ github.event.pull_request.head.sha }}