Skip to content

ci: keep the jupyter execution cache in the build-cache artefact - #235

Merged
mmcky merged 1 commit into
mainfrom
maint/node24-actions
Sep 18, 2026
Merged

mmcky merged 1 commit into
mainfrom
maint/node24-actions

Conversation

@mmcky

@mmcky mmcky commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

cache.yml uploads _build as the build-cache artefact that ci.yml and publish.yml download. It does not set include-hidden-files: true. Since upload-artifact v4.4.0 (August 2024), hidden files and directories are left out by default. So _build/.jupyter_cache, which is a dot-directory, has been missing from every build-cache artefact. This PR adds the one input that keeps it.

The repository builds with execute_notebooks: cache, so the missing directory matters. Two checks confirm it:

  • The latest build-cache artefact (id 10331930533, from the scheduled run on 2026-09-14) contains only html/ (112 entries) and jupyter_execute/ (25 entries). There is no .jupyter_cache in it.
  • In the most recent ci.yml run (33453492567, 2026-09-01), myst-nb reports Using jupyter-cache at: .../_build/.jupyter_cache, then executes all eight notebook lectures from scratch, with cache IDs counting up from Cached executed notebook: ID=1. The cache it downloaded was empty.

lecture-python.myst and lecture-python-intro set include-hidden-files: true on the same step (Upload "_build" folder (cache), actions/upload-artifact@v7, path: _build). This PR brings continuous_time_mcs into line with them.

Pin From To Runtime
actions/upload-artifact@v7 (cache.yml, Upload "_build" folder (cache)) unchanged unchanged node24
its include-hidden-files input not set (default false) true n/a

No uses: line changes. The diff also adds the newline that was missing at the end of the file, because the new line is appended after path: _build.

Behaviour change. Once a main-branch artefact carries the cache, PR builds reuse the weekly outputs for lectures whose code cells have not changed, instead of executing them again. A lecture re-executes when its code changes. Package updates alone do not re-execute a cached lecture, but the weekly cache.yml run still builds from scratch, because it does not download the artefact. The other lecture repositories already work this way. The input also brings in _build/.doctrees (Sphinx's environment.pickle and one doctree per page, 12 files), the other hidden directory under _build. lecture-python.myst and lecture-python-intro carry it too, because their upload step is identical. A fresh checkout gives every source file a newer mtime than the saved environment, so Sphinx still re-reads every page.

What CI proves. This PR's own CI runs ci.yml, which is unchanged and still downloads main's artefact, so it does not exercise the change. I dispatched cache.yml on this branch to prove it. Run 35319345874 passed. Its log shows include-hidden-files: true and 160 files uploaded, and its artefact (id 10536696795, 5.16 MB, up from 4.18 MB) now contains .jupyter_cache/global.db and eight executed notebooks under .jupyter_cache/executed/. That artefact cannot reach ci.yml or publish.yml, which both download with branch: main. After merge, the next scheduled cache.yml run on main (Mondays 03:00 UTC) produces the first artefact with the cache in it, and the ci.yml run after that should reuse cached notebooks rather than execute them.

The dawidd6/action-download-artifact v23 to v24 bump is in Dependabot's #233 and is not repeated here. This came out of the read-only sweep for the Node 24 upgrade across the lecture fleet, approved on 2026-09-18. It predates that upgrade and is unrelated to Node.

🤖 Generated with Claude Code

cache.yml uploads _build as the build-cache artefact, but without
include-hidden-files: true. Since upload-artifact v4.4.0 (August 2024)
hidden files and directories are excluded by default, so
_build/.jupyter_cache has been dropped from every build-cache artefact.
With execute_notebooks: cache, ci.yml and publish.yml have therefore
been executing every notebook from an empty cache.

lecture-python.myst and lecture-python-intro already set this on the
same step.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 18, 2026 07:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is minimal, correctly scoped to the artifact upload step, and aligns with the stated goal of preserving _build/.jupyter_cache in the build-cache artifact.

Pull request overview

Ensures the GitHub Actions “build-cache” artifact produced by cache.yml includes Jupyter’s execution cache directory under _build (a hidden dot-directory), so downstream workflows that download this artifact can actually reuse notebook execution results.

Changes:

  • Set include-hidden-files: true for the _build artifact upload step in cache.yml.
File summaries
File Description
.github/workflows/cache.yml Updates the artifact upload step to include hidden directories like _build/.jupyter_cache in the build-cache artifact.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown

@github-actions
github-actions Bot temporarily deployed to pull request September 18, 2026 07:31 Inactive
@netlify

netlify Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for sparkly-moxie-de1f0e ready!

Name Link
🔨 Latest commit 379fcfb
🔍 Latest deploy log https://app.netlify.com/projects/sparkly-moxie-de1f0e/deploys/6aace793bef6c60008c1d9c7
😎 Deploy Preview https://deploy-preview-235--sparkly-moxie-de1f0e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for adorable-cucurucho-69162b ready!

Name Link
🔨 Latest commit 379fcfb
🔍 Latest deploy log https://app.netlify.com/projects/adorable-cucurucho-69162b/deploys/6aace7931ac07a0008808e30
😎 Deploy Preview https://deploy-preview-235--adorable-cucurucho-69162b.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mmcky
mmcky merged commit e4d1dbd into main Sep 18, 2026
12 checks passed
@mmcky
mmcky deleted the maint/node24-actions branch September 18, 2026 11:25

This branch was previously deployed

1 inactive deployment
pull request — 379fcfbe Deployed Sep 18, 2026 by github-actions[bot]
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