Skip to content

fix(ci): authenticate license URL probes in make notices - #3056

Merged
mchmarny merged 2 commits into
mainfrom
fix/notices-probe-throttling
Oct 2, 2026
Merged

mchmarny merged 2 commits into
mainfrom
fix/notices-probe-throttling

Conversation

@mchmarny

@mchmarny mchmarny commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Summary

make notices now authenticates its license-URL probes when GITHUB_TOKEN is set: each github.com/<owner>/<repo>/blob/<ref>/<path> is probed through its raw.githubusercontent.com equivalent. The merge-gate notices-generator step now passes the workflow token. The release job already exports GITHUB_TOKEN to make release, so the tag build picks this up with no change.

Motivation / Context

Since 2026-10-02, GitHub rate-limits the ~760 anonymous HEAD probes from Actions runner IPs (mostly 503, some 429). That makes notices-generator fail on every run and turns main red on every push (d41c86a). The same URLs resolve from a workstation, so the URLs aren't broken. The release build runs the same generator, so this also exposes the v1.0.0-rc1 tag.

Fixes: #3055
Related: N/A

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: tools/normalize-go-license-urls, .github/workflows/merge-gate.yaml (token + path filter), RELEASE.md

Implementation Notes

  • What is verified does not change. raw.githubusercontent.com/<o>/<r>/<ref>/<path> resolves the same ref/path as the blob URL, including refs with slashes (sdk/azcore/v1.20.0), abbreviated SHAs, and HEAD. It also returns the same 404s; I checked the moved google/cel-go repo and a missing subdirectory LICENSE. The notices still cite the github.com URLs. A local make notices with and without a token produces byte-identical output: 466 github.com blob URLs, none from raw.githubusercontent.com.
  • Token handling.
    • The token is written to a curl --config file in the script's private temp dir (umask 077, deleted after the batch, and on exit), never passed on argv.
    • Only the raw.githubusercontent.com batch gets the config. Other license hosts (cs.opensource.google, ...) are probed in a separate, anonymous curl invocation.
    • curl drops a custom Authorization header on a cross-host redirect.
    • The merge-gate job uses pull_request (not _target) with contents: read, so the token is read-only.
  • Filter gap. The merge-gate notices path filter didn't list tools/normalize-go-license-urls, even though the generator calls it, so a change to the checker skipped its own gate. Added it. This also makes this PR's own notices-generator run prove the fix.
  • No token, no change. Without GITHUB_TOKEN the probes are exactly as before.
  • Diagnosability. When the run fails and any probe got 429/503, the error now says the probes were rate-limited rather than letting it read as dead URLs. When no token was set, it also says to set GITHUB_TOKEN.

Testing

make qualify

make qualify passes in a clean detached worktree at ed7c8f6 (rc=0, "Codebase qualification completed"). The follow-up filter commit (one YAML line) was checked with actionlint, yamllint, and the workflow tests in tools/testgrid-link-check and tools/corroborate.

  • tools/normalize-go-license-urls_test.sh has new cases for token mode:
    • output identical to anonymous mode;
    • token absent from curl argv;
    • github.com probed only via raw;
    • non-GitHub probes still made;
    • the stub fails if the auth config travels with any non-raw URL.
  • A further new case covers the rate-limit hint.
  • Mutation-checked: putting the token on argv, sending the auth config to the non-GitHub batch, and ignoring the token each fail the test.
  • make notices end to end, locally: anonymous and authenticated runs both exit 0, with identical output.
  • The real proof is this PR's own notices-generator job: the throttling only reproduces on runner IPs.

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: None. The release job already sets GITHUB_TOKEN, so the rc1 tag build uses authenticated probes automatically.

Checklist

  • Tests pass locally (make test with -race)
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality
  • I updated docs if user-facing behavior changed
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S) — GPG signing info

Signed-off-by: Mark Chmarny <mark@chmarny.com>
@mchmarny mchmarny added the theme/ci-dx CI pipelines, developer experience, and build tooling label Oct 2, 2026
@mchmarny mchmarny self-assigned this Oct 2, 2026
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/aicr/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 45c95a0f-4c5b-48e3-a867-ea15804a5751

📥 Commits

Reviewing files that changed from the base of the PR and between ed7c8f6 and 96625e0.

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

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The normalizer can use GITHUB_TOKEN to authenticate GitHub license URL probes through raw.githubusercontent.com, while keeping original URLs in its output. The merge-gate notices step now provides the token. The normalizer separates authenticated raw-host probes from other URLs and reports HTTP 429/503 responses when packages remain unreachable. Tests cover token handling, probe routing, output, and rate-limit reporting. The release instructions describe token use and rate limits.

Priority: ⬆️ High

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: lockwobr

Merge Risk: ⚪ Minimal · up to 96625

No actionable merge-blocking risk was identified in the changed workflow or probe path.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses issue #3055. make notices uses GITHUB_TOKEN for GitHub license probes through raw.githubusercontent.com. The merge-gate job supplies the token. The release job already exports t…
Out of Scope Changes check ✅ Passed The workflow change enables authentication where issue #3055 reports failures. The normalizer change implements authenticated and rate-limit-aware probes. The test changes verify this behavior. `RELEA…
Title check ✅ Passed The title clearly and concisely identifies the main change: authenticating license URL probes in CI for make notices.
Description check ✅ Passed The description directly explains the CI rate-limit problem, the token-based fix, affected workflows, implementation details, testing, and scope.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

Signed-off-by: Mark Chmarny <mark@chmarny.com>
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Coverage Report ✅

Metric Value
Coverage 85.5%
Threshold 83%
Status Pass
Coverage Badge
![Coverage](https://img.shields.io/badge/coverage-85.5%25-brightgreen)

No Go source files changed in this PR.

@mchmarny
mchmarny marked this pull request as ready for review October 2, 2026 15:38
@mchmarny
mchmarny requested review from a team as code owners October 2, 2026 15:38
@mchmarny
mchmarny requested a review from yuanchen8911 October 2, 2026 15:45
@mchmarny
mchmarny merged commit aa1f2c6 into main Oct 2, 2026
46 of 47 checks passed
@mchmarny
mchmarny deleted the fix/notices-probe-throttling branch October 2, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci area/docs size/M theme/ci-dx CI pipelines, developer experience, and build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: notices-generator fails on anonymous license probes rate-limited by github.com

2 participants