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:
Defame1297 committed 2026-12-06 19:11:42 +00:00
1 parent b2e547edd5
commit fac7ed47be
8 files changed
+39 -27

No files matched your search

+1 -2
View File
@@ -63,8 +63,7 @@ it to this repository's organisation in the Gitea registry as `<version>` and `l
image; a job downloads at run time only on the slow path (a pull request that changes a pin
file). *Why:* a run that downloads is slower and depends on the network. *Held:* control: on
the fast path Lint and Build cut the network by environment, so a download through pip or a
proxy-honouring client fails the job; review for a raw socket, for the script tests, which keep
network, and for Molecule.
proxy-honouring client fails the job; review for a raw socket and for Molecule.
- **Each Dockerfile upgrades the base image's packages in its first apt layer.** *Why:* Ubuntu
publishes package updates before it refreshes the base image. *Held:* review.
- **Recorded speed:** a speed optimisation that adds machinery states its measured saving where
+1 -1
View File
@@ -15,7 +15,7 @@
# - /opt/venv: requirements-dev.lock, the hashed lock of requirements-dev.txt (ansible-core, ansible-lint, pre-commit,
# antsibull-changelog, galaxy-importer, reuse, molecule, proxmoxer), on the Python of
# .python-version (PYTHON_VERSION below), the one the lock was resolved on and a clone's .venv-dev uses.
# molecule is there for Lint's "Test the repository scripts" step, whose molecule tests import it; its
# molecule is there for Lint's run of the script-tests hook, whose molecule tests import it; its
# Docker driver and community.docker are not: Molecule runs in the molecule-controller image.
# - /opt/collections: the collections of requirements.yml (the versions the roles are
# tested against), found through ANSIBLE_COLLECTIONS_PATH, so `ansible-lint --offline`