ci: shift checks left (check-json, script tests, image pins) and name the meta-dependency check #527

Merged
Defame1297 merged 5 commits from ci/187-246-shift-left-checks into main 2026-12-06 20:24:43 +00:00
5 Commits
Author SHA1 Message Date
Defame1297 26d7b4914c docs(agents): say that a push also runs the script tests
Build / build (pull_request) Successful in 30s
Lint / renovate-config (pull_request) Successful in 9s
Molecule / select (pull_request) Successful in 8s
Molecule / scenarios (pull_request) Skipped
Molecule / Result (pull_request) Successful in 1s
Lint / lint (pull_request) Successful in 2m20s
Refs: #187

Assisted-by: Claude Code
2026-12-06 19:51:21 +00:00
Defame1297 6432eb52b0 docs(roles): name the test that fails a meta dependency
test_roles_call_each_other_by_full_name_only in
tests/scripts/test_select_molecule_scenarios.py already fails when a role's
meta/main.yml declares dependencies, and Lint runs it through the
script-tests hook. That test is the Lint check the rule waited for, so the
rule now names it as its control, and the workflow rules and the selector's
docstring no longer describe a meta dependency as allowed.

Refs: #246

Assisted-by: Claude Code
2026-12-06 19:15:36 +00:00
Defame1297 fac7ed47be ci(pre-commit): run check-json, the script tests and the image pins as hooks
A contributor learns about a broken renovate.json, a failing script test or
a bad image pin from Lint today; as hooks they fail before the push.

- check-json from pre-commit-hooks covers renovate.json.
- script-tests runs the suite at pre-push, since it takes minutes. Its
  GIT_DIR points at an uncreatable path, so a fixture that keeps the
  caller's git environment fails instead of writing to this repository.
  Lint runs it by id; the suite now runs under the network guard.
- check-image-pins runs check_image_versions.py pins on every commit: its
  inputs span workflows, Dockerfiles and docs/images, and it fails when one
  is missing. Lint's pre-commit run replaces its separate step.

Adding hooks changes .pre-commit-config.yaml, an input of the ci image, so
this pull request takes Lint's slow path and the next Images run publishes
a new ci version.

Refs: #187

Assisted-by: Claude Code
2026-12-06 19:11:42 +00:00
Defame1297 b2e547edd5 test(scripts): reach the fake registry past Lint's dead proxy
Lint's fast path exports a dead proxy with an empty no_proxy, and
next_image_version.py uses urllib's default opener, which honours them, so
the RegistryClient tests could not reach their fake registry on 127.0.0.1.
Setting no_proxy for loopback in the tests lets the suite run under the
guard instead of the workflow unsetting it.

Refs: #187

Assisted-by: Claude Code
2026-12-06 19:11:16 +00:00
Defame1297 6c80ab7772 test(scripts): keep git fixtures off the caller's GIT_* variables
A git hook exports GIT_DIR (and often GIT_INDEX_FILE). A fixture that passes
the caller's environment to git would run its init, add and commit against
this repository instead of its temporary one once the suite runs as a hook.

tests/scripts/git_env.py gives each fixture a copy of the environment
without any GIT_* key and with no user or system config. The bot pull
request gate's repository tests also isolate os.environ, because the gate
runs git in-process.

Refs: #187

Assisted-by: Claude Code
2026-12-06 19:10:56 +00:00