From 4ae2f0a07d7058d5b0569ca442ee4ad151b8e917 Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Fri, 29 Nov 2024 00:37:33 +0400 Subject: [PATCH 01/10] feat: log-merge-group-failure --- .github/workflows/main.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f3cc68bebcec..86ab1bd41d56 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,3 +58,16 @@ jobs: if [[ $passed != "true" ]]; then exit 1 fi + + log-merge-group-failure: + name: Log merge group failure + # Only run this job if the merge group event fails, skip logging on forks + if: ${{ github.event_name == 'merge_group' && failure() && github.repository == 'MetaMask/metamask-extension' }} + needs: + - all-jobs-pass + uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@16a5a57ccdd8aedf290874017d58248f4baed49a + secrets: + GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} + GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} + SPREADSHEET_ID: ${{ secrets.MQ_SPREADSHEET_ID }} + SHEET_NAME: ${{ secrets.MQ_SHEET_NAME }} From 48dcefc0836f5f57e1f843dd28e760d27c730b56 Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Fri, 29 Nov 2024 00:38:16 +0400 Subject: [PATCH 02/10] rename --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86ab1bd41d56..530362396f4e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,5 +69,5 @@ jobs: secrets: GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} - SPREADSHEET_ID: ${{ secrets.MQ_SPREADSHEET_ID }} - SHEET_NAME: ${{ secrets.MQ_SHEET_NAME }} + SPREADSHEET_ID: ${{ secrets.MERGE_QUEUE_SPREADSHEET_ID }} + SHEET_NAME: ${{ secrets.MERGE_QUEUE_SHEET_NAME }} From 90646e1a26650c8e3034791e29daaceada930d47 Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Fri, 29 Nov 2024 19:26:00 +0400 Subject: [PATCH 03/10] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 530362396f4e..d9d17e539328 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,5 +69,5 @@ jobs: secrets: GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} - SPREADSHEET_ID: ${{ secrets.MERGE_QUEUE_SPREADSHEET_ID }} - SHEET_NAME: ${{ secrets.MERGE_QUEUE_SHEET_NAME }} + SPREADSHEET_ID: ${{ secrets.GOOGLE_MERGE_QUEUE_SPREADSHEET_ID }} + SHEET_NAME: ${{ secrets.GOOGLE_MERGE_QUEUE_SHEET_NAME }} From 3deebb160a4d55acceb7005148a580cf8f0ffffd Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Fri, 29 Nov 2024 20:44:38 +0400 Subject: [PATCH 04/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d9d17e539328..a89b514e0085 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,7 +62,7 @@ jobs: log-merge-group-failure: name: Log merge group failure # Only run this job if the merge group event fails, skip logging on forks - if: ${{ github.event_name == 'merge_group' && failure() && github.repository == 'MetaMask/metamask-extension' }} + if: ${{ github.event_name == 'merge_group' && failure() && !github.event.repository.fork }} needs: - all-jobs-pass uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@16a5a57ccdd8aedf290874017d58248f4baed49a From 2926a1910dbdfee055c1e823350d78494aad6eaf Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Wed, 4 Dec 2024 23:52:03 +0400 Subject: [PATCH 05/10] feat: circleci --- .github/workflows/main.yml | 5 ++++ .../wait-for-circleci-workflow-status.yml | 30 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/wait-for-circleci-workflow-status.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a89b514e0085..6637fd4b17ec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,12 +32,17 @@ jobs: name: Run tests uses: ./.github/workflows/run-tests.yml + wait-for-circleci-workflow-status: + name: Wait for CircleCI workflow status + uses: ./.github/workflows/wait-for-circleci-workflow-status.yml + all-jobs-completed: name: All jobs completed runs-on: ubuntu-latest needs: - check-workflows - run-tests + - wait-for-circleci-workflow-status outputs: PASSED: ${{ steps.set-output.outputs.PASSED }} steps: diff --git a/.github/workflows/wait-for-circleci-workflow-status.yml b/.github/workflows/wait-for-circleci-workflow-status.yml new file mode 100644 index 000000000000..18e5ef7825d5 --- /dev/null +++ b/.github/workflows/wait-for-circleci-workflow-status.yml @@ -0,0 +1,30 @@ +name: Wait for CircleCI workflow status + +on: + workflow_call: + +jobs: + wait-for-circleci-workflow-status: + name: Wait for CircleCI workflow status + runs-on: ubuntu-latest + steps: + - name: Wait for CircleCI workflow status + env: + OWNER: ${{ github.repository_owner }} + REPOSITORY: ${{ github.event.repository.name }} + BRANCH: ${{ github.head_ref || github.ref_name }} + run: | + pipeline_id=$(curl --silent "https://circleci.com/api/v2/project/gh/$OWNER/$REPOSITORY/pipeline?branch=$BRANCH" | jq -r ".items[0].id") + workflow_status=$(curl --silent "https://circleci.com/api/v2/pipeline/$pipeline_id/workflow" | jq -r ".items[0].status") + + if [ "$workflow_status" == "running" ]; then + while [ "$workflow_status" == "running" ]; do + sleep 30 + workflow_status=$(curl --silent "https://circleci.com/api/v2/pipeline/$pipeline_id/workflow" | jq -r ".items[0].status") + done + fi + + if [ "$workflow_status" != "success" ]; then + echo "::error::Workflow status is '$workflow_status'. Exiting with error." + exit 1 + fi From 64da49e21a99b110ae4627de2675441893e34607 Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:09:47 +0400 Subject: [PATCH 06/10] fix: update commit hash --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 10f6b59e86ed..2aafb9e9e932 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,7 +70,7 @@ jobs: if: ${{ github.event_name == 'merge_group' && failure() && !github.event.repository.fork }} needs: - all-jobs-pass - uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@16a5a57ccdd8aedf290874017d58248f4baed49a + uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@157864e9ccff308a89d670c3e1a47199a3cc2507 secrets: GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }} From 3ae991bc5e597981f7ce9080b46492ba5adfab08 Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:44:28 +0400 Subject: [PATCH 07/10] test --- .github/workflows/main.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2aafb9e9e932..b5af2c393773 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,13 +36,18 @@ jobs: name: Wait for CircleCI workflow status uses: ./.github/workflows/wait-for-circleci-workflow-status.yml + trigger-failure: + name: Trigger failure + runs-on: ubuntu-latest + steps: + - name: Trigger failure + run: exit 1 + all-jobs-completed: name: All jobs completed runs-on: ubuntu-latest needs: - - check-workflows - - run-tests - - wait-for-circleci-workflow-status + - trigger-failure outputs: PASSED: ${{ steps.set-output.outputs.PASSED }} steps: @@ -67,7 +72,7 @@ jobs: log-merge-group-failure: name: Log merge group failure # Only run this job if the merge group event fails, skip logging on forks - if: ${{ github.event_name == 'merge_group' && failure() && !github.event.repository.fork }} + if: ${{ failure() && !github.event.repository.fork }} needs: - all-jobs-pass uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@157864e9ccff308a89d670c3e1a47199a3cc2507 From 89dab09e842940d457311eb10932fa812ac34c9e Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:52:47 +0400 Subject: [PATCH 08/10] Revert "test" This reverts commit 3ae991bc5e597981f7ce9080b46492ba5adfab08. --- .github/workflows/main.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5af2c393773..2aafb9e9e932 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,18 +36,13 @@ jobs: name: Wait for CircleCI workflow status uses: ./.github/workflows/wait-for-circleci-workflow-status.yml - trigger-failure: - name: Trigger failure - runs-on: ubuntu-latest - steps: - - name: Trigger failure - run: exit 1 - all-jobs-completed: name: All jobs completed runs-on: ubuntu-latest needs: - - trigger-failure + - check-workflows + - run-tests + - wait-for-circleci-workflow-status outputs: PASSED: ${{ steps.set-output.outputs.PASSED }} steps: @@ -72,7 +67,7 @@ jobs: log-merge-group-failure: name: Log merge group failure # Only run this job if the merge group event fails, skip logging on forks - if: ${{ failure() && !github.event.repository.fork }} + if: ${{ github.event_name == 'merge_group' && failure() && !github.event.repository.fork }} needs: - all-jobs-pass uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@157864e9ccff308a89d670c3e1a47199a3cc2507 From d4564b7d32f07e4062ebfda9edb9d96027ff5ebf Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Mon, 9 Dec 2024 22:59:34 +0400 Subject: [PATCH 09/10] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2aafb9e9e932..6e449396f3db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -66,7 +66,7 @@ jobs: log-merge-group-failure: name: Log merge group failure - # Only run this job if the merge group event fails, skip logging on forks + # Only run this job if the merge group event fails, skip on forks if: ${{ github.event_name == 'merge_group' && failure() && !github.event.repository.fork }} needs: - all-jobs-pass From 1d9944b0d61161432383d6bcd9639132a699e58d Mon Sep 17 00:00:00 2001 From: Norbert Elter <72046715+itsyoboieltr@users.noreply.github.com> Date: Tue, 10 Dec 2024 23:05:52 +0400 Subject: [PATCH 10/10] feat: update commit hash --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e449396f3db..c7907455701d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -70,7 +70,7 @@ jobs: if: ${{ github.event_name == 'merge_group' && failure() && !github.event.repository.fork }} needs: - all-jobs-pass - uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@157864e9ccff308a89d670c3e1a47199a3cc2507 + uses: metamask/github-tools/.github/workflows/log-merge-group-failure.yml@6bbad335a01fce1a9ec1eabd9515542c225d46c0 secrets: GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}