Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Route OK stable-release notes to their own Slack channel (PRD-7800) (#3209)

Andrew Mikofalvyf19c7c2a58c8
diff --git a/.github/scripts/release-cascade-shape.test.mjs b/.github/scripts/release-cascade-shape.test.mjs
index 39a07375d..1bee36a92 100644
--- a/.github/scripts/release-cascade-shape.test.mjs
+++ b/.github/scripts/release-cascade-shape.test.mjs
@@ -451,3 +451,44 @@ describe('the stable gate does not touch the beta cadence', () => {
expect(warn).not.toContain("if: needs.prepare.outputs.channel == 'latest'");
});
});
+
+describe('release notes and pipeline ops route to independent webhooks', () => {
+ const announce = desktopRelease.slice(
+ desktopRelease.indexOf('- name: Announce stable release to Slack'),
+ desktopRelease.indexOf('- name: Announce stable release to Discord'),
+ );
+
+ test('the announcement prefers the releases webhook, falling back to the shared one', () => {
+ // A Slack incoming webhook is bound to its channel when it is installed
+ // and the payload carries no `channel` field, so this expansion is the
+ // ONLY thing deciding which channel the release notes land in.
+ expect(announce).toContain(
+ 'SLACK_RELEASES_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }}',
+ );
+ expect(announce).toContain(
+ 'WEBHOOK_URL="${SLACK_RELEASES_WEBHOOK_URL:-${SLACK_WEBHOOK_URL:-}}"',
+ );
+ });
+
+ test('the announcement posts to the resolved URL, never straight to the shared secret', () => {
+ // Collapsing this back to "$SLACK_WEBHOOK_URL" is the silent regression:
+ // the step still posts and still exits 0, and the notes quietly reappear
+ // in the ops channel with nothing failing.
+ expect(announce).toContain('--data "$payload" "$WEBHOOK_URL"');
+ expect(announce).not.toContain('--data "$payload" "$SLACK_WEBHOOK_URL"');
+ });
+
+ test('neither secret set still no-ops rather than posting to an empty URL', () => {
+ expect(announce).toContain('if [[ -z "$WEBHOOK_URL" ]]; then');
+ });
+
+ test('the smoke alarm keeps the shared webhook, so moving the notes cannot drag it', () => {
+ // The alarm pages pipeline ops, not release notes; it must keep paging
+ // wherever it pages today even after the notes move channel.
+ const alert = desktopRelease.slice(
+ desktopRelease.indexOf('- name: Alert on a blocked release'),
+ );
+ expect(alert).toContain('post "${SLACK_WEBHOOK_URL:-}" Slack');
+ expect(alert).not.toContain('SLACK_RELEASES_WEBHOOK_URL');
+ });
+});
diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml
index cfd875f4f..d951f4268 100644
--- a/.github/workflows/desktop-release.yml
+++ b/.github/workflows/desktop-release.yml
@@ -1631,21 +1631,29 @@ jobs:
# workflow_dispatch recovery flow so a manual asset re-upload for an
# older tag does not re-announce it.
#
- # The webhook URL lives in the SLACK_WEBHOOK_URL secret on
- # inkeep/open-knowledge. When it is absent (a fork, or before the
- # secret is provisioned) the step no-ops cleanly; a Slack delivery
- # error is downgraded to a ::warning:: — the release is "done" once
- # published, so the announcement is strictly best-effort and must
- # never fail an otherwise-successful release.
+ # A Slack incoming webhook is bound to one channel when it is installed,
+ # and the payload below carries no `channel` field, so the destination is
+ # decided entirely by which webhook URL this step posts to.
+ # SLACK_RELEASES_WEBHOOK_URL puts release notes in their own channel.
+ # SLACK_WEBHOOK_URL is the fallback, and is shared with the smoke alarms
+ # and refusal pages — those are pipeline ops rather than release notes,
+ # so they keep their own destination and must not be moved by rotating
+ # the shared secret. With neither set (a fork, or before either is
+ # provisioned) the step no-ops cleanly; a Slack delivery error is
+ # downgraded to a ::warning:: — the release is "done" once published, so
+ # the announcement is strictly best-effort and must never fail an
+ # otherwise-successful release.
- name: Announce stable release to Slack
if: success() && needs.prepare.outputs.channel == 'latest' && github.event_name != 'workflow_dispatch'
env:
+ SLACK_RELEASES_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
- if [[ -z "${SLACK_WEBHOOK_URL:-}" ]]; then
- echo "::notice::SLACK_WEBHOOK_URL not set — skipping Slack announcement for ${RELEASE_TAG}."
+ WEBHOOK_URL="${SLACK_RELEASES_WEBHOOK_URL:-${SLACK_WEBHOOK_URL:-}}"
+ if [[ -z "$WEBHOOK_URL" ]]; then
+ echo "::notice::No Slack webhook secret set — skipping Slack announcement for ${RELEASE_TAG}."
exit 0
fi
RELEASE_URL="https://github.com/${GITHUB_REPOSITORY}/releases/tag/${RELEASE_TAG}"
@@ -1688,7 +1696,7 @@ jobs:
# The failing curl sits in an `if` condition, which `set -e` does
# not treat as fatal — a Slack outage routes to the else/warning
# and the step still exits 0.
- if curl -sS --fail -X POST -H 'Content-type: application/json' --data "$payload" "$SLACK_WEBHOOK_URL"; then
+ if curl -sS --fail -X POST -H 'Content-type: application/json' --data "$payload" "$WEBHOOK_URL"; then
echo "Posted stable-release announcement for ${RELEASE_TAG} to Slack."
else
echo "::warning::Slack announcement failed for ${RELEASE_TAG} (release is published; notification is best-effort)."