Commit c68c119
authored
feat(ci): daily merge-train/spartan stale-PR notifier (#23189)
When the open merge-train/spartan PR has been open >24h, post a one-line
alert to #team-alpha. The cron fires once per day, so the channel sees
at most one notification per stuck day. Silent on healthy days.
## Files
- `ci3/merge_train_stale_check` — bash script: queries the open PR for a
merge-train branch, computes age from `created_at`, and posts a
`:warning:` Slack message via `ci3/slack_notify` if age >=
`$STALE_HOURS` (default 24).
- `.github-new/workflows/merge-train-stale-check.yml` — daily schedule
(`7 9 * * *`, 09:07 UTC) + `workflow_dispatch`. Calls the script for
`merge-train/spartan` → `#team-alpha`.
## ⚠ Move workflow into `.github/workflows/` before merging
The workflow is under `.github-new/` because this session was not
started with the `ci-allow` prefix (the prefix needs to be the first
token of the prompt; mid-message `ci-allow` was not picked up by the
session parser, so `.github/` was still blocked). Before merging, move
the file:
git mv .github-new/workflows/merge-train-stale-check.yml
.github/workflows/merge-train-stale-check.yml
Scheduled workflows only execute from the default branch, so the
notifier only starts firing once it has landed on `next`.
## Behaviour
| State of the open `merge-train/spartan` PR | Action |
|---|---|
| No open PR (just merged, awaiting auto-recreate) | Silent — no Slack
post. |
| Open < 24 h (`STALE_HOURS`) | Silent — within expected merge window. |
| Open ≥ 24 h | One `:warning:` line to `#team-alpha` with PR link +
`mergeable_state`. |
## Reuse
Other teams can wire in their own merge-train by adding a job that calls
`./ci3/merge_train_stale_check <branch> <channel>`. Threshold and base
branch are overridable via `STALE_HOURS` / `BASE_BRANCH` env vars.
## Motivation
Driven by a Slack request: merge-train/spartan PR
#22980 has been
stuck on conflicts for ~6 days with no automated notification.
ClaudeBox log: https://claudebox.work/s/e4b1d8ae8d5c867b?run=2
---------
Co-authored-by: Santiago Palladino <santiago@aztec-labs.com>2 files changed
Lines changed: 79 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
0 commit comments