From f952cc2522a4b72e2a031806e03362dab3efab59 Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Thu, 18 Jun 2020 16:33:13 +0200 Subject: [PATCH 1/7] add polkadot-companion-labels.yml --- .../workflows/polkadot-companion-labels.yml | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/polkadot-companion-labels.yml diff --git a/.github/workflows/polkadot-companion-labels.yml b/.github/workflows/polkadot-companion-labels.yml new file mode 100644 index 0000000000000..40d8ddbe0c601 --- /dev/null +++ b/.github/workflows/polkadot-companion-labels.yml @@ -0,0 +1,32 @@ +name: Check Polkadot Companion and Label + +on: + pull_request: + types: [synchronize] + +jobs: + check_status: + runs-on: ubuntu-latest + steps: + - name: Monitor the status of the gitlab-check-companion-build job + uses: Sibz/await-status-action@v1 + id: 'check-companion-status' + with: + authToken: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.event.pull_request.head.sha }} + contexts: 'continuous-integration/gitlab-check-companion-build' + - name: Label success + uses: andymckay/labeler@master + if: steps.check-companion-status.outputs.result == 'success' + with: + remove-labels: 'A7-needspolkadotpr' + - name: Label failure + uses: andymckay/labeler@master + if: steps.check-companion-status.outputs.result == 'failure' + with: + add-labels: 'A7-needspolkadotpr' + - name: Label timeout + uses: andymckay/labeler@master + if: steps.check-companion-status.outputs.result == 'timeout' + with: + add-labels: 'A7-needspolkadotpr' From 9beca5d2098f1f272a073b39e6ad5dd43869d4bd Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Thu, 18 Jun 2020 16:35:27 +0200 Subject: [PATCH 2/7] fix polkadot companion job name --- .github/workflows/polkadot-companion-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/polkadot-companion-labels.yml b/.github/workflows/polkadot-companion-labels.yml index 40d8ddbe0c601..4247f4b9c036c 100644 --- a/.github/workflows/polkadot-companion-labels.yml +++ b/.github/workflows/polkadot-companion-labels.yml @@ -14,7 +14,7 @@ jobs: with: authToken: ${{ secrets.GITHUB_TOKEN }} ref: ${{ github.event.pull_request.head.sha }} - contexts: 'continuous-integration/gitlab-check-companion-build' + contexts: 'continuous-integration/gitlab-check-polkadot-companion-build' - name: Label success uses: andymckay/labeler@master if: steps.check-companion-status.outputs.result == 'success' From 3fc4e23e6fb1fbc07ef2e0008cfc8995f7373910 Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Thu, 18 Jun 2020 16:41:52 +0200 Subject: [PATCH 3/7] add opened event to polkadot-companion-labels.yml --- .github/workflows/polkadot-companion-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/polkadot-companion-labels.yml b/.github/workflows/polkadot-companion-labels.yml index 4247f4b9c036c..15ad78a0b3f4f 100644 --- a/.github/workflows/polkadot-companion-labels.yml +++ b/.github/workflows/polkadot-companion-labels.yml @@ -2,7 +2,7 @@ name: Check Polkadot Companion and Label on: pull_request: - types: [synchronize] + types: [opened, synchronize] jobs: check_status: From e0f3a744a317c5b1b4334ac09cb9379f1c762a2e Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Thu, 18 Jun 2020 16:46:04 +0200 Subject: [PATCH 4/7] Dont label on timeouts --- .github/workflows/polkadot-companion-labels.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/polkadot-companion-labels.yml b/.github/workflows/polkadot-companion-labels.yml index 15ad78a0b3f4f..a51e572274188 100644 --- a/.github/workflows/polkadot-companion-labels.yml +++ b/.github/workflows/polkadot-companion-labels.yml @@ -25,8 +25,3 @@ jobs: if: steps.check-companion-status.outputs.result == 'failure' with: add-labels: 'A7-needspolkadotpr' - - name: Label timeout - uses: andymckay/labeler@master - if: steps.check-companion-status.outputs.result == 'timeout' - with: - add-labels: 'A7-needspolkadotpr' From a5484f44bc16e629e9332dd57dce2955617cf6cc Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Thu, 18 Jun 2020 16:52:27 +0200 Subject: [PATCH 5/7] increase timeouts --- .github/workflows/polkadot-companion-labels.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/polkadot-companion-labels.yml b/.github/workflows/polkadot-companion-labels.yml index a51e572274188..b7958d536f280 100644 --- a/.github/workflows/polkadot-companion-labels.yml +++ b/.github/workflows/polkadot-companion-labels.yml @@ -15,6 +15,8 @@ jobs: authToken: ${{ secrets.GITHUB_TOKEN }} ref: ${{ github.event.pull_request.head.sha }} contexts: 'continuous-integration/gitlab-check-polkadot-companion-build' + timeout: 1200 + notPresentTimeout: 600 - name: Label success uses: andymckay/labeler@master if: steps.check-companion-status.outputs.result == 'success' From a467df3e75b0d5ae9b39adfeb378e674d49cd670 Mon Sep 17 00:00:00 2001 From: Martin Pugh Date: Thu, 18 Jun 2020 17:05:32 +0200 Subject: [PATCH 6/7] increase timeouts again... to be sure --- .github/workflows/polkadot-companion-labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/polkadot-companion-labels.yml b/.github/workflows/polkadot-companion-labels.yml index b7958d536f280..cdb60afc50bbe 100644 --- a/.github/workflows/polkadot-companion-labels.yml +++ b/.github/workflows/polkadot-companion-labels.yml @@ -15,8 +15,8 @@ jobs: authToken: ${{ secrets.GITHUB_TOKEN }} ref: ${{ github.event.pull_request.head.sha }} contexts: 'continuous-integration/gitlab-check-polkadot-companion-build' - timeout: 1200 - notPresentTimeout: 600 + timeout: 1800 + notPresentTimeout: 3600 # It can take quite a while before the job starts... - name: Label success uses: andymckay/labeler@master if: steps.check-companion-status.outputs.result == 'success' From 679505b7af5ad44b6b92f4fff237b1f093c25820 Mon Sep 17 00:00:00 2001 From: s3krit Date: Thu, 18 Jun 2020 20:07:51 +0200 Subject: [PATCH 7/7] Switch to s3krit/await-status-action Turns out Sibz/await-status-action looks at /ref/statuses, which lists ALL statuses (i.e., if you send a pending and a failure for the same context, it will see both and assume the job is still pending.). I forked and point at /ref/status, which shows a combined summary of each status (i.e., only ever shows the most recent status of a single context). --- .github/workflows/polkadot-companion-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/polkadot-companion-labels.yml b/.github/workflows/polkadot-companion-labels.yml index cdb60afc50bbe..dd00e72d6c489 100644 --- a/.github/workflows/polkadot-companion-labels.yml +++ b/.github/workflows/polkadot-companion-labels.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Monitor the status of the gitlab-check-companion-build job - uses: Sibz/await-status-action@v1 + uses: s3krit/await-status-action@4528ebbdf6e29bbec77c41caad1b2dec148ba894 id: 'check-companion-status' with: authToken: ${{ secrets.GITHUB_TOKEN }}