Repository navigation
Harness follow-ups from #116: attribute the negative build test, document the -W dependence - #118
Merged
Merged
Conversation
`build-fail-guard` asserted only that the step outcome was `failure`, which a build that died on any unrelated `-W` warning would also satisfy — the job could stay green while the property it guards (a failing build fails the step) was broken. It now also requires the staged traceback in harness/_build/html/reports/broken.err.log, and that the log carries the fixture's own assertion message, so the red is provably this job's deliberate CellExecutionError. The `$OUTCOME` check stays first: a stale err.log survives an incremental rebuild that exits 0, so the file existing is not by itself evidence of failure. The path is hard-coded rather than globbed on purpose — it is the same path build-lectures ships in `upload-failure-reports`, so a jupyter-book layout change goes red here instead of silently producing an empty artifact there. Verified against a real failed build (jupyter-book 1.0.4.post1, myst-nb 1.4.0): `jb build harness/lectures --path-output harness -W --keep-going` exits 1 and writes exactly that path, and the assertion passes on the resulting tree and fails when the report is absent or carries a different failure. Also records a harness property that cost time to rediscover: "Re-run failed jobs" can never go green here, because it bumps run_attempt (and so the cache salt) without re-running the already-green seed jobs. Refs #116 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
A code cell that raises is not an error to Jupyter Book — myst-nb logs "Executing notebook failed: CellExecutionError" as a *warning* and carries on (`raise_on_error` defaults to false). `-W` in the `extra-args` default is the only reason a broken lecture fails the build, and `extra-args` replaces the default rather than extending it. A consumer who overrides it without `-W` gets a published site, an error-report page, and exit 0 — green CI over a broken lecture. That was recorded nowhere in the docs. Verified empirically on the harness fixture: with `-W` the build exits 1; with only `--keep-going` it exits 0 and still publishes broken.html. The `raise_on_error: true` alternative exits 1 without `-W` but aborts before writing the reports/ tracebacks, which is why the note prefers `-W`. Also corrects the Troubleshooting step that suggested bare `--keep-going` to see all errors; without `-W` it reports nothing extra. Refs #116 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR tightens the action-harness negative build test so it can attribute the expected failure to the staged notebook execution error, and updates build-lectures documentation to make the -W dependency explicit (plus a small troubleshooting correction). It fits into the repo’s ongoing effort to make composite actions and their CI harness assertions more robust and self-explanatory.
Changes:
- Strengthen
build-fail-guardto require the expectedbroken.err.logand a known assertion message, not just a failed step outcome. - Document that
-Wis load-bearing for notebook-execution failures to fail CI, and clarify troubleshooting guidance. - Record in the harness workflow header why “Re-run failed jobs” cannot succeed with the current cache salting strategy.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
CHANGELOG.md |
Adds Unreleased notes describing the harness assertion tightening and the -W documentation clarification. |
build-lectures/README.md |
Documents the -W dependency and updates troubleshooting guidance around --keep-going. |
.github/workflows/test-actions.yml |
Enhances build-fail-guard to attribute failures to the staged execution error and documents rerun behavior constraints. |
Suppressed comments (1)
build-lectures/README.md:235
- In the notebook-execution failure troubleshooting, the parenthetical "
--keep-goingwithout-Wreports nothing extra" is overly absolute. More precisely: without-W, execution failures stay warnings, so--keep-goingwon’t turn them into build-stopping errors or help surface additional failing notebooks as errors.
3. Re-run locally the way CI does — `jb build lectures -W --keep-going` — to see every error that
fails the build (`--keep-going` without `-W` reports nothing extra)
Copilot read "on its own it does nothing" as an overly absolute claim. The
claim is correct, but the README asserted it without evidence, so it invited
exactly that doubt. Both places now carry the reason.
Sphinx gates the flag on -W in application.py:
self.keep_going = warningiserror and keep_going
so without -W it is False regardless, and the only site that reads it
(`if self._warncount and self.keep_going: self.statuscode = 1`) is
unreachable. Sphinx's own help says "with --fail-on-warning, keep going when
getting warnings", and jupyter-book's says "With -W, do not stop the build on
the first warning" — jb only forwards the flag to Sphinx(keep_going=...).
Refs #116
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
3 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Items 3 and 4 from #116, plus one harness property that review turned up. No consumer-facing behaviour changes — one CI assertion and two docs corrections.
Item 3 —
build-fail-guardaccepted any redThe job asserted only that the build step's outcome was
failure. A build that died on some unrelated-Wwarning satisfies that just as well, so the job could stay green while the property it exists to guard — a failing build fails the step — was broken. It now also requires the staged traceback atharness/_build/html/reports/broken.err.logand checks that the log carries the fixture's own assertion message, so the red is provably this job's deliberateCellExecutionError.The
$OUTCOMEcheck stays first, because a staleerr.logsurvives an incremental rebuild that exits 0 — the file existing is not by itself evidence that the build failed. The path is hard-coded rather than globbed on purpose: it is the same pathbuild-lecturesships inupload-failure-reports, so a jupyter-book layout change goes red here instead of silently producing an empty artifact there.Item 4 — the
-Wdependence was recorded nowhereA code cell that raises is not an error to Jupyter Book.
myst-nblogs it as a warning and carries on, so-Win theextra-argsdefault is the only reason a broken lecture fails the build — andextra-argsreplaces the default rather than extending it. A consumer who overridesextra-argswithout-Wgets a published site, an error-report page, and exit 0: green CI over a broken lecture. The README documented what-Wdoes but never that it was load-bearing.The Troubleshooting step that suggested bare
--keep-goingto see all errors is also corrected — without-Wit reports nothing extra.New: "Re-run failed jobs" can never go green on this harness
Not in #116, found while reviewing it.
SALTisrun_id-run_attempt. GitHub incrementsrun_attempton a re-run but does not re-run already-green jobs, so the seeds stay put while the restore/hit jobs rebuild their fixtures under a new salt and look for caches nobody saved;fail-on-missthen fires. Only "Re-run all jobs" works. Every run to date isattempt=1, which is why it has never been hit. Recorded in the workflow header rather than "fixed" — droppingrun_attemptfrom the salt would let attempt 2 reuse attempt 1's caches and silently invalidate the miss assertions.Verification
Both docs claims were checked against a real build rather than reasoned about (jupyter-book 1.0.4.post1 / myst-nb 1.4.0, harness fixture with the same staged failure):
reports/broken.err.log-W --keep-going--keep-goingonlybroken.htmlpublishedraise_on_error: true, no-WThe middle row is the failure mode the new README warning describes. The bottom row is why that warning prefers
-Woverraise_on_error.The new assertion block was extracted from the YAML and run under
bash -eagainst the real failed build tree: passes on it, and fails with a useful message when the report is absent or carries a different failure. Workflow still parses (14 jobs,build-fail-guardunchanged in shape).CI is the real check — this PR touches
.github/workflows/test-actions.yml, so the harness runs on it andbuild-fail-guardexercises the new assertion end to end.Not included
#116 items 1, 2 and 5 are unchanged here. Item 1 is blocked on the release that moves
v0; items 2 and 5 need their premises corrected first, which I'll do on the issue.Refs #116
🤖 Generated with Claude Code