ci: shift checks left (check-json, script tests, image pins) #187
Notifications
Due Date
No due date set.
Depends on
Reference: Mortis/Kamino#187
Reference in new issue
Block a user
Spec: Enforcement map for each prose-only rule, resolution comment, "New controls".
What
check-jsonfrom thepre-commit-hooksrepository already in.pre-commit-config.yaml(it coversrenovate.json).language: systemhook runningpython -m unittest discover -s tests/scripts, withfiles: ^(scripts|tests/scripts)/andpass_filenames: false. Remove Lint's separate unit-test step, becausepre-commit run --all-filesnow runs it.GIT_*variables from the environment it passes togit, the waytests/scripts/test_select_molecule_scenarios.py:86-113already does. A hook runs withGIT_DIR(and oftenGIT_INDEX_FILE) exported, andtests/scripts/test_check_bot_pr_diff.py:36-48passes{**os.environ, ...}straight togit, so inside a hook itsgit init,git addandgit commitwould act on the real repository instead of the fixture. Add a check for it (for example, run the suite once withGIT_DIRset to a bogus path and expect it to pass).python3 scripts/check_image_versions.py pinson^(\.gitea/workflows/|images/), withpass_filenames: false. The hook fails when its file set is empty instead of passing silently.Acceptance
GIT_DIRset to a bogus path.check_bot_pr_diff.pystill accepts a Renovate bump of the hook repositories'rev:lines.ci(images): assign image versions in CI (#165) now blocks this and removes
bump_image_versions.pyand thebumpmode. Drop the part that keeps or moves thebumpjudge; no manual image version bump is needed once #165 lands. (From Order of the implementation backlog, #198.)Review of the map (2026-11-15): corrections to this issue.
GIT_DIR(and oftenGIT_INDEX_FILE) exported. Some git-fixture tests pass the caller's environment straight togit:tests/scripts/test_check_bot_pr_diff.py:36-48andtests/scripts/test_bump_image_versions.py:36-48use{**os.environ, ...}. Inside a hook, theirgit init,git addandgit commitwould act on the real repository instead of the fixture.tests/scripts/test_select_molecule_scenarios.py:86-113already removes everyGIT_*variable, for this reason. Change: before the hook is added, make every fixture dropGIT_*variables the same way, and add a check (for example, run the suite once withGIT_DIRset to a bogus path and expect it to pass).bumpwork. It says to runcheck_image_versions.py bumpfromorigin/main's copy, keepbumpas a Lint step, bump theciimage version, and has an acceptance line forbump. The ordering comment drops all of it, since the image versions issue removesbumpfirst. Change: fold the comment into the body and delete those lines and the matching acceptance item.ci: shift checks left (check-json, script tests, image pins) and run the bump judge from mainto ci: shift checks left (check-json, script tests, image pins)Body rewritten on 2026-11-20 to the final state of the comments above (final validation round of the map, #87 (comment)). The body is the spec; the earlier comments are history.
bumpjudge is removed (#165 removesbump, and no manual image version bump is needed), and the title drops "run the bump judge from main".GIT_*variables before the script-test hook, and the image-pins hook fails on an empty file set.