fix(renovate): let the molecule manager pin a digest - #109
Merged
Conversation
Renovate's field-wise rewrite only changes tokens the matched line already holds, so pinning a bare `:latest` produced a byte-identical line and the branch was discarded with `Digest is not updated`; an autoReplaceStringTemplate is the only path that can add the token, and a CI-run guard keeps it from being dropped again. Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Molecule platform imagescustomManager inrenovate-ansible.jsongains anautoReplaceStringTemplate, so thepinDigestsrule beside it can actually pin. Without it Renovate's field-wise rewrite path only changes tokens the matched line already holds — pinning a bare:latestleavescurrentValueunchanged and has nocurrentDigestto swap, so the line came back byte-identical,confirmIfDepUpdatedfound no digest, and the branch was discarded withError updating branch: update failure.image:prefix and trailing newline included) becausereplaceAtswaps the match as a unit;matchStringsis unchanged. The digest slot is guarded by{{#if newDigest}}so a plain tag update does not emit a bare@.renovate-molecule-managerCI job runsscripts/tests/test-renovate-molecule-manager.sh, which reads regex and template out of the JSON withjqand asserts a round trip: the unpinned line matches, the rendered template matches that same regex again, and the digest comes back out of it — the exact re-extraction that fails today.image:, so a quoted value would lose its quotes. Still valid YAML, and no molecule scenario in the consuming repositories uses that form.Test plan
scripts/tests/test-renovate-molecule-manager.sh— was red before the preset change (the molecule customManager has no autoReplaceStringTemplate) and passes with itjq empty renovate-ansible.json,yamllint .github/workflows/pull-request.yml,shellcheckandshfmt -don the new scripttest-renovate-rst-manager.shandtest-workflow-input-injection.shstill passarillso/ansible.agentonce the tag moves, not this merge