ci+scripts: address review nits from #170#174
Open
dimitri-yatsenko wants to merge 1 commit into
Open
Conversation
Follow-ups from Milagros' review of #170: - Add `.github/workflows/check-notebooks.yml` so `check_notebook_versions.py` runs on PRs that touch notebooks, `mkdocs.yaml`, or the script itself. Stale connection banners now fail the PR instead of relying on a contributor running the check manually. Kept as a separate lightweight workflow rather than wiring into `development.yml`, which only triggers on push to main (deploy). - `execute_notebooks.py`: route pre-cache warnings to stderr so a transient gitlab.com hiccup is visible in CI logs without silently re-introducing "Downloading file ..." chatter on the next refresh. Wrap the `skimage.data` import in try/except so the script degrades gracefully (and prints to stderr) when scikit-image isn't installed. - `check_notebook_versions.py`: drop the inner `break` so a notebook with multiple stale banners reports all of them, deduped via a set.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-ups to @MilagrosMarin's review on #170. Each of the four nits she flagged is now addressed in one self-contained PR — no notebook re-execution involved.
check_notebook_versions.pynot in CI.github/workflows/check-notebooks.ymlruns the check on PRs that touch notebooks,mkdocs.yaml, or the scriptsys.stderr(visible in CI logs) without escalating to a non-zero exit — a transient gitlab.com hiccup shouldn't block the whole runskimageimported at module-execute timeimport skimage.datawrapped in try/except; script degrades gracefully when scikit-image isn't installedhad_bannershort-circuits after first stale matchbreak; collect stale versions per notebook in a set so multiple stale banners are all reported, dedupedDesign note on #1
Milagros suggested wiring into
.github/workflows/development.yml, but that workflow only triggers onpush: main(it's the gh-pages deploy). Adding the check there would fire post-merge and never block a PR. A separatepull_request-triggered workflow that just runs the script (no Docker, no datajoint-python checkout) gives the intended fail-the-PR behavior in seconds.Test plan
Check notebooksworkflow once green (since.github/workflows/check-notebooks.ymlis in its own paths filter)python scripts/check_notebook_versions.py→OK: 22 notebook(s) with banners are on DataJoint 2.2.x(verified)python scripts/execute_notebooks.py --helpworks without scikit-image installed (verified — argparse exits before import anyway, and import is now guarded)2.0.x, run the check, confirm it's reported (not just the first match) — exits 1