feat: add {version} placeholder interpolation for URL-type sources#3
Merged
feat: add {version} placeholder interpolation for URL-type sources#3
Conversation
The url field now supports a {version} placeholder that gets resolved
to the source's version field value before fetching. This makes version
the single source of truth, preventing drift between the URL path and
the version field (e.g. kubevirt url pointing at v1.7.1 while version
says v1.6.1). Renovate only needs to bump version, and the URL stays
correct automatically.
Validation requires {version} to be present in all url-type source URLs
and rejects it when version is empty.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
{version}placeholder in theurlfield, resolved to theversionvalue before fetchingtype: urlsources include the{version}placeholder, preventing silent version drift between URL path and version fieldsource.schema.jsonto document the interpolation behaviorMotivation
The
versionfield and URL path could drift independently, as happened with kubevirt (url pointed at v1.7.1, version said v1.6.1) and gateway-api (url at v1.5.0, version at v1.2.1). With interpolation,versionbecomes the single source of truth. Renovate's custom manager only needs to bumpversion, and the URL stays correct automatically.Test plan
go test ./internal/source/passes (ResolvedURL unit tests)go test ./internal/fetcher/passes (URLFetcher version interpolation integration test)go vet ./...cleantype: helmare unaffectedtype: urlsources missing{version}in the URL{version}in URL when version field is emptyGenerated with Claude Code