Skip to content

Add webhook alerting to Release Health Monitor (org:release-failure-alerting)#19

Open
kayodebristol wants to merge 2 commits into
mainfrom
feat/release-health-alerting-webhook
Open

Add webhook alerting to Release Health Monitor (org:release-failure-alerting)#19
kayodebristol wants to merge 2 commits into
mainfrom
feat/release-health-alerting-webhook

Conversation

@kayodebristol

Copy link
Copy Markdown
Contributor

Gap closed

Release-health-monitor.yml already detects failures/staleness daily and updates a tracking issue (#18), but nothing actively alerts anyone -- the issue is silently re-edited in place with no notification, which is how a repo can stay broken for months unnoticed.

This PR adds an explicit notification step:

  • New 'Alert webhook on tripwire' step posts a Slack/Teams-compatible JSON payload to \secrets.RELEASE_HEALTH_WEBHOOK_URL\ whenever \stale_count != 0 || failed_count != 0.
  • Non-fatal no-op if the secret isn't configured, so no regression for orgs/forks that haven't set it up yet.
  • See design rationale in \docs/adr/ADR-0001-release-health-alerting.md\ (alternatives considered, why daily-repeat alerting over transition-only, why webhook over email/assignee-notifications).

Follow-up (not in scope here)

  • Configure the \RELEASE_HEALTH_WEBHOOK_URL\ org/repo secret (admin action, out of band).
  • Possible future: per-repo routing, escalation after N consecutive unhealthy days.

Relates to issue #18 (currently 4 FAILED + 20 STALE) and epic org:release-failure-alerting.

…ailure-alerting)

Detection (release-health-monitor.yml) already scans daily and reports
into a single tracking issue (#18), but nothing actively notifies anyone
when it fires -- the issue is silently re-edited in place. Add:

- docs/adr/ADR-0001-release-health-alerting.md: design decision for closing
  the detection-vs-alerting gap via a webhook notification.
- New 'Alert webhook on tripwire' step: POSTs a Slack/Teams-compatible
  JSON payload to secrets.RELEASE_HEALTH_WEBHOOK_URL whenever
  stale_count != 0 or failed_count != 0. No-op (non-fatal) if the secret
  isn't configured yet, so this doesn't regress existing behavior.

Closes the alerting gap in org:release-failure-alerting.
Copilot AI review requested due to automatic review settings July 24, 2026 05:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds active alerting to the existing Release Health Monitor so daily tripwire detections (failed/stale release state) notify a human channel via a configurable webhook, rather than only updating an issue in place.

Changes:

  • Adds a new “Alert webhook on tripwire” step to post a JSON payload to RELEASE_HEALTH_WEBHOOK_URL when stale_count != 0 || failed_count != 0.
  • Documents the design rationale and tradeoffs in a new ADR (ADR-0001).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
docs/adr/ADR-0001-release-health-alerting.md Documents the decision to add webhook-based alerting for tripwire-positive scans.
.github/workflows/release-health-monitor.yml Adds a webhook notification step that runs on unhealthy scan results.

Comment on lines +75 to +76
issue_number=$(gh issue list --repo ${{ github.repository }} --state open --label release-health --json number --jq '.[0].number' 2>/dev/null || echo "")
issue_url="https://github.com/${{ github.repository }}/issues/${issue_number}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 23796c6: the Alert webhook on tripwire step now guards against the literal string \null\ the same way the other two call sites already did -- \if [ -z \\ ] || [ \\ = \null\ ]\ falls back to a label-search URL instead of embedding a bogus /issues/null link.

Comment on lines +77 to +80
failed="${{ steps.scan.outputs.failed_count }}"
stale="${{ steps.scan.outputs.stale_count }}"
text=":rotating_light: Release health tripwire: *${failed}* FAILED, *${stale}* STALE release-bearing repos. Details: ${issue_url}"
payload=$(printf '{"text":"%s"}' "$text")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 23796c6: the payload was genuinely missing repo names (only a text summary + issue link). Now the webhook step parses report.md for the per-repo FAILED/STALE lines and includes them as failed_repos/stale_repos fields plus a human-readable text field, so the alert is actionable without opening the tracking issue, matching the ADR-0001 claim.

stale="${{ steps.scan.outputs.stale_count }}"
text=":rotating_light: Release health tripwire: *${failed}* FAILED, *${stale}* STALE release-bearing repos. Details: ${issue_url}"
payload=$(printf '{"text":"%s"}' "$text")
curl -sS -X POST -H 'Content-Type: application/json' -d "$payload" "$WEBHOOK_URL" || echo "Webhook POST failed (non-fatal)."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 23796c6: added --connect-timeout 10 --max-time 30 to the curl call so a stalled webhook endpoint can no longer hang the workflow indefinitely.

…th repo names, add curl timeouts

- gh issue list --jq '.[0].number' can return the literal string "null"
  when no issue matches; the webhook step lacked the same guard the
  other two call sites already had. Added.
- Webhook payload now includes structured failed_repos/stale_repos
  (parsed from report.md) plus failed_count/stale_count/issue_url, so
  alerts are actionable without opening the tracking issue, matching
  the ADR-0001 claim.
- curl now sets --connect-timeout 10 --max-time 30 so a stalled
  webhook endpoint cannot hang the workflow indefinitely.
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