Skip to content

Restored rich Slack notification for release failures#28131

Merged
rob-ghost merged 1 commit into
mainfrom
fix/restore-release-failure-slack-notification
May 26, 2026
Merged

Restored rich Slack notification for release failures#28131
rob-ghost merged 1 commit into
mainfrom
fix/restore-release-failure-slack-notification

Conversation

@rob-ghost
Copy link
Copy Markdown
Contributor

@rob-ghost rob-ghost commented May 26, 2026

Why

When the release flow lived in Ghost-Release, a failed release sent an on-call-paging Slack alert via the notify-release-failure grunt task. After the flow moved into Ghost, release.yml and ci.yml fell back to the generic slack-build "Test failure" message — which doesn't page @on-call-product.

A release now spans two workflows: release.yml (prepare + push the tag) and the tag-triggered ci.yml run (build → npm publish → GitHub Release). Every stage should page on failure. This PR restores that, posting to the existing RELEASE_NOTIFICATION_URL secret (already used for the "is loose!" success message), so no new secret is needed.

The message

Both stages send the same message — title, on-call page, and a link to the failed run so someone can check what broke:

🚨 Ghost release failed
@on-call-product — check the failed run: view run

It deliberately doesn't try to describe what failed; the run link is the source of truth.

What changed

release.yml — replaces the generic slack-build failure step with the message above, on a failed prepare/tag run.

ci.yml — adds a single terminal notify_release_failure job that needs the whole publish chain (job_setupjob_build_artifactsjob_ghost-clipublish_ghostcreate_github_release) and fires on failure() with the same message.

Why a terminal job rather than per-job if: failure() steps: a step only runs if its job runs. When an upstream job fails (e.g. job_build_artifacts, which builds the npm tarball), publish_ghost is skipped, so a per-job failure step there never fires — the release silently fails to publish with no alert. failure() on a job that needs the whole chain is true if any job in it fails, so it catches the skipped cases too. This also replaces (and de-duplicates) the per-job slack-build steps.

ci.yml create_github_release — gates the existing "is loose!" success announcement on the release step (steps.create_release.outcome) rather than the notes step, so a failed gh release create can no longer announce a false success.

Failure coverage

Stage Workflow / job Alert
Prepare + push tag release.yml 🚨 Ghost release failed + run link
Build artifacts / Ghost-CLI / npm publish / GitHub Release ci.yml publish chain → notify_release_failure 🚨 Ghost release failed + run link

Notes for reviewers

  • username: "Ghost CI" — the original used "Jenkins" (a relic). Switched to "Ghost CI" to match the workflow's own git identity.
  • Defaults are Ghost.org-specific — by design, not a leak. The on-call-product subteam mention is a hardcoded default, not a secret. The only privacy boundary is the webhook (RELEASE_NOTIFICATION_URL, already a secret): a fork points it at its own channel and gets its own alerts, while an unknown <!subteam^…> simply renders inert elsewhere.
  • Forksnotify_release_failure is guarded to github.repository == 'TryGhost/Ghost', and RELEASE_NOTIFICATION_URL isn't exposed to fork PRs, so the alerts only fire on real release runs in the canonical repo.
  • The same message lives inline in both workflows. If a single source of truth is preferred, it could move to a small local composite action — happy to do that as a follow-up.

refs #26760

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ce3d6c6d-26d4-4728-845a-6168d06842b7

📥 Commits

Reviewing files that changed from the base of the PR and between 155946b and 56ae4d2.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml

Walkthrough

The PR replaces the legacy Slack action with a custom curl/jq-based notifier that posts to RELEASE_NOTIFICATION_URL and treats posting errors as non-fatal. It adds a publish_ghost failure step to alert on npm publish failures, refactors GitHub release creation into an explicit create_release step, gates the success notification on that step's outcome, and adds a release-creation failure notification step that posts the same formatted Slack payload.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Restored rich Slack notification for release failures' clearly and concisely summarizes the main change: restoring enhanced Slack notifications for release failures, which aligns with the core purpose of the changeset.
Description check ✅ Passed The description is comprehensive and directly related to the changeset, providing clear context on why the changes were needed, what was changed, and implementation details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/restore-release-failure-slack-notification

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rob-ghost rob-ghost force-pushed the fix/restore-release-failure-slack-notification branch from 812e2f0 to 3c11598 Compare May 26, 2026 14:15
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented May 26, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 155946b

