feat(renovate): track tagless git commit pins via git-refs digest mode - #129
Merged
Conversation
Some upstreams publish no tags and no versioned artifact, so a commit is the only identifier they offer. x264 is the case in hand: code.videolan.org has zero tags (only master/stable/GPLv2-only) and VideoLAN's versioned snapshot tarballs stopped in December 2019. Adds a Dockerfile customManager for the `branch=` marker shape, using the git-refs datasource's documented digest mode: the named ref goes in currentValue and the commit is matched as currentDigest, so Renovate resolves the branch head itself and rewrites the ARG. Mutually exclusive with both neighbouring commit-pin managers. The generic ARG manager requires ARG on the line immediately after depName, so the packageName= token locks it out; the digest=commit manager needs datasource=github-tags and resolves a tag to its commit, which a tagless repo cannot offer. Also outside repin-sha.sh's scope, which recomputes the sha256 of an artifact a version names: here there is no version and no sha256.
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.
Some upstreams publish no tags and no versioned artifact, so a commit is the only identifier they offer. Nothing in the preset could track that shape, so such a pin silently never moves.
x264 is the case in hand, verified rather than assumed:
git ls-remote --tags https://code.videolan.org/videolan/x264.gitreturns zero tags. Only three branches exist (master,stable,GPLv2-only).x264-snapshot-20191217-2245-stable.tar.bz2, abandoned since December 2019.ARG X264_COMMITconsequently sat at a May 2024 commit, 26 months old and 31 commits behindstable.This adds a Dockerfile customManager for a
branch=marker, using the git-refs datasource's documented digest mode: the named ref goes incurrentValueand the commit is matched ascurrentDigest, so Renovate resolves the branch head itself and rewrites the ARG. NopostUpgradeTasksneeded — Renovate supplies the new commit directly.Marker shape:
Mutual exclusion with the two neighbouring commit-pin conventions, tested against every Dockerfile in the fleet:
ARGon the line immediately afterdepName, so thepackageName=token locks it out.digest=commitmanager needsdatasource=github-tagsplus its own marker token, and resolves a tag to its commit — which a tagless repo cannot offer.repin-sha.sh'spostUpgradeTasksscope as well: that recomputes the sha256 of an artifact a version names, and here there is neither a version nor a sha256 pin.A full 40-char sha is required by the regex so Renovate's first digest comparison is exact; a short sha can never compare equal to a resolved full one and would produce a no-op lengthening PR.
Validated with
renovate-config-validator(exit 0). No-op in any repo without abranch=marker; the only current consumer is subflux (cplieger/subflux PR pairs with this).One thing worth a decision:
digestis in this file's automerge allowlist, so once tracked, x264 commits will auto-merge. I left that at the default rather than inventing a gate. If a branch head should get a human glance first, thegit-cliffand tool-registry digest alarms in this file are the pattern to copy.