Skip to content

Commit 08e7404

Browse files
committed
Update to use slack
1 parent 1cad302 commit 08e7404

File tree

4 files changed

+926
-784
lines changed

4 files changed

+926
-784
lines changed

airbyte-ci/connectors/metadata_service/orchestrator/orchestrator/assets/connector_test_report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def generate_nightly_report(context: OpExecutionContext) -> Output[pd.DataFrame]
145145
nightly_report_complete_md = render_connector_nightly_report_md(nightly_report_connector_matrix_df, nightly_report_complete_df)
146146
slack_webhook_url = os.getenv("NIGHTLY_REPORT_SLACK_WEBHOOK_URL")
147147
if slack_webhook_url:
148-
send_slack_webhook(slack_webhook_url, nightly_report_complete_md)
148+
send_slack_webhook(slack_webhook_url, nightly_report_complete_md, wrap_in_code_block=True)
149149

150150
return Output(
151151
nightly_report_connector_matrix_df,

airbyte-ci/connectors/metadata_service/orchestrator/orchestrator/logging/publish_connector_lifecycle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,5 @@ def log(context: OpExecutionContext, lifecycle_stage: PublishConnectorLifecycleS
6363

6464
slack_webhook_url = os.getenv("PUBLISH_UPDATE_SLACK_WEBHOOK_URL")
6565
if slack_webhook_url:
66-
send_slack_webhook(slack_webhook_url, message)
66+
slack_message = f"🤖 {message}"
67+
send_slack_webhook(slack_webhook_url, slack_message)

airbyte-ci/connectors/metadata_service/orchestrator/orchestrator/ops/slack.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from dagster import op
21
from slack_sdk import WebhookClient
32

43

@@ -13,9 +12,10 @@ def chunk_messages(report):
1312
yield msg
1413

1514

16-
@op
17-
def send_slack_webhook(webhook_url, report):
15+
def send_slack_webhook(webhook_url, report, wrap_in_code_block=False):
1816
webhook = WebhookClient(webhook_url)
1917
for msg in chunk_messages(report):
2018
# Wrap in code block as slack does not support markdown in webhooks
21-
webhook.send(text=f"```{msg}```")
19+
if wrap_in_code_block:
20+
msg = f"```{msg}```"
21+
webhook.send(msg)

0 commit comments

Comments
 (0)