Repository navigation
fix(ci): watch the license gate's own inputs in the deps path filter - #2166
Conversation
📝 WalkthroughWalkthroughThe Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/merge-gate.yaml:
- Around line 74-91: Add .github/actions/load-versions/** and .settings.yaml to
the deps path filter in the merge-gate workflow, alongside the existing direct
inputs for verify-licenses. Keep the current paths unchanged so changes to the
version-loading action or pinned go_licenses version set deps true and prevent
the verify-licenses job from being skipped.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 6dfa546c-1de6-470d-bb5b-ad64c232bdaa
📒 Files selected for processing (1)
.github/workflows/merge-gate.yaml
16412fb to
89ddab7
Compare
mchmarny
left a comment
There was a problem hiding this comment.
Approved — no blockers. Verified the deps filter covers the license gate, toolchain pins, supporting actions, dependency inputs, and its own workflow. actionlint and yamllint pass, and this head executed verify-licenses successfully before the green aggregate gate.
verify-licenses runs `make license-check`, gated on the `deps` paths-filter output. That filter matched go.mod, go.sum, vendor/**, and '.github/workflows/verify-licenses.yaml' - a file deleted in 3c9f6ec when the job was folded into merge-gate.yaml. The entry was never updated to follow it, so nothing in the filter watched any input the job actually consumes. A PR that changes the license gate therefore merges with the gate skipped. That happened on NVIDIA#2159, which repaired `make license-check` after finding it passed while inspecting zero packages: it rewrote the Makefile recipe and added the install-go-licenses action, and verify-licenses was skipped on it, so the repaired gate was never run against the real dependency graph before merging. Replace the dead entry and add every input that defines the check, mirroring the reasoning the sibling notices filter already documents ("a change to them must not be able to skip its own gate"): - Makefile - the license-check recipe is the gate's contract. - .github/actions/install-go-licenses/** - supplies the binary the check runs; that action clears GOFLAGS, without which -trimpath strips GOROOT and the check passes vacuously. - .github/workflows/merge-gate.yaml - now defines the job, and makes a change to the filter trigger the gate it controls. - .go-version, .settings.yaml, .github/actions/load-versions/** - the toolchain pins and the action that resolves them. The job reads both through load-versions before running the check, so a version bump would otherwise skip the gate it changes: NVIDIA#814 bumped go-licenses touching only .settings.yaml, and NVIDIA#1204 bumped Go touching only .go-version. Both would have run the license gate against a tool version it never validated. Fixes NVIDIA#2164. Signed-off-by: Yuan Chen <[email protected]>
89ddab7 to
3fc9d41
Compare
Summary
verify-licenseswas gated on adepspath filter that watched a deleted file, so a PR changing the license gate merged without that gate running. Replace the dead entry and watch the inputs the job actually consumes.Motivation / Context
verify-licensesrunsmake license-checkand is gated onneeds.check-paths.outputs.deps == 'true'. Thedepsfilter matched only:That last path does not exist.
.github/workflows/verify-licenses.yamlwas deleted in3c9f6ec5when the job was folded intomerge-gate.yaml; the filter entry was added in #651 and never updated to follow it. The result is that nothing in the filter watched any input the job actually consumes — not thelicense-checkrecipe, not the action that installsgo-licenses, not the workflow that now defines the job, and not the toolchain pins (.go-version,.settings.yaml) the job resolves throughload-versions.This is a supply-chain gate that could not validate changes to itself.
It is not hypothetical. #2159 repaired
make license-checkafter finding it passed while inspecting zero packages: a-trimpath-linkedgo-licensescarries no baked-inGOROOT, so the stdlib prefix collapses to/, every package is classified as standard library, and the tool writes nothing and exits 0. That PR rewrote theMakefilerecipe and added theinstall-go-licensescomposite action — andverify-licenseswas skipped on it. The repaired gate was never run against the real dependency graph before merging.notices-freshnessand thetestssuite passed, which is what made the gap easy to miss.Fixes: #2164
Related: #2159, #2163
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/)Implementation Notes
The added entries mirror the reasoning the sibling
noticesfilter already documents — "Makefile is included because thenotices/notices-checkrecipes are the generation/check contract — a change to them must not be able to skip its own gate." Thedepsfilter simply never got that treatment.Makefile— thelicense-checkrecipe is the gate's contract..github/actions/install-go-licenses/**— supplies the binary the check runs. That action clearsGOFLAGS; without it-trimpathstripsGOROOTand the check passes vacuously, so a change there can silently neuter the gate..github/workflows/merge-gate.yaml— now defines the job. This also makes the fix self-validating: a PR editing the filter triggers the gate the filter controls, which is whyverify-licensesshould run on this PR rather than reportingverify-licenses-skip..go-version,.settings.yaml,.github/actions/load-versions/**— the toolchain pins and the action that resolves them. The job runsload-versionsand consumes itsgoandgo_licensesoutputs before invoking the check, so these reach the gate only through that action. Without them a version bump skips the gate it changes — and both cases are routine: chore(deps): Update dependency google/go-licenses to v2 #814 bumpedgo-licensestouching only.settings.yaml, and chore(deps): Update dependency go to v1.26.4 #1204 bumped Go touching only.go-version.This last one is the sharpest case.
.github/renovate.json5matchesgoogle/go-licensesundermatchUpdateTypes: ["patch", "pin", "digest"]withautomerge: true, so a bump to the license checker itself can auto-merge with no human in the loop — while the gate that would have exercised the new binary reports green by skipping..go-versionbumps likewise land in their own PR (matchFileNames: [".go-version"]) and matched neitherdepsnornotices.The dead
.github/workflows/verify-licenses.yamlentry is removed. A comment records why, so the next reader does not re-derive the history.Only
verify-licenses(if: deps == 'true') andverify-licenses-skip(if: deps != 'true') consume this output — verified — so no other job's triggering changes.Testing
Parsed the rendered filter to confirm the intended paths and the absence of the dead one:
Simulated the filter against real historical PRs to confirm the previously-skipping cases now trigger, and that unrelated changes still do not:
deps.settings.yaml.go-version.github/workflows/merge-gate.yamlload-versionsedit.github/actions/load-versions/**The remaining textual occurrence of
verify-licenses.yamlin the file is the explanatory comment, not a filter entry.The real test is this PR's own check run. Before this change a PR touching only
merge-gate.yamlproduceddeps=falseandverify-licenses-skip. With it,verify-licensesshould run andmake license-checkshould pass. Please confirm that in the checks below before merging — that is the behavior the issue is about.Full
make qualifywas not run: this changes a CI path filter only, with no Go source, no recipe data, and no shell/tooling change, so the Go build, race tests, coverage gate, e2e, scan, and api-diff lanes cannot regress from it.actionlintandyamllintare the lanes that cover the changed file.Risk Assessment
Rollout notes: No runtime or released-artifact change. One expected behavior change for reviewers:
verify-licensesnow runs on more PRs — any change toMakefile, this workflow, the install orload-versionsactions, or the toolchain pins in.go-version/.settings.yaml. Renovate version bumps will now pull in a 10-minute job that previously skipped; that is the intent, since a bump is exactly when the gate should run. Because the gate previously passed vacuously and was repaired only in #2159, it can legitimately start failing on a dependency that was waved through unexamined. It passes onmaintoday. That extra signal is the point of the fix, but it is worth knowing before the first red run.Checklist
make testwith-race) — N/A, no Go source changed;actionlint+yamllintcleanmake lint) —actionlintandyamllinton the changed filegit commit -S) — GPG signing info