Skip to content

Fixes #30805: restore Slack CI notifications and add one for the Sonar nightly - #30806

Merged
IceS2 merged 2 commits into
mainfrom
ci/slack-bot-notifications
Aug 2, 2026
Merged

IceS2 merged 2 commits into
mainfrom
ci/slack-bot-notifications

Conversation

@IceS2

@IceS2 IceS2 commented Aug 1, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #30805

What

py-cli-e2e-tests has posted no Slack message since 2026-03-25, and py-sonarcloud-nightly never had a notification — which is how it failed 109 consecutive nights without anyone noticing.

E2E_SLACK_WEBHOOK holds a bot token (xoxb-…) rather than the incoming-webhook URL. Both are returned together by the same OAuth install (access_token vs incoming_webhook.url) and the wrong one was stored. Slack answers 302 → https://api.slack.com/ for that path.

Nothing ever went red, because the failure is suppressed twice:

Suppressor Effect
errors: false (the action's default, not set in our YAML) Slack API errors are discarded; the step exits 0
continue-on-error: true Any step failure is hidden from the job

The only observable symptom was step duration:

Action version Slack response Classification Duration
@v1.23.0 (before #30310) 302 axios: <500 → AbortError, terminal ~1s
@v4 (since 2026-07-24) 302 fetch with redirect: 'error' throws → no response object → retryable ~300s

Reproduced locally against @slack/webhook@8.0.0 — the version @v4 bundles — with the action's default {retries: 5, factor: 3.86}:

Response Attempts Elapsed
200 ok 1 0.1s
404 (revoked webhook) 1 0.0s
302 / 5xx 6 ~299s

Measured 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.postMessage with a bot token scoped for it, which is the only v4 path already proven working in this repo (security-scan posts in 1s and returns a message ts).

errors: true is the load-bearing part: it converts a rejected post into a visible step failure. continue-on-error: true stays, so a Slack outage still can't red an otherwise-good run.

The Sonar nightly gains a notify job gated on contains(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 C03EYBDDX17 is inlined rather than stored as a secret; channel IDs are not sensitive and one is already committed in plaintext at openmetadata-ui/src/main/resources/ui/playwright/slack-cli.config.json.

Follow-up

playwright-slack-report's sendUsingBot mode requires chat:write. If E2E_SLACK_BOT_OAUTH_TOKEN holds the same incoming-webhook-scoped token, the Slack reports in mysql-nightly-e2e, postgresql-nightly-e2e and playwright-sso-login-nightly are 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.

  • Updates Python CLI E2E failure notifications to use chat.postMessage with surfaced Slack API errors.
  • Adds failure-only notifications for the nightly SonarCloud workflow.
  • Replaces the previously reported mutable action references with a reviewed commit SHA.

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

Filename Overview
.github/workflows/py-cli-e2e-tests.yml Replaces the broken incoming webhook call with a bot-token Slack API call and pins the action to an immutable revision.
.github/workflows/py-sonarcloud-nightly.yml Adds a failure-gated Slack notification job using the pinned action revision and explicit API error reporting.

Reviews (2): Last reviewed commit: "fix(ci): pin the Slack action to a SHA a..." | Re-trigger Greptile

…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.
@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Aug 1, 2026
@IceS2
IceS2 marked this pull request as ready for review August 1, 2026 16:24
@IceS2
IceS2 requested a review from akash-jain-10 as a code owner August 1, 2026 16:24
Copilot AI review requested due to automatic review settings August 1, 2026 16:24
@IceS2
IceS2 requested review from a team, harshach and tutte as code owners August 1, 2026 16:24
@github-actions

github-actions Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-tests Slack notifications from incoming-webhook to chat.postMessage using a bot token and errors: true.
  • Add a new notify job to py-sonarcloud-nightly that 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.

Comment on lines +235 to +236
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.
Copilot AI review requested due to automatic review settings August 1, 2026 16:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 notify job only posts to Slack and does not need a GitHub token. Setting job-level permissions: {} 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-action can 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 keeping continue-on-error: true non-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

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit 6d2781308f1aeb05cb0aee2d881c11f8d6f7db4d in Playwright run 30708358787, attempt 1.

✅ 548 passed · ❌ 0 failed · 🟡 2 flaky · ⏭️ 3 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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:

  • Browser traffic was 200.91 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.83 per UI scenario (1622 boots / 573 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
🟡 Shard chromium-01 142 0 1 3 0 0
✅ Shard chromium-02 133 0 0 0 0 0
✅ Shard chromium-03 123 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 34 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
🟡 Shard search-rbac-01 28 0 1 0 0 0
🟡 2 flaky test(s) (passed on retry)
  • Pages/Entity.spec.ts › Announcement create, edit & delete (shard chromium-01, 1 retry)
  • Flow/SearchRBAC.spec.ts › User with permission (shard search-rbac-01, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@IceS2
IceS2 added this pull request to the merge queue Aug 1, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 2, 2026
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-08-02T06:54:45Z)

These checks failed on merge-queue commit a76fc5d:

@IceS2
IceS2 added this pull request to the merge queue Aug 2, 2026
Merged via the queue into main with commit b7184b5 Aug 2, 2026
79 checks passed
@IceS2
IceS2 deleted the ci/slack-bot-notifications branch August 2, 2026 11:06
@gitar-bot

gitar-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Restores 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.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source

k-anshul pushed a commit to k-anshul/OpenMetadata that referenced this pull request Aug 12, 2026
… 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.

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI Slack failure notifications have not delivered since March

3 participants