From 8273c11400147560be1cf9856d25e91936509a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Fri, 25 Oct 2024 11:10:32 +0100 Subject: [PATCH 1/5] ci: Quicker missing op notifications --- .github/workflows/missing-ops.yml | 32 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/.github/workflows/missing-ops.yml b/.github/workflows/missing-ops.yml index 5513d47..e6fa0e2 100644 --- a/.github/workflows/missing-ops.yml +++ b/.github/workflows/missing-ops.yml @@ -9,8 +9,8 @@ on: - main workflow_dispatch: {} schedule: - # 08:00 weekly on Monday - - cron: '0 8 * * 1' + # 08:00 daily + - cron: '0 8 * * *' env: CARGO_TERM_COLOR: always @@ -21,6 +21,7 @@ jobs: missing-optypes: name: Check for missing op type definitions runs-on: ubuntu-latest + continue-on-error: true outputs: should_notify: ${{ steps.check_status.outputs.result }} steps: @@ -54,20 +55,15 @@ jobs: result-encoding: string notify-slack: + uses: CQCL/hugrverse-actions/.github/workflows/slack-notifier.yml@ab/slack-notifier needs: missing-optypes - runs-on: ubuntu-latest - if: ${{ needs.missing-optypes.outputs.should_notify == 'true' && github.event_name == 'schedule' }} - steps: - - name: Compose the slack message - id: make_msg - run: | - MSG="msg=`tket-json-rs` is missing OpType definitions. See the failing check for more info.\nhttps://github.com/CQCL/tket-json-rs/actions/workflows/missing-ops.yml" - echo $MSG - echo $MSG >> "$GITHUB_OUTPUT" - - name: Send notification - uses: slackapi/slack-github-action@v1.27.0 - with: - channel-id: 'C040CRWH9FF' - slack-message: ${{ steps.make_msg.outputs.msg }} - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + if: ${{ needs.missing-optypes.outputs.should_notify == 'true' }} + with: + channel-id: 'C04SHCL4FKP' + slack-message: '`tket-json-rs` is missing OpType definitions. See the failing check for more info.\nhttps://github.com/CQCL/tket-json-rs/actions/workflows/missing-ops.yml' + # An unique identifier for the message type, to use in rate limiting. + message-label: "missing-op" + # Rate-limit the message to once per week + timeout-minutes: 10080 + secrets: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file From dc1cd5832cbbd00decafd56bec2b17e17ece69c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Fri, 25 Oct 2024 11:41:35 +0100 Subject: [PATCH 2/5] Fail check on error, format message --- .github/workflows/missing-ops.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/missing-ops.yml b/.github/workflows/missing-ops.yml index e6fa0e2..e66a65d 100644 --- a/.github/workflows/missing-ops.yml +++ b/.github/workflows/missing-ops.yml @@ -60,7 +60,9 @@ jobs: if: ${{ needs.missing-optypes.outputs.should_notify == 'true' }} with: channel-id: 'C04SHCL4FKP' - slack-message: '`tket-json-rs` is missing OpType definitions. See the failing check for more info.\nhttps://github.com/CQCL/tket-json-rs/actions/workflows/missing-ops.yml' + slack-message: | + `tket-json-rs` is missing OpType definitions. + See for more info. # An unique identifier for the message type, to use in rate limiting. message-label: "missing-op" # Rate-limit the message to once per week From 4a5cc8a139f2902ef8f5fb85c09feaee31f76029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Fri, 25 Oct 2024 15:08:53 +0100 Subject: [PATCH 3/5] Update workflow call --- .github/workflows/missing-ops.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/missing-ops.yml b/.github/workflows/missing-ops.yml index e66a65d..71150f9 100644 --- a/.github/workflows/missing-ops.yml +++ b/.github/workflows/missing-ops.yml @@ -57,15 +57,16 @@ jobs: notify-slack: uses: CQCL/hugrverse-actions/.github/workflows/slack-notifier.yml@ab/slack-notifier needs: missing-optypes - if: ${{ needs.missing-optypes.outputs.should_notify == 'true' }} + if: ${{ needs.missing-optypes.outputs.should_notify == 'true' && ( github.event_name == 'schedule' || github.event_name == 'push' ) }} with: - channel-id: 'C04SHCL4FKP' + channel-id: 'C040CRWH9FF' slack-message: | `tket-json-rs` is missing OpType definitions. See for more info. - # An unique identifier for the message type, to use in rate limiting. - message-label: "missing-op" # Rate-limit the message to once per week timeout-minutes: 10080 + # A repository variable used to store the last message timestamp. + timeout-variable: "MISSING_OPS_MSG_SENT" secrets: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} \ No newline at end of file + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + GITHUB_PAT: ${{ secrets.HUGRBOT_PAT }} \ No newline at end of file From a895c2d04b1f250e52bbfba2249e8a2dd6ce01a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Fri, 25 Oct 2024 16:27:01 +0100 Subject: [PATCH 4/5] =?UTF-8?q?=E2=9A=A0=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/missing-ops.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/missing-ops.yml b/.github/workflows/missing-ops.yml index 71150f9..41fef3b 100644 --- a/.github/workflows/missing-ops.yml +++ b/.github/workflows/missing-ops.yml @@ -61,7 +61,7 @@ jobs: with: channel-id: 'C040CRWH9FF' slack-message: | - `tket-json-rs` is missing OpType definitions. + ⚠️ `tket-json-rs` is missing OpType definitions. See for more info. # Rate-limit the message to once per week timeout-minutes: 10080 From e5c07949fbcf4a66a4d1d0c6b4ba11e6707c172e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= Date: Fri, 25 Oct 2024 16:51:34 +0100 Subject: [PATCH 5/5] Use published workflow --- .github/workflows/missing-ops.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/missing-ops.yml b/.github/workflows/missing-ops.yml index 41fef3b..4ce426f 100644 --- a/.github/workflows/missing-ops.yml +++ b/.github/workflows/missing-ops.yml @@ -55,7 +55,7 @@ jobs: result-encoding: string notify-slack: - uses: CQCL/hugrverse-actions/.github/workflows/slack-notifier.yml@ab/slack-notifier + uses: CQCL/hugrverse-actions/.github/workflows/slack-notifier.yml@main needs: missing-optypes if: ${{ needs.missing-optypes.outputs.should_notify == 'true' && ( github.event_name == 'schedule' || github.event_name == 'push' ) }} with: