From 4f3a301430f20c6c5ae7afd872b77732c8479c72 Mon Sep 17 00:00:00 2001 From: Omkar Khatavkar Date: Fri, 22 Sep 2023 16:38:54 +0530 Subject: [PATCH 1/3] fixed the diff between gha robottelo and airgun (#949) (cherry picked from commit 15b50fb854034f7d33b8ff040a4534ea53e04756) --- .github/workflows/auto_cherry_pick.yml | 6 +++--- .../{automerge.yaml => auto_cherry_pick_merge.yaml} | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{automerge.yaml => auto_cherry_pick_merge.yaml} (100%) diff --git a/.github/workflows/auto_cherry_pick.yml b/.github/workflows/auto_cherry_pick.yml index d51092401..af5cbb3c5 100644 --- a/.github/workflows/auto_cherry_pick.yml +++ b/.github/workflows/auto_cherry_pick.yml @@ -3,8 +3,7 @@ name: auto_cherry_pick_commits on: pull_request_target: - types: - - closed + types: [closed] # Github & Parent PR Env vars env: @@ -27,6 +26,7 @@ jobs: with: issue-number: ${{ env.number }} body-includes: "trigger: test-robottelo" + direction: last # Auto CherryPicking and Failure Recording auto-cherry-pick: @@ -84,7 +84,7 @@ jobs: ## Failure Logging to issues and GChat Group - name: Create Github issue on cherrypick failure id: create-issue - if: ${{ always() && steps.cherrypick.outcome == 'failure' }} + if: ${{ always() && steps.cherrypick.outcome != 'success' && startsWith(matrix.label, '6.') && matrix.label != github.base_ref }} uses: dacbd/create-issue-action@main with: token: ${{ secrets.CHERRYPICK_PAT }} diff --git a/.github/workflows/automerge.yaml b/.github/workflows/auto_cherry_pick_merge.yaml similarity index 100% rename from .github/workflows/automerge.yaml rename to .github/workflows/auto_cherry_pick_merge.yaml From 6b8eb715707e2b4e7b96400f5eb560ddeebcfdb0 Mon Sep 17 00:00:00 2001 From: Omkar Khatavkar Date: Thu, 4 Jan 2024 10:45:31 +0530 Subject: [PATCH 2/3] fixing the auto-merge PR's in Airgun (#1113) (cherry picked from commit a426b7e938ab5de6dfde7048418cbde9bd2cf9cc) --- .github/workflows/auto_cherry_pick_merge.yaml | 68 ++++--------------- 1 file changed, 15 insertions(+), 53 deletions(-) diff --git a/.github/workflows/auto_cherry_pick_merge.yaml b/.github/workflows/auto_cherry_pick_merge.yaml index 0e51739ee..0f0e9e33b 100644 --- a/.github/workflows/auto_cherry_pick_merge.yaml +++ b/.github/workflows/auto_cherry_pick_merge.yaml @@ -8,11 +8,6 @@ on: - ready_for_review branches-ignore: - master - pull_request_review: - types: - - submitted - branches-ignore: - - master check_suite: types: - completed @@ -45,7 +40,7 @@ jobs: - name: Wait for other status checks to Pass id: waitforstatuschecks - uses: lewagon/wait-on-check-action@v1.2.0 + uses: lewagon/wait-on-check-action@v1.3.3 with: ref: ${{ github.head_ref }} repo-token: ${{ secrets.CHERRYPICK_PAT }} @@ -53,65 +48,32 @@ jobs: running-workflow-name: 'Automerge auto-cherry-picked pr' allowed-conclusions: success,skipped - - name: is PRT check Passed ? - run: | - api_endpoint="https://api.github.com/repos/${{github.repository}}/statuses/${{ github.head_ref }}" - - function get_status() { - curl -s "$api_endpoint" | jq '[.[] | .state] | .[0]' - } - - function get_context() { - curl -s "$api_endpoint" | jq '[.[] | .context] | .[0]' - } - - statuses_length=$(curl -s $api_endpoint | jq 'length') - if [ $statuses_length -eq 0 ]; then - echo "PRT failed to start ! Stopping." - exit 1 - fi - - status=$(get_status) - context=$(get_context) - - if [ "$context" != "Robottelo-Runner" ]; then - echo "::error Failed to get Robottelo-Runner status" - exit 1 - fi - - counter=0 - echo "Waiting for PRT to complete....." - while [ "$status" != "success" ] && [ "$status" != "failure" ]; do - if [ $counter -gt 20 ]; then - echo "PRT Timeout" - exit 1 - fi - sleep 300 - status=$(get_status) - echo "Robottelo-Runner : $status" - counter=$((counter+1)) - done + - name: Fetch the PRT status + id: outcome + uses: omkarkhatavkar/wait-for-status-checks@main + with: + ref: ${{ github.head_ref }} + context: 'Robottelo-Runner' + wait-interval: 60 + count: 100 - if [ "$status" == "success" ]; then - echo "PRT Passed Successfully!" + - name: Check the PRT status + run: | + if [ ${{ steps.outcome.outputs.result }} == 'success' ]; then + echo "Status check passed!" else - echo "Robottelo-Runner : $status" - echo "::error PRT failed" - exit 1 + echo "Status check failed!" fi - - id: automerge name: Auto merge of cherry-picked PRs. - uses: "pascalgn/automerge-action@v0.15.5" - if: steps.waitforstatuschecks.outputs.status == 'success' + uses: "pascalgn/automerge-action@v0.15.6" env: GITHUB_TOKEN: "${{ secrets.CHERRYPICK_PAT }}" MERGE_LABELS: "AutoMerge_Cherry_Picked, Auto_Cherry_Picked" MERGE_METHOD: "squash" MERGE_RETRIES: 5 MERGE_RETRY_SLEEP: 900000 - BASE_BRANCHES: "master" # avoid automerge branch - name: Auto Merge Status run: | From 5401094dbfdfae2ce0b64a3bf690bee1e9da3011 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:51:14 +0000 Subject: [PATCH 3/3] Bump pascalgn/automerge-action from 0.15.6 to 0.16.2 Bumps [pascalgn/automerge-action](https://github.com/pascalgn/automerge-action) from 0.15.6 to 0.16.2. - [Release notes](https://github.com/pascalgn/automerge-action/releases) - [Commits](https://github.com/pascalgn/automerge-action/compare/v0.15.6...v0.16.2) --- updated-dependencies: - dependency-name: pascalgn/automerge-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] (cherry picked from commit 318a029b29a583d291569bfde11223344194fe8d) --- .github/workflows/auto_cherry_pick_merge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto_cherry_pick_merge.yaml b/.github/workflows/auto_cherry_pick_merge.yaml index 0f0e9e33b..e0cb8e481 100644 --- a/.github/workflows/auto_cherry_pick_merge.yaml +++ b/.github/workflows/auto_cherry_pick_merge.yaml @@ -67,7 +67,7 @@ jobs: - id: automerge name: Auto merge of cherry-picked PRs. - uses: "pascalgn/automerge-action@v0.15.6" + uses: "pascalgn/automerge-action@v0.16.2" env: GITHUB_TOKEN: "${{ secrets.CHERRYPICK_PAT }}" MERGE_LABELS: "AutoMerge_Cherry_Picked, Auto_Cherry_Picked"