Skip to content

Prebuilt: alert on nightly failure and on a stale release - #51

Merged
danielhanchen merged 1 commit into
masterfrom
prebuilt-alerting
Aug 3, 2026
Merged

danielhanchen merged 1 commit into
masterfrom
prebuilt-alerting

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

The nightly has no failure notification. There is no if: failure() step, no webhook and no issue creation anywhere in this repo, so a failed scheduled run only emails whoever last touched the cron file. That is how three nightlies in a row failed unnoticed:

run date died in cause
30666643530 07-31 resolve ggml-org#26185 pin force-pushed away
30718507279 08-01 resolve same
30767267935 08-02 resolve ggml-org#25731 stopped merging onto b10229

Each one skipped all 39 build jobs and published nothing, silently.

What this adds

.github/actions/prebuilt-alert opens, updates or closes a deduplicated issue. Alerts sharing a key collapse onto one thread via a hidden marker, so a multi-night outage is one issue with a run-by-run history rather than one issue per night, and it closes itself on the next success. It scans open labelled issues rather than the search index, which lags by minutes and would double-open on back-to-back runs. Every gh call is tolerated so a broken alert cannot fail the run it reports on, with one exception: failing to open an issue is ::error::, since that is the single case this exists to prevent.

An alert job on the orchestrator, gated on publish-intent runs so subset test dispatches stay quiet. It pulls the actual refusal out of the failed job log, so the issue says which pin broke:

ggml-org/llama.cpp#25731 (02142bbc) does not merge cleanly onto b10229 + the PRs listed before it

skipped counts as healthy, since a scheduled no-op legitimately skips every build job and assemble.

unsloth-prebuilt-deadman.yml watches the output instead of the process. A run can go green while publishing nothing, and nothing keyed off job failure can see that. Upstream cuts releases several times a day, so two days without one of ours is a fault rather than a quiet upstream.

Silent capability regression in resolve

Separate from alerting, and worth its own look. Today a pinned PR that gets merged or closed upstream drops out of $PRS with a plain echo, not even a ::warning:::

if [ "$STATE" != "open" ]; then
  echo "skipping ${SRC}#${NUM} (${STATE}): $url"
  continue
fi

That changes SETHASH, which changes the tag, so the release ships without that architecture under a brand new tag and nobody is told. A user loses Kimi-K3 or Inkling and only finds out when inference fails.

Entries in scripts/unsloth/pr-set.json may now be {"url": "...", "required": false}. Bare strings stay valid and mean required, so the file needs no migration. A non-open required pin refuses instead of quietly dropping. unsloth-pr-set-lint.yml takes the same schema.

One subtlety worth flagging for review: the required flag is read with an explicit null test, not .required // true. jq's // treats false as empty, so the obvious spelling silently reads required: false as true and the flag does nothing.

Verification

  • bash -n over every run: block in both workflows and the composite action, with ${{ }} expressions substituted out. All parse.
  • The pin loop exercised against the live pr-set.json for three cases: all pins open (all included), a required pin merged (refuses), a merged pin marked optional (skips, continues).
  • The alert summary logic exercised for a healthy scheduled no-op, a resolve failure and a partial build failure.
  • Reason extraction checked against the real 08-02 refusal text.

No secrets needed; GITHUB_TOKEN with issues: write covers it.

The nightly has no failure notification at all. There is no `if: failure()`
step, no webhook and no issue creation anywhere in the repo, so a failed
scheduled run only emails whoever last touched the cron file. That is how
07-31, 08-01 and 08-02 all failed unnoticed and the fork sat three days
behind upstream.

Adds three things:

- .github/actions/prebuilt-alert: opens, updates or closes a deduplicated
  issue. Alerts sharing a key collapse onto one thread, so a multi-night
  outage reads as one issue with a run-by-run history instead of one issue
  per night. Closes itself on the next success.

- An alert job on the orchestrator, gated on publish-intent runs so subset
  test dispatches stay quiet. It quotes the actual refusal out of the failed
  job log, so the issue says which pin broke rather than just "a job failed".
  'skipped' counts as healthy: a scheduled no-op legitimately skips every
  build job.

- unsloth-prebuilt-deadman.yml: a run can go green while publishing nothing,
  which nothing keyed off job failure can see. Upstream cuts releases several
  times a day, so two days without one of ours is a fault.

