Repository navigation
Fixes #30805: restore Slack CI notifications and add one for the Sonar nightly - #30806
Conversation
…htly The E2E "Slack on Failure" step has not delivered a message since March. E2E_SLACK_WEBHOOK holds a bot token rather than the webhook URL from the same OAuth install, so Slack answers 302 to https://api.slack.com/ and the post never lands. Nothing went red: the action's `errors` input defaults to false, so the failure is discarded, and `continue-on-error` hides it again. Under v1.23.0 that 302 was classified non-retryable and failed in ~1s; since #30310 moved the step to v4, @slack/webhook v8 treats a redirect as retryable and burns its five-retry ladder instead, which is the only visible symptom (~300s per lane, seven lanes a night). Move both workflows to chat.postMessage with a bot token scoped for it, and set `errors: true` so a rejected post fails the step visibly rather than silently. The Sonar nightly gains the notification it never had, gated on an actual failure so green nights stay quiet.
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
There was a problem hiding this comment.
Pull request overview
Updates CI Slack failure notifications for Python workflows to use Slack Web API (chat.postMessage) with bot tokens, making Slack API failures visible (while still not failing otherwise-good CI runs due to continue-on-error).
Changes:
- Switch
py-cli-e2e-testsSlack notifications from incoming-webhook tochat.postMessageusing a bot token anderrors: true. - Add a new
notifyjob topy-sonarcloud-nightlythat posts to Slack only when any required job fails.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| .github/workflows/py-sonarcloud-nightly.yml | Adds a failure-gated notify job posting Slack messages via chat.postMessage. |
| .github/workflows/py-cli-e2e-tests.yml | Migrates the existing failure Slack step from incoming webhook to chat.postMessage with errors: true. |
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 |
Review feedback on #30806. Both notification steps hand COLLATE_BOT_SLACK_TOKEN to the action, so a retargeted mutable tag would expose every Slack capability that token carries. Pin to the commit @v4 currently resolves to, matching how this repo already pins github-script, wait-on-check-action, changed-files and free-disk-space. It also buys reproducibility: a moving major tag is what swapped @slack/webhook v7 for v8 under this repo in the first place. The notify job's 5-minute timeout sat exactly on the web client's ~299s retry ceiling, so a Slack outage or rate limit could trip the job timeout and report a timeout instead of the Slack error.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/py-sonarcloud-nightly.yml:238
- The
notifyjob only posts to Slack and does not need a GitHub token. Setting job-levelpermissions: {}applies least-privilege and reduces the blast radius if the Slack action (or its dependencies) were ever compromised.
runs-on: ubuntu-latest
# Above the client's ~299s retry ceiling, so a Slack outage surfaces as the
# Slack error rather than as a job timeout.
timeout-minutes: 10
.github/workflows/py-cli-e2e-tests.yml:340
slackapi/slack-github-actioncan spend ~5 minutes retrying on retryable Slack errors (e.g., 5xx). Adding a step timeout prevents a failed lane from being extended by the full retry ladder during an outage while still keepingcontinue-on-error: truenon-blocking.
- name: Slack on Failure
if: ${{ always() && !cancelled() && env.DEBUG == 'false' && failure() }}
continue-on-error: true
uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
✅ Playwright Results — workflow succeededValidated commit ✅ 548 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 3 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 51m 46s ⏱️ Max setup 2m 45s · max shard execution 18m 12s · max shard-job elapsed before upload 21m 40s · reporting 6s 🌐 200.91 requests/attempt · 2.83 app boots/UI scenario · 3.30% common-shard skew Optimization targets still in progress:
🟡 2 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
🚦 Removed from the merge queue —
|
Code Review ✅ ApprovedRestores broken Slack CI notifications for Python E2E tests and adds a failure-gated alert for the Sonar nightly workflow using bot tokens and chat.postMessage. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
… for the Sonar nightly (open-metadata#30806) * fix(ci): restore Slack CI notifications and add one for the Sonar nightly The E2E "Slack on Failure" step has not delivered a message since March. E2E_SLACK_WEBHOOK holds a bot token rather than the webhook URL from the same OAuth install, so Slack answers 302 to https://api.slack.com/ and the post never lands. Nothing went red: the action's `errors` input defaults to false, so the failure is discarded, and `continue-on-error` hides it again. Under v1.23.0 that 302 was classified non-retryable and failed in ~1s; since open-metadata#30310 moved the step to v4, @slack/webhook v8 treats a redirect as retryable and burns its five-retry ladder instead, which is the only visible symptom (~300s per lane, seven lanes a night). Move both workflows to chat.postMessage with a bot token scoped for it, and set `errors: true` so a rejected post fails the step visibly rather than silently. The Sonar nightly gains the notification it never had, gated on an actual failure so green nights stay quiet. * fix(ci): pin the Slack action to a SHA and widen the notify timeout Review feedback on open-metadata#30806. Both notification steps hand COLLATE_BOT_SLACK_TOKEN to the action, so a retargeted mutable tag would expose every Slack capability that token carries. Pin to the commit @v4 currently resolves to, matching how this repo already pins github-script, wait-on-check-action, changed-files and free-disk-space. It also buys reproducibility: a moving major tag is what swapped @slack/webhook v7 for v8 under this repo in the first place. The notify job's 5-minute timeout sat exactly on the web client's ~299s retry ceiling, so a Slack outage or rate limit could trip the job timeout and report a timeout instead of the Slack error.
Fixes #30805
What
py-cli-e2e-testshas posted no Slack message since 2026-03-25, andpy-sonarcloud-nightlynever had a notification — which is how it failed 109 consecutive nights without anyone noticing.E2E_SLACK_WEBHOOKholds a bot token (xoxb-…) rather than the incoming-webhook URL. Both are returned together by the same OAuth install (access_tokenvsincoming_webhook.url) and the wrong one was stored. Slack answers302 → https://api.slack.com/for that path.Nothing ever went red, because the failure is suppressed twice:
errors: false(the action's default, not set in our YAML)continue-on-error: trueThe only observable symptom was step duration:
@v1.23.0(before #30310)302<500→AbortError, terminal@v4(since 2026-07-24)302fetchwithredirect: 'error'throws → no response object → retryableReproduced locally against
@slack/webhook@8.0.0— the version@v4bundles — with the action's default{retries: 5, factor: 3.86}:200 ok404(revoked webhook)302/5xxMeasured ladder:
+1.0s, +3.9s, +14.9s, +57.5s, +222s ≈ 299s. CI measures 299–300s across all seven failing lanes.So #30310 did not break this — it made a four-month-old breakage slow enough to see.
How
Both workflows move to
chat.postMessagewith a bot token scoped for it, which is the only v4 path already proven working in this repo (security-scanposts in 1s and returns a messagets).errors: trueis the load-bearing part: it converts a rejected post into a visible step failure.continue-on-error: truestays, so a Slack outage still can't red an otherwise-good run.The Sonar nightly gains a
notifyjob gated oncontains(needs.*.result, 'failure')— a daily cron that fires on green nights becomes a channel nobody reads, which is the failure mode that let the original problem hide.Channel
C03EYBDDX17is inlined rather than stored as a secret; channel IDs are not sensitive and one is already committed in plaintext atopenmetadata-ui/src/main/resources/ui/playwright/slack-cli.config.json.Follow-up
playwright-slack-report'ssendUsingBotmode requireschat:write. IfE2E_SLACK_BOT_OAUTH_TOKENholds the sameincoming-webhook-scoped token, the Slack reports inmysql-nightly-e2e,postgresql-nightly-e2eandplaywright-sso-login-nightlyare dead for the same reason. Not addressed here.Greptile Summary
The PR restores failure notifications by switching to bot-token-based Slack messages and pins the Slack action to an immutable v4.0.0 commit.
chat.postMessagewith surfaced Slack API errors.Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains; the previously reported mutable-tag credential exposure is fixed because both changed workflows now reference the Slack action by an immutable v4.0.0 commit SHA.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(ci): pin the Slack action to a SHA a..." | Re-trigger Greptile