Skip to content

fix(ci): watch the license gate's own inputs in the deps path filter - #2166

Merged
mchmarny merged 1 commit into
NVIDIA:mainfrom
yuanchen8911:fix/2164-deps-filter
Aug 11, 2026
Merged

mchmarny merged 1 commit into
NVIDIA:mainfrom
yuanchen8911:fix/2164-deps-filter

Conversation

@yuanchen8911

@yuanchen8911 yuanchen8911 commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

verify-licenses was gated on a deps path 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-licenses runs make license-check and is gated on needs.check-paths.outputs.deps == 'true'. The deps filter matched only:

deps:
  - 'go.mod'
  - 'go.sum'
  - 'vendor/**'
  - '.github/workflows/verify-licenses.yaml'

That last path does not exist. .github/workflows/verify-licenses.yaml was deleted in 3c9f6ec5 when the job was folded into merge-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 the license-check recipe, not the action that installs go-licenses, not the workflow that now defines the job, and not the toolchain pins (.go-version, .settings.yaml) the job resolves through load-versions.

This is a supply-chain gate that could not validate changes to itself.

It is not hypothetical. #2159 repaired make license-check after finding it passed while inspecting zero packages: a -trimpath-linked go-licenses carries no baked-in GOROOT, so the stdlib prefix collapses to /, every package is classified as standard library, and the tool writes nothing and exits 0. That PR rewrote the Makefile recipe and added the install-go-licenses composite action — and verify-licenses was skipped on it. The repaired gate was never run against the real dependency graph before merging. notices-freshness and the tests suite passed, which is what made the gap easy to miss.

Fixes: #2164
Related: #2159, #2163

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Build/CI/tooling

Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)
  • API server (cmd/aicrd, pkg/server)
  • Recipe engine / data (pkg/recipe)
  • Bundlers (pkg/bundler, pkg/component/*)
  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)
  • Validator (pkg/validator)
  • Core libraries (pkg/errors, pkg/k8s)
  • Docs/examples (docs/, examples/)
  • Other: merge-gate path filters

Implementation Notes

The added entries mirror the reasoning the sibling notices filter already documents — "Makefile is included because the notices/notices-check recipes are the generation/check contract — a change to them must not be able to skip its own gate." The deps filter simply never got that treatment.

  • 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 it -trimpath strips GOROOT and 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 why verify-licenses should run on this PR rather than reporting verify-licenses-skip.

  • .go-version, .settings.yaml, .github/actions/load-versions/** — the toolchain pins and the action that resolves them. The job runs load-versions and consumes its go and go_licenses outputs 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 bumped go-licenses touching 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.json5 matches google/go-licenses under matchUpdateTypes: ["patch", "pin", "digest"] with automerge: 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-version bumps likewise land in their own PR (matchFileNames: [".go-version"]) and matched neither deps nor notices.

The dead .github/workflows/verify-licenses.yaml entry is removed. A comment records why, so the next reader does not re-derive the history.

Only verify-licenses (if: deps == 'true') and verify-licenses-skip (if: deps != 'true') consume this output — verified — so no other job's triggering changes.

Testing

actionlint .github/workflows/merge-gate.yaml   # clean
yamllint .github/workflows/merge-gate.yaml     # clean

Parsed the rendered filter to confirm the intended paths and the absence of the dead one:

go.mod
go.sum
vendor/**
Makefile
.go-version
.settings.yaml
.github/actions/install-go-licenses/**
.github/actions/load-versions/**
.github/workflows/merge-gate.yaml

Simulated the filter against real historical PRs to confirm the previously-skipping cases now trigger, and that unrelated changes still do not:

Change deps matched by
#814 — go-licenses bump true .settings.yaml
#1204 — Go bump true .go-version
this PR true .github/workflows/merge-gate.yaml
a load-versions edit true .github/actions/load-versions/**
an unrelated docs PR false —

The remaining textual occurrence of verify-licenses.yaml in 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.yaml produced deps=false and verify-licenses-skip. With it, verify-licenses should run and make license-check should pass. Please confirm that in the checks below before merging — that is the behavior the issue is about.

Full make qualify was 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. actionlint and yamllint are the lanes that cover the changed file.

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert
  • Medium — Touches multiple components or has broader impact
  • High — Breaking change, affects critical paths, or complex rollout

Rollout notes: No runtime or released-artifact change. One expected behavior change for reviewers: verify-licenses now runs on more PRs — any change to Makefile, this workflow, the install or load-versions actions, 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 on main today. That extra signal is the point of the fix, but it is worth knowing before the first red run.

Checklist

  • Tests pass locally (make test with -race) — N/A, no Go source changed; actionlint + yamllint clean
  • Linter passes (make lint) — actionlint and yamllint on the changed file
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality — N/A; the filter's correctness is observable in this PR's own check run
  • I updated docs if user-facing behavior changed — N/A, no user-facing behavior change
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S) — GPG signing info

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The deps path filter in merge-gate.yaml now monitors the license-check recipe, Go and go-licenses version inputs, supporting actions, dependency files, and the workflow itself. It removes the obsolete verify-licenses.yaml path.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: mchmarny

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes remove the dead path and add the workflow, Makefile, and install action paths required by issue #2164.
Out of Scope Changes check ✅ Passed The expanded paths remain related to the license gate inputs and do not introduce unrelated code changes.
Description check ✅ Passed The description clearly explains the path-filter bug, the affected license gate, the fix, and the validation performed.
Title check ✅ Passed The title clearly and concisely states that CI should monitor the license gate's inputs in the deps path filter.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between b2e5908 and 16412fb.

📒 Files selected for processing (1)
  • .github/workflows/merge-gate.yaml

Comment thread .github/workflows/merge-gate.yaml Resolved
@yuanchen8911
yuanchen8911 marked this pull request as draft August 11, 2026 18:25
@yuanchen8911
yuanchen8911 marked this pull request as ready for review August 11, 2026 18:46

@mchmarny mchmarny left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]>
@mchmarny
mchmarny merged commit 27af274 into NVIDIA:main Aug 11, 2026
37 checks passed
@yuanchen8911
yuanchen8911 deleted the fix/2164-deps-filter branch August 19, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci size/S theme/supply-chain SLSA, SBOM, Sigstore, and provenance verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: verify-licenses gated on a deleted workflow path, so the license gate never validates changes to itself

2 participants