Also closes a silent capability regression in resolve. A pinned PR that gets
merged or closed upstream currently drops out of $PRS with a plain echo,
which changes SETHASH, which changes the tag, so the release ships without
that architecture under a new tag and nobody is told. Entries may now be
{"url", "required": false}; bare strings stay valid and mean required, so the
file needs no migration. A non-open required pin refuses instead. The lint
workflow takes the same schema.

Verified: bash -n over every run block in both workflows and the action, and
the pin loop exercised for open, merged-required and merged-optional.
@danielhanchen
danielhanchen merged commit e251682 into master Aug 3, 2026
@danielhanchen
danielhanchen deleted the prebuilt-alerting branch August 3, 2026 07:03

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c6f26af654

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,99 @@
# SPDX-License-Identifier: AGPL-3.0-only

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Replace the automated Codex commit

The reviewed commit records both its Author and Committer as Codex <[email protected]>, making this an automated contribution that the repository policy explicitly prohibits and may close immediately; the change must instead be authored and committed by the human contributor.

AGENTS.md reference: AGENTS.md:L36-L40

Useful? React with 👍 / 👎.

AGE_D=$(( ( $(date -u +%s) - $(date -u -d "$PUB" +%s) ) / 86400 ))
echo "newest release ${TAG} published ${PUB} (${AGE_D}d ago); threshold ${STALE_DAYS}d"

if [ "$AGE_D" -le "${STALE_DAYS}" ]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Trigger the stale alert at the configured threshold

When the newest release is 2 days and 23 hours old, the integer division above produces AGE_D=2, and this -le 2 branch still reports success. Consequently, the check described as alerting after two days remains green until the release is at least 72 hours old; compare elapsed seconds or treat AGE_D >= STALE_DAYS as stale.

Useful? React with 👍 / 👎.

Comment on lines +210 to +211
done < <(jq -r '.prs[] | if type == "string" then {url: ., required: true} else . end
| "\(.url)\t\(if .required == null then true else .required end)"' scripts/unsloth/pr-set.json | tr '\t' ' ')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the pin documentation for required entries

When an existing bare-string pin is merged or closed, this conversion makes it required and the resolve loop aborts, but both the comments at lines 158-160 and scripts/unsloth/pr-set.json still tell operators that closed or merged PRs are skipped automatically. Following those instructions after an alert therefore leaves the nightly failing; update the documented schema and recovery instructions to explain that bare strings now require repinning or conversion to { "url": ..., "required": false }.

Useful? React with 👍 / 👎.

echo "::error file=$FILE::${SRC}#${NUM} is ${STATE} and is a required entry; the nightly will refuse rather than publish without its architecture"
fail=1
else
echo "::warning file=$FILE::${SRC}#${NUM} is ${STATE}; the nightly will skip this optional entry"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip membership checks for closed optional pins

When an optional pin is already closed or merged, the resolver warns and immediately skips it, but this lint path only warns and then continues into the commit-membership and head checks. If the pinned commit was force-pushed away before the PR closed, changing the entry to required: false still leaves the lint red even though the nightly intentionally ignores that entry; continue after warning for a non-open optional pin so lint mirrors the resolver.

Useful? React with 👍 / 👎.

echo "opened $NEW ($KEY)"
else
# The one case worth shouting about: a real failure went unreported.
echo "::error::prebuilt-alert: could not open an issue for ${KEY}; the failure at ${RUN_URL} is unreported"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Fail when the initial alert cannot be created

When gh issue create fails because of a permission, label, or transient API problem, this ::error:: logging command still exits successfully, so the alert job remains green and GitHub's normal workflow-failure notification is not triggered. This is the exact case where the real pipeline failure remains unreported; return a nonzero status after emitting the annotation so there is a fallback signal.

Useful? React with 👍 / 👎.

run: |
set -uo pipefail
# 'skipped' is healthy: a scheduled no-op skips every build job.
FAILED="$(jq -r 'to_entries | map(select(.value.result == "failure") | .key) | join(", ")' <<<"$NEEDS_JSON")"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not report cancelled dependencies as healthy

When a publish-intent dependency has result cancelled, this filter does not include it in FAILED, so the summary emits status=success and may close an existing tracking issue even though the run published nothing. Treat cancelled as unhealthy, or skip recovery reporting for it, while continuing to exempt only the intentionally healthy skipped results.

Useful? React with 👍 / 👎.

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.

1 participant