Command Status Duration Result
nx run ghost:test:ci:integration ✅ Succeeded 1m 59s View ↗
nx run @tryghost/admin-x-settings:test:acceptance ✅ Succeeded 9m 14s View ↗
nx run ghost:test:ci:e2e ✅ Succeeded 7m 35s View ↗
nx run ghost:test:ci:legacy ✅ Succeeded 3m 10s View ↗
nx build @tryghost/sodo-search ✅ Succeeded <1s View ↗
nx build @tryghost/signup-form ✅ Succeeded <1s View ↗
nx build @tryghost/comments-ui ✅ Succeeded <1s View ↗
nx build @tryghost/portal ✅ Succeeded <1s View ↗
Additional runs (12) ✅ Succeeded ... View ↗

☁️ Nx Cloud last updated this comment at 2026-05-26 15:01:33 UTC

@rob-ghost rob-ghost marked this pull request as draft May 26, 2026 14:24
@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.87%. Comparing base (5980dbc) to head (56ae4d2).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #28131   +/-   ##
=======================================
  Coverage   73.87%   73.87%           
=======================================
  Files        1529     1529           
  Lines      129757   129757           
  Branches    15567    15569    +2     
=======================================
+ Hits        95854    95859    +5     
+ Misses      32941    32912   -29     
- Partials      962      986   +24     
Flag Coverage Δ
e2e-tests 76.17% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rob-ghost rob-ghost force-pushed the fix/restore-release-failure-slack-notification branch 2 times, most recently from c6713b7 to 155946b Compare May 26, 2026 14:41
@rob-ghost rob-ghost marked this pull request as ready for review May 26, 2026 14:43
Comment thread .github/workflows/ci.yml Fixed
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 1916-1919: The "Notify release failure" job lacks an explicit
permissions block and is inheriting GITHUB_TOKEN scopes; add a minimal
permissions declaration to remove token access by adding permissions: none (or
permissions: { contents: none } if you prefer explicit) under the "Notify
release failure" job definition so the job that only posts to Slack doesn't
receive repository token privileges.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2904b8a4-c6ec-4668-b3fd-a39cf20a62f3

📥 Commits

Reviewing files that changed from the base of the PR and between 3c11598 and 155946b.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml

Comment thread .github/workflows/ci.yml
When the release flow lived in Ghost-Release it sent an on-call Slack
alert on failure (grunt notify-release-failure). After the flow moved
into Ghost, release.yml and ci.yml fell back to the generic slack-build
"Test failure" message, which doesn't page on-call.

Restores an on-call alert at every stage of a release, posting to the
existing RELEASE_NOTIFICATION_URL secret. Both stages send the same
message — "🚨 Ghost release failed", an @on-call-product page, and a link
to the failed run:

- release.yml: on a failed prepare/tag run.

- ci.yml: a terminal notify_release_failure job that needs the whole
  publish chain (job_setup -> job_build_artifacts -> job_ghost-cli ->
  publish_ghost -> create_github_release) and fires on any failure within
  it. A single aggregator job catches jobs skipped by an upstream failure
  (e.g. a build failure skips publish_ghost entirely), which a per-job
  `if: failure()` step cannot. Replaces the per-job slack-build steps.

Also gates the create_github_release "is loose!" announcement on the
release step itself, so a failed GitHub Release can no longer announce a
false success.

refs #26760
@rob-ghost rob-ghost force-pushed the fix/restore-release-failure-slack-notification branch from 155946b to 56ae4d2 Compare May 26, 2026 14:48
@rob-ghost rob-ghost enabled auto-merge (rebase) May 26, 2026 21:36
@rob-ghost rob-ghost merged commit 37318f6 into main May 26, 2026
98 of 100 checks passed
@rob-ghost rob-ghost deleted the fix/restore-release-failure-slack-notification branch May 26, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants