Skip to content

CI: build PRs, key notebook cache on Firedrake version, weekly canary - #4

Merged
lrtfm merged 2 commits into
mainfrom
ci-hardening
Jul 15, 2026
Merged

CI: build PRs, key notebook cache on Firedrake version, weekly canary#4
lrtfm merged 2 commits into
mainfrom
ci-hardening

Conversation

@lrtfm

@lrtfm lrtfm commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Hardens the build workflow (item ② of the dev/test plan; companion to #3).

Problems addressed

  1. PRs were never built — the workflow only ran on push to main, so breakage was discovered after merging.
  2. The notebook cache hid API breakage. The cache key only hashed requirements.txt, and the jupyter cache re-executes only notebooks whose code changed — so when the Firedrake image updated, all unchanged notebooks silently reused outputs produced by an older Firedrake. "Testing against the latest image" was largely an illusion (this is exactly how the six failures fixed in Adapt to latest Firedrake image; add docker-based verification build #3 stayed invisible).

Changes

  • pull_request trigger: PRs now build the whole book in the latest image; deploy still happens only on push to main.
  • Cache key includes the Firedrake version (read from the image at run time, e.g. 2026.4.1): an image update invalidates the cache and re-executes every notebook. restore-keys still allows partial reuse within the same Firedrake version.
  • Weekly canary (schedule, Mon 03:00 UTC): runs with the cache step skipped, i.e. a full fresh rebuild — upstream API changes surface as a failed scheduled run instead of blocking your next PR.
  • Error reports are now uploaded also when the build fails (that is when they matter), and superseded PR runs are cancelled.

Notes for review

  • The version-detection step runs python3 -c "from importlib.metadata import version; print(version('firedrake'))" — verified against the current image (returns 2026.4.1).
  • First run after merging will be a full rebuild (new cache key format).
  • Best merged after Adapt to latest Firedrake image; add docker-based verification build #3, so the PR build of this branch (rebased content) passes against the current image.

🤖 Generated with Claude Code

@lrtfm

lrtfm commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

Added in the second commit: jupyter-book build -W --keep-going — jupyter-book exits 0 even when notebook execution fails (it only warns), so without this the job stays green regardless of broken notebooks. The book currently builds with zero warnings, so -W is safe. Note: this PR's own check is expected to be red until #3 is merged (it rebuilds main's content from an empty cache against the latest image, which is exactly the breakage #3 fixes) — that red X is the new pipeline working as intended.

lrtfm and others added 2 commits July 15, 2026 12:17
The workflow only built on push to main and cached executed notebooks with
a key derived solely from requirements.txt. Since the jupyter cache only
re-executes notebooks whose code changed, updating the Firedrake image never
invalidated the cache: "testing against the latest image" silently reused
outputs produced by older Firedrake versions, and PRs were not built at all.

- build on pull_request (deploy still only on push to main)
- include the Firedrake version reported by the image in the cache key, so
  an image update re-executes the whole book
- weekly scheduled run without the cache as a full-rebuild canary for
  upstream API changes
- upload the error reports also when the build fails (that is when they
  matter); cancel superseded PR runs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jupyter-book exits 0 even when notebooks fail to execute (only a warning is
emitted), so the job was green regardless. The book currently builds with
zero warnings, so -W is safe; --keep-going still reports all warnings before
failing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lrtfm
lrtfm merged commit 7126441 into main Jul 15, 2026
1 check passed
@lrtfm
lrtfm deleted the ci-hardening branch August 1, 2026 12:32
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.

1 participant