Repository navigation
Prebuilt: alert on nightly failure and on a stale release - #51
Conversation
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.
There was a problem hiding this comment.
💡 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 | |||
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 👍 / 👎.
| 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' ' ') |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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")" |
There was a problem hiding this comment.
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 👍 / 👎.
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:Each one skipped all 39 build jobs and published nothing, silently.
What this adds
.github/actions/prebuilt-alertopens, 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. Everyghcall 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:
skippedcounts as healthy, since a scheduled no-op legitimately skips every build job and assemble.unsloth-prebuilt-deadman.ymlwatches 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
$PRSwith a plainecho, not even a::warning:::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.jsonmay 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.ymltakes the same schema.One subtlety worth flagging for review: the required flag is read with an explicit null test, not
.required // true. jq's//treatsfalseas empty, so the obvious spelling silently readsrequired: falseastrueand the flag does nothing.Verification
bash -nover everyrun:block in both workflows and the composite action, with${{ }}expressions substituted out. All parse.pr-set.jsonfor three cases: all pins open (all included), a required pin merged (refuses), a merged pin marked optional (skips, continues).No secrets needed;
GITHUB_TOKENwithissues: writecovers it.