From 37f2b557b650cf5086bcc0faa3c0409b1c7bf425 Mon Sep 17 00:00:00 2001 From: ydshieh Date: Fri, 13 May 2022 17:54:10 +0200 Subject: [PATCH] fix push CI channel --- .github/workflows/self-push.yml | 1 + .github/workflows/self-scheduled.yml | 1 + utils/notification_service.py | 8 ++++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/self-push.yml b/.github/workflows/self-push.yml index 3321fcb6b2b5bf..544550fe63607a 100644 --- a/.github/workflows/self-push.yml +++ b/.github/workflows/self-push.yml @@ -311,6 +311,7 @@ jobs: CI_SLACK_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID }} CI_SLACK_CHANNEL_ID_DAILY: ${{ secrets.CI_SLACK_CHANNEL_ID_DAILY }} CI_SLACK_CHANNEL_DUMMY_TESTS: ${{ secrets.CI_SLACK_CHANNEL_DUMMY_TESTS }} + CI_SLACK_REPORT_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID }} CI_EVENT: push # We pass `needs.setup.outputs.matrix` as the argument. A processing in `notification_service.py` to change # `models/bert` to `models_bert` is required, as the artifact names use `_` instead of `/`. diff --git a/.github/workflows/self-scheduled.yml b/.github/workflows/self-scheduled.yml index 62469f8e83331d..d091028aa2ff53 100644 --- a/.github/workflows/self-scheduled.yml +++ b/.github/workflows/self-scheduled.yml @@ -353,6 +353,7 @@ jobs: CI_SLACK_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID }} CI_SLACK_CHANNEL_ID_DAILY: ${{ secrets.CI_SLACK_CHANNEL_ID_DAILY }} CI_SLACK_CHANNEL_DUMMY_TESTS: ${{ secrets.CI_SLACK_CHANNEL_DUMMY_TESTS }} + CI_SLACK_REPORT_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID_DAILY }} CI_EVENT: scheduled # We pass `needs.setup.outputs.matrix` as the argument. A processing in `notification_service.py` to change # `models/bert` to `models_bert` is required, as the artifact names use `_` instead of `/`. diff --git a/utils/notification_service.py b/utils/notification_service.py index 628cc76048071f..2c06f24532dc7b 100644 --- a/utils/notification_service.py +++ b/utils/notification_service.py @@ -381,7 +381,7 @@ def error_out(): print(json.dumps({"blocks": json.loads(payload)})) client.chat_postMessage( - channel=os.environ["CI_SLACK_CHANNEL_ID_DAILY"], + channel=os.environ["CI_SLACK_REPORT_CHANNEL_ID"], text="There was an issue running the tests.", blocks=payload, ) @@ -393,7 +393,7 @@ def post(self): text = f"{self.n_failures} failures out of {self.n_tests} tests," if self.n_failures else "All tests passed." self.thread_ts = client.chat_postMessage( - channel=os.environ["CI_SLACK_CHANNEL_ID_DAILY"], + channel=os.environ["CI_SLACK_REPORT_CHANNEL_ID"], blocks=self.payload, text=text, ) @@ -439,7 +439,7 @@ def post_reply(self): print(json.dumps({"blocks": blocks})) client.chat_postMessage( - channel=os.environ["CI_SLACK_CHANNEL_ID_DAILY"], + channel=os.environ["CI_SLACK_REPORT_CHANNEL_ID"], text=f"Results for {job}", blocks=blocks, thread_ts=self.thread_ts["ts"], @@ -462,7 +462,7 @@ def post_reply(self): print(json.dumps({"blocks": blocks})) client.chat_postMessage( - channel=os.environ["CI_SLACK_CHANNEL_ID_DAILY"], + channel=os.environ["CI_SLACK_REPORT_CHANNEL_ID"], text=f"Results for {job}", blocks=blocks, thread_ts=self.thread_ts["ts"],