check_image_versions.matrix_of() no longer uses PyYAML. It is a small block-style reader for the matrix.include list of .gitea/workflows/image.yml. CLAUDE.md notes that the Renovate image's python3 has no PyYAML.
Why
Dry run 2453 (green) ran the postUpgradeTasks command python3 scripts/bump_image_versions.py origin/main in the Renovate -full image and it failed with ModuleNotFoundError: No module named 'yaml' (bump_image_versions imports check_image_versions, which imported yaml). Renovate reports that as an artifact error, so every bump PR would have opened without the version bump (red renovate/artifacts; Lint's bump check would then fail). The job stayed green.
Design
A purpose-built reader, not a YAML parser: it reads the single include: list and each entry's name, version, subpath, dockerfile. It fails closed with a one-line error on flow style, anchors, tags, block scalars, escapes, duplicate keys, numeric versions or names, and anything else it cannot read. The cost is a second reader that must stay in sync with the file; a test keeps it honest.
A test compares the reader with PyYAML on the real image.yml; another fails if either script imports yaml.
In a scratch clone with yaml blocked (sys.modules['yaml'] = None), bump_image_versions.py origin/main after an requirements-dev.txt change exits 0, prints bumped ci 0.2.0 -> 0.2.1 and changes only that version: line.
Not verified
That the post-upgrade task succeeds inside the real Renovate image: needs another dry run after merge (look for the version: change in the commit details of renovate/ansible-tooling).
The report check still does not fail on artifact errors (I do not know the report field); a failed bump shows only as a red renovate/artifacts status and a failing Lint bump check.
## What
`check_image_versions.matrix_of()` no longer uses PyYAML. It is a small block-style reader for the `matrix.include` list of `.gitea/workflows/image.yml`. `CLAUDE.md` notes that the Renovate image's `python3` has no PyYAML.
## Why
Dry run 2453 (green) ran the `postUpgradeTasks` command `python3 scripts/bump_image_versions.py origin/main` in the Renovate `-full` image and it failed with `ModuleNotFoundError: No module named 'yaml'` (`bump_image_versions` imports `check_image_versions`, which imported `yaml`). Renovate reports that as an artifact error, so every bump PR would have opened without the version bump (red `renovate/artifacts`; Lint's `bump` check would then fail). The job stayed green.
## Design
A purpose-built reader, not a YAML parser: it reads the single `include:` list and each entry's `name`, `version`, `subpath`, `dockerfile`. It fails closed with a one-line error on flow style, anchors, tags, block scalars, escapes, duplicate keys, numeric versions or names, and anything else it cannot read. The cost is a second reader that must stay in sync with the file; a test keeps it honest.
## Verified
- 123 script tests pass (`python3 -B -m unittest discover -s tests/scripts`); the commit hooks pass.
- A test compares the reader with PyYAML on the real `image.yml`; another fails if either script imports `yaml`.
- In a scratch clone with `yaml` blocked (`sys.modules['yaml'] = None`), `bump_image_versions.py origin/main` after an `requirements-dev.txt` change exits 0, prints `bumped ci 0.2.0 -> 0.2.1` and changes only that `version:` line.
## Not verified
- That the post-upgrade task succeeds inside the real Renovate image: needs another dry run after merge (look for the `version:` change in the commit details of `renovate/ansible-tooling`).
- The report check still does not fail on artifact errors (I do not know the report field); a failed bump shows only as a red `renovate/artifacts` status and a failing Lint `bump` check.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Dry run 2453 ran the bump post-upgrade task in the Renovate image and it
failed with ModuleNotFoundError: yaml, so every bump PR would have opened
without the version bump. matrix_of() is now a small block-style reader that
fails closed on anything else; a test compares it with PyYAML on the real
image.yml and another forbids importing yaml in the scripts.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What
check_image_versions.matrix_of()no longer uses PyYAML. It is a small block-style reader for thematrix.includelist of.gitea/workflows/image.yml.CLAUDE.mdnotes that the Renovate image'spython3has no PyYAML.Why
Dry run 2453 (green) ran the
postUpgradeTaskscommandpython3 scripts/bump_image_versions.py origin/mainin the Renovate-fullimage and it failed withModuleNotFoundError: No module named 'yaml'(bump_image_versionsimportscheck_image_versions, which importedyaml). Renovate reports that as an artifact error, so every bump PR would have opened without the version bump (redrenovate/artifacts; Lint'sbumpcheck would then fail). The job stayed green.Design
A purpose-built reader, not a YAML parser: it reads the single
include:list and each entry'sname,version,subpath,dockerfile. It fails closed with a one-line error on flow style, anchors, tags, block scalars, escapes, duplicate keys, numeric versions or names, and anything else it cannot read. The cost is a second reader that must stay in sync with the file; a test keeps it honest.Verified
python3 -B -m unittest discover -s tests/scripts); the commit hooks pass.image.yml; another fails if either script importsyaml.yamlblocked (sys.modules['yaml'] = None),bump_image_versions.py origin/mainafter anrequirements-dev.txtchange exits 0, printsbumped ci 0.2.0 -> 0.2.1and changes only thatversion:line.Not verified
version:change in the commit details ofrenovate/ansible-tooling).renovate/artifactsstatus and a failing Lintbumpcheck.🤖 Generated with Claude Code