From b439ede9a134b1b1b485c841b1741b3fe23d15cf Mon Sep 17 00:00:00 2001 From: Rahul Vats Date: Fri, 22 Dec 2023 15:15:21 +0530 Subject: [PATCH 1/9] debuging a check --- .github/workflows/reuse-wf-check-rc-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reuse-wf-check-rc-release.yaml b/.github/workflows/reuse-wf-check-rc-release.yaml index c55112835..2e104b914 100644 --- a/.github/workflows/reuse-wf-check-rc-release.yaml +++ b/.github/workflows/reuse-wf-check-rc-release.yaml @@ -51,7 +51,7 @@ on: # yamllint disable-line rule:truthy jobs: check-rc-testing-announcement: runs-on: 'ubuntu-20.04' - if: github.event_name == 'schedule' + # if: github.event_name == 'schedule' env: GH_TOKEN: ${{ github.token }} steps: @@ -116,7 +116,7 @@ jobs: validate-manual-input: runs-on: 'ubuntu-20.04' - if: github.event_name == 'workflow_dispatch' + if: github.event_name == 'schedule' steps: - name: Validate user input if: | From 06221bceb5dd45f9ffaa71f061940ef09f71b022 Mon Sep 17 00:00:00 2001 From: Rahul Vats Date: Fri, 22 Dec 2023 15:49:29 +0530 Subject: [PATCH 2/9] deploy only when rc is released --- .github/workflows/reuse-wf-check-rc-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reuse-wf-check-rc-release.yaml b/.github/workflows/reuse-wf-check-rc-release.yaml index 2e104b914..c55112835 100644 --- a/.github/workflows/reuse-wf-check-rc-release.yaml +++ b/.github/workflows/reuse-wf-check-rc-release.yaml @@ -51,7 +51,7 @@ on: # yamllint disable-line rule:truthy jobs: check-rc-testing-announcement: runs-on: 'ubuntu-20.04' - # if: github.event_name == 'schedule' + if: github.event_name == 'schedule' env: GH_TOKEN: ${{ github.token }} steps: @@ -116,7 +116,7 @@ jobs: validate-manual-input: runs-on: 'ubuntu-20.04' - if: github.event_name == 'schedule' + if: github.event_name == 'workflow_dispatch' steps: - name: Validate user input if: | From 23a011c3c6989a8604b23d9c4100d766605e776f Mon Sep 17 00:00:00 2001 From: Rahul Vats Date: Fri, 22 Dec 2023 15:50:50 +0530 Subject: [PATCH 3/9] deploy only when rc is released --- .github/workflows/test-rc-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-rc-release.yaml b/.github/workflows/test-rc-release.yaml index 31acff2e6..4f6536d2b 100644 --- a/.github/workflows/test-rc-release.yaml +++ b/.github/workflows/test-rc-release.yaml @@ -42,7 +42,7 @@ jobs: needs: check-airflow-provider-rc-release if: | always() && - needs.check-airflow-provider-rc-release.result == 'success' + needs.check-airflow-provider-rc-release.outputs.rc_issue_url != '' uses: ./.github/workflows/reuse-wf-deploy-to-astro-cloud.yaml with: git_rev: ${{ needs.check-airflow-provider-rc-release.outputs.rc_testing_branch }} @@ -73,7 +73,7 @@ jobs: needs: check-airflow-provider-rc-release if: | always() && - needs.check-airflow-provider-rc-release.result == 'success' + needs.check-airflow-provider-rc-release.outputs.rc_issue_url != '' uses: ./.github/workflows/reuse-wf-deploy-to-astro-cloud.yaml with: git_rev: ${{ needs.check-airflow-provider-rc-release.outputs.rc_testing_branch }} From cd9053f5ef26971b707a6422c1f04d24d388ec20 Mon Sep 17 00:00:00 2001 From: Rahul Vats Date: Fri, 22 Dec 2023 16:43:01 +0530 Subject: [PATCH 4/9] adding rc_issue_url explicitly --- .github/workflows/test-rc-release.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/test-rc-release.yaml b/.github/workflows/test-rc-release.yaml index 4f6536d2b..9ae56c98c 100644 --- a/.github/workflows/test-rc-release.yaml +++ b/.github/workflows/test-rc-release.yaml @@ -37,6 +37,8 @@ jobs: git_username: "airflow-oss-bot" secrets: BOT_ACCESS_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }} + outputs: + rc_issue_url: ${{ jobs.export-rc-testing-branch-name.outputs.rc_testing_branch }} deploy-rc-testing-branch-to-astro-cloud: needs: check-airflow-provider-rc-release @@ -53,6 +55,11 @@ jobs: deployment_id: ${{ secrets.PROVIDER_INTEGRATION_TESTS_DEPLOYMENT_ID }} bearer_token: ${{ secrets.BEARER_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + outputs: + rc_testing_branch: + description: 'personal access token for the bot to push the commit and create pull request' + value: ${{ jobs.export-rc-testing-branch-name.outputs.rc_testing_branch }} + wait-for-deployment-to-be-ready-and-trigger-master-dag: needs: [deploy-rc-testing-branch-to-astro-cloud, check-airflow-provider-rc-release] From 7456f6145baf4d2fbdf536f5af7fd8461f85563e Mon Sep 17 00:00:00 2001 From: Rahul Vats Date: Fri, 22 Dec 2023 16:44:23 +0530 Subject: [PATCH 5/9] removing incorrect output --- .github/workflows/test-rc-release.yaml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/test-rc-release.yaml b/.github/workflows/test-rc-release.yaml index 9ae56c98c..1cbdccd96 100644 --- a/.github/workflows/test-rc-release.yaml +++ b/.github/workflows/test-rc-release.yaml @@ -55,12 +55,7 @@ jobs: deployment_id: ${{ secrets.PROVIDER_INTEGRATION_TESTS_DEPLOYMENT_ID }} bearer_token: ${{ secrets.BEARER_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - outputs: - rc_testing_branch: - description: 'personal access token for the bot to push the commit and create pull request' - value: ${{ jobs.export-rc-testing-branch-name.outputs.rc_testing_branch }} - - + wait-for-deployment-to-be-ready-and-trigger-master-dag: needs: [deploy-rc-testing-branch-to-astro-cloud, check-airflow-provider-rc-release] if: | From 48c88815182e785abea8829a93cc732219bf9748 Mon Sep 17 00:00:00 2001 From: Rahul Vats Date: Fri, 22 Dec 2023 16:53:03 +0530 Subject: [PATCH 6/9] add rc_issue_url explictly --- .github/workflows/test-rc-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-rc-release.yaml b/.github/workflows/test-rc-release.yaml index 1cbdccd96..ccc60dc76 100644 --- a/.github/workflows/test-rc-release.yaml +++ b/.github/workflows/test-rc-release.yaml @@ -38,7 +38,7 @@ jobs: secrets: BOT_ACCESS_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }} outputs: - rc_issue_url: ${{ jobs.export-rc-testing-branch-name.outputs.rc_testing_branch }} + rc_issue_url: ${{ steps.export-rc-issue-url.outputs.rc_issue_url }} deploy-rc-testing-branch-to-astro-cloud: needs: check-airflow-provider-rc-release @@ -55,7 +55,7 @@ jobs: deployment_id: ${{ secrets.PROVIDER_INTEGRATION_TESTS_DEPLOYMENT_ID }} bearer_token: ${{ secrets.BEARER_TOKEN }} SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - + wait-for-deployment-to-be-ready-and-trigger-master-dag: needs: [deploy-rc-testing-branch-to-astro-cloud, check-airflow-provider-rc-release] if: | From a2b180aec042ee1019cee8f79845c8f8cf41454d Mon Sep 17 00:00:00 2001 From: Rahul Vats Date: Fri, 22 Dec 2023 17:01:15 +0530 Subject: [PATCH 7/9] revert explicit output --- .github/workflows/test-rc-release.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-rc-release.yaml b/.github/workflows/test-rc-release.yaml index ccc60dc76..4f6536d2b 100644 --- a/.github/workflows/test-rc-release.yaml +++ b/.github/workflows/test-rc-release.yaml @@ -37,8 +37,6 @@ jobs: git_username: "airflow-oss-bot" secrets: BOT_ACCESS_TOKEN: ${{ secrets.BOT_ACCESS_TOKEN }} - outputs: - rc_issue_url: ${{ steps.export-rc-issue-url.outputs.rc_issue_url }} deploy-rc-testing-branch-to-astro-cloud: needs: check-airflow-provider-rc-release From a962516aa608774a8ac041a48d51d00d16a556c6 Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Thu, 14 Mar 2024 13:54:21 -0700 Subject: [PATCH 8/9] ci(github-actions): unify yaml format and explicitly export no_provider_changed --- .../workflows/reuse-wf-check-rc-release.yaml | 38 +++++++++++-------- .github/workflows/test-rc-release.yaml | 36 +++++++++++++----- 2 files changed, 49 insertions(+), 25 deletions(-) diff --git a/.github/workflows/reuse-wf-check-rc-release.yaml b/.github/workflows/reuse-wf-check-rc-release.yaml index c55112835..1c11e83d1 100644 --- a/.github/workflows/reuse-wf-check-rc-release.yaml +++ b/.github/workflows/reuse-wf-check-rc-release.yaml @@ -1,7 +1,7 @@ --- name: (Reusable workflows) Check airflow provider RC releases and create testing branch -on: # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy workflow_call: inputs: rc_testing_branch: @@ -13,19 +13,19 @@ on: # yamllint disable-line rule:truthy (Either rc_testing_branch or issue_url is required, and you cannot give both.) required: false type: string - default: '' + default: "" issue_url: description: | issue_url: the GitHub issue URL that tracks the status of Providers release (Either rc_testing_branch or issue_url is required, and you cannot give both.) required: false type: string - default: '' + default: "" base_git_rev: - description: 'The base git revision to test Providers RCs' + description: "The base git revision to test Providers RCs" required: false type: string - default: 'main' + default: "main" git_email: description: "bot's email for setting up git" required: true @@ -38,19 +38,25 @@ on: # yamllint disable-line rule:truthy description: "the path to run scripts" required: false type: string - default: '' + default: "" secrets: BOT_ACCESS_TOKEN: - description: 'personal access token for the bot to push the commit and create pull request' + description: "personal access token for the bot to push the commit and create pull request" required: true outputs: rc_testing_branch: - description: 'personal access token for the bot to push the commit and create pull request' + description: "personal access token for the bot to push the commit and create pull request" value: ${{ jobs.export-rc-testing-branch-name.outputs.rc_testing_branch }} + no_provider_changed: + description: "no provider has been changed in this rc release" + value: ${{ jobs.create-branch-for-testing-rc-release.outputs.no_provider_changed }} + rc_issue_url: + description: "the newly found GitHub issue URL that tracks the status of Providers release" + value: ${{ jobs.check-rc-testing-announcement.outputs.rc_issue_url }} jobs: check-rc-testing-announcement: - runs-on: 'ubuntu-20.04' + runs-on: "ubuntu-20.04" if: github.event_name == 'schedule' env: GH_TOKEN: ${{ github.token }} @@ -58,7 +64,7 @@ jobs: - name: Checkout apache-airflow uses: actions/checkout@v3 with: - repository: 'apache/airflow' + repository: "apache/airflow" - name: Parse the latest 100 GitHub issues from apache-airflow to check providers testing announcement id: parse-airflow-gh-issues @@ -115,20 +121,20 @@ jobs: rc_issue_url: ${{ steps.export-rc-issue-url.outputs.rc_issue_url }} validate-manual-input: - runs-on: 'ubuntu-20.04' + runs-on: "ubuntu-20.04" if: github.event_name == 'workflow_dispatch' steps: - name: Validate user input if: | - (inputs.rc_testing_branch == '' && inputs.issue_url == '') || - (inputs.rc_testing_branch != '' && inputs.issue_url != '') + (inputs.rc_testing_branch == '' && inputs.issue_url == '') || + (inputs.rc_testing_branch != '' && inputs.issue_url != '') run: | echo "Either rc_testing_branch or issue_url is required, and you cannot give both." exit 1 create-branch-for-testing-rc-release: needs: [validate-manual-input, check-rc-testing-announcement] - runs-on: 'ubuntu-20.04' + runs-on: "ubuntu-20.04" if: | always() && ( @@ -182,6 +188,7 @@ jobs: echo "no_provider_changed=true" >> $GITHUB_OUTPUT else echo "$difference" + echo "no_provider_changed=false" >> $GITHUB_OUTPUT fi - name: Create RC branch @@ -215,6 +222,7 @@ jobs: echo "git_rev=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT outputs: rc_testing_branch: ${{ steps.create_rc_branch.outputs.rc_testing_branch }} + no_provider_changed: ${{ steps.check-repo-provideres-updated.outputs.no_provider_changed }} export-rc-testing-branch-name: needs: [validate-manual-input, create-branch-for-testing-rc-release] @@ -228,7 +236,7 @@ jobs: needs.validate-manual-input.result == 'success' && inputs.rc_testing_branch ) - runs-on: 'ubuntu-20.04' + runs-on: "ubuntu-20.04" steps: - name: export rc_testing_branch id: export-rc-testing-branch-name-step diff --git a/.github/workflows/test-rc-release.yaml b/.github/workflows/test-rc-release.yaml index 4f6536d2b..ac61fc740 100644 --- a/.github/workflows/test-rc-release.yaml +++ b/.github/workflows/test-rc-release.yaml @@ -1,7 +1,7 @@ --- name: Test providers RC releases -on: # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy schedule: - cron: "0 0,12 * * *" workflow_dispatch: @@ -14,17 +14,17 @@ on: # yamllint disable-line rule:truthy rc_testing_branch: existing testing branch (Either rc_testing_branch or issue_url is required, and you cannot give both.) required: false - default: '' + default: "" issue_url: description: | issue_url: the GitHub issue URL that tracks the status of Providers release (Either rc_testing_branch or issue_url is required, and you cannot give both.) required: false base_git_rev: - description: 'The base git revision to test Providers RCs' + description: "The base git revision to test Providers RCs" required: false type: string - default: 'main' + default: "main" jobs: check-airflow-provider-rc-release: @@ -42,11 +42,15 @@ jobs: needs: check-airflow-provider-rc-release if: | always() && - needs.check-airflow-provider-rc-release.outputs.rc_issue_url != '' + ( + needs.check-airflow-provider-rc-release.outputs.rc_issue_url != '' || + inputs.issue_url != '' + ) && + needs.check-airflow-provider-rc-release.outputs.no_provider_changed != 'true' uses: ./.github/workflows/reuse-wf-deploy-to-astro-cloud.yaml with: git_rev: ${{ needs.check-airflow-provider-rc-release.outputs.rc_testing_branch }} - environment_to_deploy: 'providers-integration-tests' + environment_to_deploy: "providers-integration-tests" secrets: docker_registry: ${{ secrets.DOCKER_REGISTRY }} organization_id: ${{ secrets.ORGANIZATION_ID }} @@ -55,7 +59,11 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} wait-for-deployment-to-be-ready-and-trigger-master-dag: - needs: [deploy-rc-testing-branch-to-astro-cloud, check-airflow-provider-rc-release] + needs: + [ + deploy-rc-testing-branch-to-astro-cloud, + check-airflow-provider-rc-release, + ] if: | always() && needs.deploy-rc-testing-branch-to-astro-cloud.result == 'success' @@ -73,11 +81,15 @@ jobs: needs: check-airflow-provider-rc-release if: | always() && - needs.check-airflow-provider-rc-release.outputs.rc_issue_url != '' + ( + needs.check-airflow-provider-rc-release.outputs.rc_issue_url != '' || + inputs.issue_url != '' + ) && + needs.check-airflow-provider-rc-release.outputs.no_provider_changed != 'true' uses: ./.github/workflows/reuse-wf-deploy-to-astro-cloud.yaml with: git_rev: ${{ needs.check-airflow-provider-rc-release.outputs.rc_testing_branch }} - environment_to_deploy: 'providers-integration-tests' + environment_to_deploy: "providers-integration-tests" secrets: docker_registry: ${{ secrets.DOCKER_REGISTRY }} organization_id: ${{ secrets.ORGANIZATION_ID }} @@ -86,7 +98,11 @@ jobs: SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} wait-for-deployment-to-be-ready-and-trigger-master-dag-on-GCP: - needs: [deploy-rc-testing-branch-to-astro-cloud, check-airflow-provider-rc-release] + needs: + [ + deploy-rc-testing-branch-to-astro-cloud, + check-airflow-provider-rc-release, + ] if: | always() && needs.deploy-rc-testing-branch-to-astro-cloud.result == 'success' From bfb477afe9e9903606a9ff9eb59998649f929186 Mon Sep 17 00:00:00 2001 From: Pankaj Koti Date: Fri, 15 Mar 2024 12:14:01 +0530 Subject: [PATCH 9/9] Apply suggestions from code review --- .github/workflows/reuse-wf-check-rc-release.yaml | 2 +- .github/workflows/test-rc-release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reuse-wf-check-rc-release.yaml b/.github/workflows/reuse-wf-check-rc-release.yaml index 1c11e83d1..395bd27de 100644 --- a/.github/workflows/reuse-wf-check-rc-release.yaml +++ b/.github/workflows/reuse-wf-check-rc-release.yaml @@ -1,7 +1,7 @@ --- name: (Reusable workflows) Check airflow provider RC releases and create testing branch -on: # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy workflow_call: inputs: rc_testing_branch: diff --git a/.github/workflows/test-rc-release.yaml b/.github/workflows/test-rc-release.yaml index ac61fc740..fabede516 100644 --- a/.github/workflows/test-rc-release.yaml +++ b/.github/workflows/test-rc-release.yaml @@ -1,7 +1,7 @@ --- name: Test providers RC releases -on: # yamllint disable-line rule:truthy +on: # yamllint disable-line rule:truthy schedule: - cron: "0 0,12 * * *" workflow_dispatch: