feat: Renovate updates a component and its dashboard in one PR #57
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/renovate-owns-the-dashboard-pins"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes the gap that makes #47 fail on every rebase, and removes the last
"a human does the other half" note from
renovate.json.The problem
A dashboard pin is a tag inside a URL plus a sha256 of the exact bytes:
Renovate bumps the image in
redis-sample/deployment.yaml, the pin above staysat
v1.91.1, andtests/version-sync.batsfails — correctly. The standinganswer was a
prBodyNoteasking someone to move the pin, recompute the sha andregenerate. So the PR could never be green on its own.
If a test can prove two pins disagree, the relationship is machine-readable and
the fix can be automated too.
Three pieces
REFRESH_CHECKSUMS=1makes the generator record a mismatch and rewrite thepin in itself rather than exiting 1. Replacement is by the literal old hash —
unique in the file — so it works both for inline pins and for
LOKI_CHART_SHA256, referenced from five calls. Written via a temp file, notsed -i, whose syntax differs between GNU and BSD.Without the variable the integrity check is unchanged. A mismatch still
fails loudly with both hashes. Only an explicit opt-in rewrites a pin.
Two custom managers read the generator's pins, which nothing read before —
the kubernetes manager sees only image tags, the helm manager only Applications.
They now resolve all eight:
github-tagsargoproj/argo-cd,traefik/traefik,prometheus-community/postgres_exporter,oliver006/redis_exporter,henrywhitaker3/adguard-exporter,TwiN/gatus,grafana/alloyhelmlokidepNamedeliberately matches the image or chart depName, so the component andits dashboard group into one pull request.
postUpgradeTasksthen refreshes the checksum and regenerates theConfigMaps into that same branch. It is allowlisted in
gitops/apps/renovate/configmap.yaml— the only place such a command can bepermitted, since a repository cannot grant itself the right to run commands. The
regex is anchored and names one script.
Verification
Corrupted a pinned checksum to 64 zeroes:
REFRESH_CHECKSUMS=1→ repairs it to the real hashrenovate-config-validatorpasses, all 39 bats tests and 24 hooks pass, and themanager regexes were run against the real script.
What is not yet proven:
postUpgradeTasksexecuting inside the Renovatecontainer. It needs
curl jq sha256sum tar, which the generator checks for onstartup — so a missing tool fails loudly rather than silently skipping. The
first grouped dashboard PR after this merges is the real test; #47 should be it.
Note on #47
Its dashboard JSON is byte-identical between
v1.91.1andv1.92.0, so thatparticular bump only moves the tag and the
# Source:comment. The machinerymatters for the next one that isn't.