Repository navigation
feat(build-lectures): print failed notebooks' tracebacks in the failure report - #198
Conversation
…re report myst-nb logs only "CellExecutionError" and the err.log path for a notebook that raised; the traceback goes to <outdir>/reports/<doc>.err.log and nowhere else, so it lived only in a 7-day artifact. #159 needed a multi-hour investigation partly because of that: the CI tracebacks could not be read. The failure report now prints each err.log (last 200 lines) in its own ::group::, wrapped in ::stop-commands:: so a notebook's output cannot be read as a workflow command, with sed ensuring the resume token starts its own line. It runs only after a failed build and only when the reports directory exists. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Gmq1LGR87Md5rq4RJshmMp
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It modifies CI failure-reporting shell that relies on subtle GitHub workflow-command stop-commands/token-masking semantics that can only be fully validated on a live runner, warranting a human's final sign-off.
Review effort: Balanced
Findings: None
What changed in this PR
This PR improves the build-lectures composite action's diagnostics. When a notebook raises during execution, myst-nb logs only a generic CellExecutionError plus the path to <outdir>/reports/<doc>.err.log; the actual traceback previously lived only in the 7-day reports artifact, which made failures like #159 hard to diagnose from CI logs. The action's existing if: failure() "Report build failure" step now also prints each notebook's traceback inline in the CI log.
Changes:
- Added a guarded block to the "Report build failure" step that finds
*.err.logfiles under the builder's reports directory and prints the last 200 lines of each in its own collapsible::group::. - Each traceback is wrapped in
::stop-commands::/resume with a random token so notebook output cannot be interpreted as a workflow command; the block runs only when the reports directory exists and contains logs, and it does not alter build success/failure status. - Documented the behavior change in
CHANGELOG.mdunder[Unreleased] → Changed.
| File | Description |
|---|---|
| build-lectures/action.yml | Adds a guarded loop in the failure-report step to print each notebook's *.err.log traceback (last 200 lines) in a collapsible, command-safe group. |
| CHANGELOG.md | Documents the new failure-report traceback output under the Unreleased/Changed section. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Move [Unreleased] into a dated 0.13.0 section (decision 11, 2026-11-04), and record the deploy-CLI moves since v0.12.0 (#207, #219), which Dependabot made without a CHANGELOG entry. The release carries #198, #206 and #210 to @v0 consumers, so it is staged on the canary before v0 moves. This commit changes only CHANGELOG.md, and the harness has no @v0 workaround for this release to drop. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WT8bMbMmeUUEj8EjiweB6S
When a notebook raises, myst-nb logs only
CellExecutionErrorand the path of the notebook's report. The traceback goes to<outdir>/reports/<doc>.err.logand nowhere else, so it has only been available in the 7-day reports artifact. That is a large part of why #159 took a long investigation: the CI tracebacks could not be read (diagnosis).build-lectures' "Report build failure" step now prints each*.err.logunder the builder's reports directory:::group::;::stop-commands::, so a notebook's output cannot be read as a workflow command;This changes an action's output, so under CONTRIBUTING's Staged Releases it goes out with the next staged release.
Verification
Local run. I extracted the step's
run:script fromaction.ymland ran it under the composite shell (bash --noprofile --norc -eo pipefail) against a fake reports directory. It lists both logs, including one in a subdirectory and one with no final newline. Each gets its own group, and the resume token always starts its own line. A line reading::error::injectedis printed as plain text. With no reports directory the step prints what it did before, and it exits 0 in every case.Harness, confirmed. In this PR's run,
build-lectures: a failing build fails the stepshows the new output for the fixture's staged failure:📓 1 notebook(s) failed to execute;broken.err.loggroup holding the full traceback, ending inAssertionError: harness: deliberate build failure.GitHub masks the stop/resume token as
***. The##[endgroup]that follows the resume is still processed as a command, so commands resume correctly. The step and the job stay green.🤖 Generated with Claude Code
https://claude.ai/code/session_01Gmq1LGR87Md5rq4RJshmMp