From 40e0206579d0d4577fae857d0bdb4d55353f0b34 Mon Sep 17 00:00:00 2001 From: Aztec Bot <49558828+AztecBot@users.noreply.github.com> Date: Fri, 24 Jul 2026 14:36:06 -0400 Subject: [PATCH] chore(ci): route spartan/spartan-v5 merge-train notifications to #team-alpha-ci (#24963) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What Two related changes for the spartan / spartan-v5 merge-train Slack notifications: 1. **Route them to `#team-alpha-ci`** instead of `#team-alpha`, so the team channel stops receiving CI noise. 2. **Stop silently dropping failed Slack posts** in `ci3/slack_notify`, so a mis-delivered notification (e.g. the bot isn't a member of the target channel) is visible in the CI log instead of vanishing. ## (1) Notification sites re-routed | File | Notification | Before → After | |---|---|---| | `ci3/merge_train_failure_slack_notify` | "PR merged into …", CI failure, and dequeue notifications for spartan / spartan-v5 (each also kicks off a ClaudeBox investigation) | `#team-alpha` → `#team-alpha-ci` | | `.github/workflows/merge-train-stale-check.yml` | daily "`merge-train/spartan…` has not merged into `next`/`v5-next`" stale alert | `#team-alpha` → `#team-alpha-ci` | | `.github/workflows/network-healthcheck.yml` | "Starting network healthcheck …" kickoff + the ClaudeBox `respond_to_user` summary | `#team-alpha` → `#team-alpha-ci` | | `scripts/socket-fix-ci.sh` | Socket dependency-vulnerability fix notification | `#team-alpha` → `#team-alpha-ci` | | `ci3/merge_train_stale_check` | usage-example comment only | updated for consistency | `ci3/run_test_cmd` — flake notifications for spartan / spartan-v5 **already** post to `#team-alpha-ci` (since [#23219](https://github.com/AztecProtocol/aztec-packages/pull/23219), 2026-05-12). ## (2) Surface Slack post failures (`ci3/slack_notify`) Previously the `chat.postMessage` curl ended in `&>/dev/null`, so any failure — most commonly `not_in_channel` when the bot isn't a member of the target channel — disappeared with no trace. This is the likely reason flake notifications to `#team-alpha-ci` were never observed despite the routing being correct: the posts were failing silently. The script now captures the API response and logs a clear error to stderr (`slack_notify: failed to post to Slack channel '': `) on any non-`ok` response or curl/network failure. It stays best-effort — the failure is logged, the caller is not failed. ## Base & backport Based on **`merge-train/spartan`** (targets `next`), and labeled **`backport-to-v5-next`** so the same change is carried over to the `v5-next` line. The `network-healthcheck` and `merge-train-stale-check` schedules ultimately run from the default branch once this reaches `next` via the train; the per-train CI scripts (`merge_train_failure_slack_notify`, `slack_notify`, `socket-fix-ci.sh`) run from the checked-out train head. ## Left untouched (intentionally) - `.claude/skills/merge-trains/SKILL.md` team-mapping table, `ci3/dashboard/.../ci-health-report.html`, `spartan/testnet-runbook.md` — these reference the owning **team** (`#team-alpha`) or are a manual human runbook step, not automated CI notifications. - Other merge-train channel mappings (`#team-bonobos`, `#honk-team`, `#help-ci`, `#dev-rels`, `#team-fairies`) are unrelated and unchanged. ## Notes - No new Slack scopes are required — every call uses the same `SLACK_BOT_TOKEN` + `chat.postMessage`. The bot must be a **member of `#team-alpha-ci`** for delivery; once (2) lands, a missing membership shows up as a `not_in_channel` line in the CI log. The **ClaudeBox app** must also be a member so the healthcheck summary and failure/dequeue kickoff replies can post. --- *Created by [claudebox](https://claudebox.work/v2/sessions/e345f34e9b2da947/jobs/1) · group: `slackbot` · requested by Santiago Palladino · [Slack thread](https://aztecprotocol.slack.com/archives/C0AU8BULZHC/p1784902660161109?thread_ts=1784902660.161109&cid=C0AU8BULZHC)* --- .github/workflows/merge-train-stale-check.yml | 4 ++-- .github/workflows/network-healthcheck.yml | 4 ++-- ci3/merge_train_failure_slack_notify | 4 ++-- ci3/merge_train_stale_check | 2 +- ci3/slack_notify | 14 ++++++++++++-- scripts/socket-fix-ci.sh | 2 +- 6 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/merge-train-stale-check.yml b/.github/workflows/merge-train-stale-check.yml index 6474cf137dd7..f45e462f92df 100644 --- a/.github/workflows/merge-train-stale-check.yml +++ b/.github/workflows/merge-train-stale-check.yml @@ -20,7 +20,7 @@ jobs: env: GH_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} - run: ./ci3/merge_train_stale_check merge-train/spartan '#team-alpha' + run: ./ci3/merge_train_stale_check merge-train/spartan '#team-alpha-ci' spartan-v5: name: Check merge-train/spartan-v5 @@ -36,7 +36,7 @@ jobs: GH_TOKEN: ${{ secrets.AZTEC_BOT_GITHUB_TOKEN }} SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} BASE_BRANCH: v5-next - run: ./ci3/merge_train_stale_check merge-train/spartan-v5 '#team-alpha' + run: ./ci3/merge_train_stale_check merge-train/spartan-v5 '#team-alpha-ci' fairies-v5: name: Check merge-train/fairies-v5 diff --git a/.github/workflows/network-healthcheck.yml b/.github/workflows/network-healthcheck.yml index 7347e74d1387..4cb2252ed750 100644 --- a/.github/workflows/network-healthcheck.yml +++ b/.github/workflows/network-healthcheck.yml @@ -37,7 +37,7 @@ jobs: 5. Any errors (level >= 50) or warnings (level 40) in the last 8 hours 6. Bot status if applicable - Create a gist with the full healthcheck report. Then post a concise summary to the #team-alpha channel via respond_to_user. Flag anything that needs attention (stopped bots, missed slots, errors, low peer counts). + Create a gist with the full healthcheck report. Then post a concise summary to the #team-alpha-ci channel via respond_to_user. Flag anything that needs attention (stopped bots, missed slots, errors, low peer counts). Format the respond_to_user message as a brief network status overview, e.g.: - testnet: healthy, block 5570, 100 peers @@ -45,6 +45,6 @@ jobs: - devnet: WARNING - bot stopped (insufficient balance) Link to the gist for full details." - ./ci3/slack_notify_with_claudebox_kickoff "#team-alpha" \ + ./ci3/slack_notify_with_claudebox_kickoff "#team-alpha-ci" \ "Starting network healthcheck for: ${NETWORKS}" \ "$PROMPT" diff --git a/ci3/merge_train_failure_slack_notify b/ci3/merge_train_failure_slack_notify index 43259dc434bb..540f0ed52b53 100755 --- a/ci3/merge_train_failure_slack_notify +++ b/ci3/merge_train_failure_slack_notify @@ -36,9 +36,9 @@ elif [[ "$REF_NAME" == "merge-train/fairies" ]]; then elif [[ "$REF_NAME" == "merge-train/fairies-v5" ]]; then channel="#team-fairies" elif [[ "$REF_NAME" == "merge-train/spartan" ]]; then - channel="#team-alpha" + channel="#team-alpha-ci" elif [[ "$REF_NAME" == "merge-train/spartan-v5" ]]; then - channel="#team-alpha" + channel="#team-alpha-ci" else exit 0 fi diff --git a/ci3/merge_train_stale_check b/ci3/merge_train_stale_check index a65c6ef9d985..b31989c0015f 100755 --- a/ci3/merge_train_stale_check +++ b/ci3/merge_train_stale_check @@ -6,7 +6,7 @@ # Usage: merge_train_stale_check # # Example: -# merge_train_stale_check merge-train/spartan '#team-alpha' +# merge_train_stale_check merge-train/spartan '#team-alpha-ci' # # Required env vars: # GH_TOKEN — GitHub API token (used by `gh api`) diff --git a/ci3/slack_notify b/ci3/slack_notify index 98a249aff5c2..f6e6f7efaa50 100755 --- a/ci3/slack_notify +++ b/ci3/slack_notify @@ -8,7 +8,17 @@ fi channel=${2:-"#aztec3-ci"} data=$(jq -n --arg channel "$channel" --arg text "$1" '{channel: $channel, text: $text}') -curl -X POST https://slack.com/api/chat.postMessage \ +# Post to Slack, capturing the API response. Previously the response went to +# /dev/null, so a failed post (most commonly the bot not being a member of the +# target channel -> "not_in_channel", or an invalid channel/token) vanished with +# no trace and could not be troubleshooted. Surface any failure in the CI log. +# Best-effort: log the failure but do not fail the caller. +response=$(curl -sS -X POST https://slack.com/api/chat.postMessage \ -H "Authorization: Bearer $SLACK_BOT_TOKEN" \ -H "Content-type: application/json" \ - --data "$data" &>/dev/null + --data "$data" 2>&1) + +if [ "$(jq -r '.ok // false' <<<"$response" 2>/dev/null)" != "true" ]; then + error=$(jq -r '.error // empty' <<<"$response" 2>/dev/null) + echo "slack_notify: failed to post to Slack channel '$channel': ${error:-$response}" >&2 +fi diff --git a/scripts/socket-fix-ci.sh b/scripts/socket-fix-ci.sh index 86f22c40591d..2e77d48e85c4 100755 --- a/scripts/socket-fix-ci.sh +++ b/scripts/socket-fix-ci.sh @@ -122,7 +122,7 @@ ${LINKS}" ${LINKS}" fi - data=$(jq -n --arg channel "#team-alpha" --arg text "$TEXT" '{channel: $channel, text: $text}') + data=$(jq -n --arg channel "#team-alpha-ci" --arg text "$TEXT" '{channel: $channel, text: $text}') curl -X POST https://slack.com/api/chat.postMessage \ -H "Authorization: Bearer $SLACK_BOT_TOKEN" \