fix(tools): derive gopkg.in license URLs when gopkg.in is down #3191
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 642 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.387
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3191"
general
weight: 0.35
lalitadithya
Summary
When gopkg.in is down, the license-URL normalizer now derives the GitHub URL for gopkg.in modules itself instead of failing
make notices. A gopkg.in outage no longer turns main red or blocks a release build.Motivation / Context
On 2026-10-12 gopkg.in returned
502 Proxy Errorand timeouts for about 30 minutes. merge-gate'snotices-generatorfailed on main twice, onbcb73fe95(#3189) and6cd65debd(#3180), and neither commit touched Go dependencies:go-licenses finds a gopkg.in module's GitHub repository through the
go-sourcetag that gopkg.in serves. When that request fails, go-licenses writes the literalUnknownas the URL (go-licenses v2.0.1report.go), and the normalizer fails closed on it.make releasedepends onmake notices, so the same outage would also stop a release.Fixes: N/A
Related: #3189, #3180
Type of Change
Component(s) Affected
cmd/aicr,pkg/cli)cmd/aicrd,pkg/server)pkg/recipe)pkg/bundler,pkg/component)pkg/collector,pkg/snapshotter)pkg/validator)pkg/errors,pkg/k8s)docs/,examples/)tools/normalize-go-license-urls(make notices,make release)Implementation Notes
gopkg.in's naming rule is fixed:
gopkg.in/pkg.vNisgithub.com/go-pkg/pkg, andgopkg.in/user/pkg.vNisgithub.com/user/pkg. When a row's URL isUnknownand the package is under gopkg.in, the normalizer builds candidate GitHub blob URLs from three sources:go list -m. Any pseudo-version form resolves to its commit.licenses/find.go): the package's directory first, then each parent up to the module root, files in name order, using go-licenses' license file name pattern. The fallback therefore cites the same file a normal run does.The candidates are probed exactly like every other URL. The first reachable one wins, and an inconclusive probe fails the row.
These still fail the build, as before:
UnknownURL;gocannot resolve;replacedirective ({{if not .Replace}}prints nothing for it).GO_BINcan be overridden likeCURL_BIN. The test's curl stub now reports a result for every URL it is given, as real curl does, including the literalUnknown.Testing
tools/normalize-go-license-urls_test.shcovers:- module paths with and without an owner;
- all three pseudo-version forms;
- a subpackage with its own license (the nearer file wins);
-
COPYINGbeforeLICENSE, andLICENSEbeforeNOTICE(name order);- a
LICENSE.md-only module;- three cases that must still fail: a non-gopkg.in
Unknown, an unresolvable gopkg.in module, and a replaced gopkg.in module.Removing each fix from the source makes its case fail. The new cases also fail on main with CI's exact error. shellcheck is clean.
replacesemantics with realgo: in a temp module withreplace gopkg.in/yaml.v3 => ./local, the format string prints nothing, so the row fails closed.Unknown, resolve to the same URLs go-licenses emits with gopkg.in up. That holds under bash 5 and macOS/bin/bash3.2.make noticesthrough a local proxy that refuses only gopkg.in.- On main it fails with CI's error for the same four modules.
- On this branch it passes, and
THIRD_PARTY_NOTICES.mdis byte-identical (cmp) to a normal run with gopkg.in reachable.Risk Assessment
Rollout notes: N/A. Only rows that would otherwise have failed the build are affected.
Checklist
make testwith-race)make lint)git commit -s -S) — GPG signing info