Go datasource can't resolve source URL without direct access to vanity import domain #44898
felipecrs
started this conversation in
Suggest an Idea
Replies: 1 comment
|
I proposed a PR for this: |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Tell us more.
Renovate resolves a Go module's source/repository URL by performing an additional request to
<module>?go-get=1directly and scraping thego-import/go-sourcemeta tags (e.g. https://k8s.io/kubernetes?go-get=1). This requires the Renovate environment to have access to that domain. On a locked-down/firewalled network (onlyGOPROXYegress allowed, no direct internet), that request never succeeds, sosourceUrlstays unset. That is the case fork8s.io/*,go.opentelemetry.io/*and any other vanity import path.The main issue is that the built-in
monorepo:kubernetespreset, which groups dependencies bymatchSourceUrls, simply won't work. The same forgroup:opentelemetry-go. Without a resolved source URL, the dependencies silently never groups.But I think there's a nice way to fix this.
The Go module proxy protocol already carries this data: the
@latest(and@v/<version>.info) endpoint onGOPROXYreturns anOriginfield with the real VCS type and URL whenever the proxy resolved the module from git (reference). Renovate already talks toGOPROXYfor version listing, we just need to extract the data (no new dependency, no extra request (one less request, in fact), and no direct access to the vanity domain needed).We could make it so Renovate only checks https://k8s.io/kubernetes?go-get=1 in case https://proxy.golang.org/k8s.io/api/@latest doesn't yield a result. Or maybe not even that is necessary.
What do you think?
All reactions