Skip to content

CI: stop masking a failing notebook build#76

Merged
mmcky merged 1 commit into
mainfrom
fix/ci-pipefail-notebook-build
Jul 24, 2026
Merged

CI: stop masking a failing notebook build#76
mmcky merged 1 commit into
mainfrom
fix/ci-pipefail-notebook-build

Conversation

@mmcky

@mmcky mmcky commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The notebook-build step reports success when the build fails.

Mechanism

The step runs three commands:

jb build lectures --path-output ./ --builder=custom --custom-builder=jupyter -n -W --keep-going
mkdir -p _build/html/_notebooks
cp -u _build/jupyter/*.ipynb _build/html/_notebooks

The step's exit code is cp's, not jb build's. --keep-going guarantees the .ipynb files exist for cp to succeed on even when the build failed, so a failing strict build reports green. shell: bash -l {0} is a custom shell spec, so GitHub injects no -eo pipefail of its own — it only does that for the bare shell: bash shorthand.

Scope

This is the last live instance across the five editions. lecture-intro.zh-cn and lecture-python.zh-cn already carry the fix; the .fa and .fr editions are not affected because their builds are the last command in the step. The added comment matches the wording already used in lecture-python.zh-cn so the reason travels with the line.

Risk

Bounded. This step's twin, Build HTML, runs the same -n -W --keep-going unmasked — it is the last command in its own step — and is green on main. So removing the mask can only reveal failures specific to the jupyter custom builder, not a long-broken build in general. If CI does go red here, that is a real finding and worth triaging on its own rather than reverting.

🤖 Generated with Claude Code

The notebook-build step ends with `mkdir -p` and `cp -u`, so the step's exit
code is `cp`'s, not `jb build`'s. `--keep-going` guarantees the .ipynb files
exist for `cp` to succeed on, so a failing strict build reported success.
`shell: bash -l {0}` is a custom shell spec, so GitHub injects no `-eo pipefail`
of its own.

This is the last live instance of the pattern across the five editions:
lecture-intro.zh-cn and lecture-python.zh-cn already carry the fix, and the .fa
and .fr editions are not affected because their builds are the last command in
the step.

The step's twin, "Build HTML", runs the same `-n -W --keep-going` unmasked and
is green, so this bounds what removing the mask can reveal to failures specific
to the jupyter custom builder.
Copilot AI review requested due to automatic review settings July 23, 2026 22:50

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.

Pull request overview

This PR fixes a GitHub Actions CI false-positive in the “Build Download Notebooks (sphinx-tojupyter)” step by ensuring the step fails when jb build fails, rather than accidentally reporting success based on the trailing cp command’s exit status.

Changes:

  • Add an explanatory comment describing why shell: bash -l {0} needs explicit error-handling flags.
  • Add set -eo pipefail so the step stops on failures and propagates non-zero exit codes correctly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mmcky
mmcky merged commit 87fb922 into main Jul 24, 2026
3 checks passed
@mmcky
mmcky deleted the fix/ci-pipefail-notebook-build branch July 24, 2026 04:43
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.

2 participants