Skip to content

feat(build-lectures): print failed notebooks' tracebacks in the failure report - #198

Merged
mmcky merged 1 commit into
mainfrom
claude/sweet-goldberg-d9pyll-failure-tracebacks
Sep 25, 2026
Merged

mmcky merged 1 commit into
mainfrom
claude/sweet-goldberg-d9pyll-failure-tracebacks

Conversation

@quantecon-services

@quantecon-services quantecon-services commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

When a notebook raises, myst-nb logs only CellExecutionError and the path of the notebook's report. The traceback goes to <outdir>/reports/<doc>.err.log and 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.log under the builder's reports directory:

  • the last 200 lines of each, in its own collapsible ::group::;
  • wrapped in ::stop-commands::, so a notebook's output cannot be read as a workflow command;
  • only after a failed build, and only when the reports directory exists. Nothing else in the report changes.

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 from action.yml and 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::injected is 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 step shows the new output for the fixture's staged failure:

    • 📓 1 notebook(s) failed to execute;
    • a collapsible broken.err.log group holding the full traceback, ending in AssertionError: 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

…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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.log files 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.md under [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.

@mmcky
mmcky merged commit 61e3d9a into main Sep 25, 2026
25 checks passed
@mmcky
mmcky deleted the claude/sweet-goldberg-d9pyll-failure-tracebacks branch September 25, 2026 05:11
mmcky added a commit that referenced this pull request Nov 5, 2026
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
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.

4 participants