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
This commit is contained in:
1 parent
b2e547edd5
commit
fac7ed47be
8 files changed
+39
-27
No files matched your search
+2
-2
@@ -12,8 +12,8 @@ rules for scripts (prefer a standard tool, comment length) are in
|
||||
- **A script change comes with its test in `tests/scripts/`** (`test_<script>.py`), in the same
|
||||
pull request. Run them with `python3 -m unittest discover -s tests/scripts`.
|
||||
*Why:* a script decides whether a pull request passes, so an untested change can wave through
|
||||
what it should stop. *Held:* control: the Lint check's "Test the repository scripts" step runs
|
||||
the tests; review for whether the change is tested at all.
|
||||
what it should stop. *Held:* control: the `script-tests` pre-push hook runs the
|
||||
tests, and the Lint check runs it again; review for whether the change is tested at all.
|
||||
- **A line added to `tests/sanity/ignore-common.txt` is a last resort and carries its reason** as
|
||||
a trailing `# ...` comment. Fix the finding first. A finding of one ansible-core version only
|
||||
goes in a committed `ignore-<MAJOR.MINOR>.txt`, which the Build job appends.
|
||||
|
||||
Reference in new issue
Block a user