Repository navigation
ci(notices): generate third-party notices only when a PR changes their inputs - #274
Conversation
…r inputs The notices job downloads licence texts from crate repositories and musl.libc.org, so an outage at either site turned unrelated PRs red, and since CI Gate it blocks the gate too. Generate only when Cargo.lock, Cargo.toml, scripts/third_party_notices or ci.yml change; otherwise the job succeeds with a notice, since CI Gate treats a skipped job as a failure. Anything other than a PR merge commit still generates. Closes V2-1815 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaidSafe-Hermes
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES
Coverage: 2/2 seats reviewed (sol-1 gpt-6.1-sol xhigh; glm-1 z-ai/glm-5.3). Both seats reviewed the same frozen head and raised input-coverage questions; I verified the workflow and generator paths below.
- [P2] Watch toolchain pin changes that alter generated notices —
.github/workflows/ci.yml:97-98
The filter skips generation for a PR that adds or changes rust-toolchain / rust-toolchain.toml, because neither path is watched. That can change the rustc used by generate.py: its musl_copyright() reads rustc -vV, looks up that compiler commit’s musl.sh, and adds that musl release’s COPYRIGHT; the rendered notice also contains toolchain-provided Rust standard-library copyright text. Thus this PR can change the generated notices while generate=false skips the check. Please include toolchain pin files in the watched paths (or derive the watched inputs from the generator’s actual dependencies).
The merge-parent comparison, fail-safe branch and conditional step gating look sound. The PR’s Third-party notices check exercises generation because ci.yml itself changed, so the new no-generation path was not exercised by this run. CI Gate passes; Security Audit fails outside that gate and is separate from this code verdict.
…any manifest changes Hermes round 1 (P2): a PR that adds or changes rust-toolchain or rust-toolchain.toml skipped generation, yet rustup prefers that pin to the stable toolchain the job installs. That changes the rustc that generate.py reads with `rustc -vV` to pick the musl release, and the toolchain ships the standard library's copyright text, so the notices change too. The job now watches every input of the generator that a PR can change: every Cargo manifest (a nested one too, not only the root), Cargo.lock, .cargo (source replacement, path overrides), both toolchain-pin file names, scripts/third_party_notices and ci.yml. Checked against simulated PR merge commits: a toolchain pin of either name, a nested manifest and .cargo/config.toml now generate (all four skipped before); README-only, source-only and lookalike names such as docs/Cargo.toml.md still skip; a non-merge HEAD still generates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaidSafe-Hermes
left a comment
There was a problem hiding this comment.
APPROVE
Coverage: 2/2 seats reviewed (sol-1 gpt-6.1-sol xhigh; glm-1 z-ai/glm-5.3). The prior finding is fixed: rust-toolchain and rust-toolchain.toml are now watched. The :(glob)**/Cargo.toml pathspec matches both root and nested manifests; .cargo covers its tracked descendants. I verified these match behaviors locally, including non-matching lookalike filenames. The merge-parent comparison and conditional step flow look correct.
All CI Gate prerequisites and CI Gate pass at this head, including Ubuntu, macOS and Windows tests. Security Audit still fails outside CI Gate; it is not part of this code verdict, but remains separate merge-readiness work. The new generate=false branch is not exercised by this PR because ci.yml itself triggers generation; path-filter matching was checked locally.
Brings in main up to 360d472: OS-assigned ports for e2e test nodes (WithAutonomi#281) and devnet nodes (WithAutonomi#282), release-key and signature checks (WithAutonomi#276), the third-party notices and audit-regression CI gates (WithAutonomi#274, WithAutonomi#275), the 10 s DHT request timeout for test nodes (WithAutonomi#277), and the 0.24.0 release (WithAutonomi#283). One conflict, in tests/e2e/harness.rs: main removed the network bring-up retry on a fresh port range together with NETWORK_START_ATTEMPTS and its `warn` import, and this branch had added two helpers next to them (POSSESSION_PENALTY_TRUST_RATIO and parseable_single_node_proof). The resolution keeps both helpers and takes main's removal.
Linear issue
Closes V2-1815
The
noticesjob regenerated THIRD-PARTY-NOTICES.txt on every PR. Generation downloads licence texts from crate repositories (GitHub) and musl's COPYRIGHT from musl.libc.org, so an outage at either site turned unrelated PRs red. Example: run 41611316872,request failed after retries: https://musl.libc.org/releases/musl-1.2.5.tar.gz: … handshake operation timed out. Since #269 the job is inCI Gate, so a flake like that now blocks the gate too.The job now generates only when the PR changes something the notices are generated from:
**/Cargo.toml, a nested one too) andCargo.lock, whichcargo treeandcargo metadataread;.cargo, cargo's own config (source replacement, path overrides);rust-toolchainorrust-toolchain.toml. rustup prefers it to the stable toolchain the job installs.rustc -vVpicks the musl release, and the toolchain ships the standard library's copyright text (round 2);scripts/third_party_notices/**;ci.ymlitself, which holds the generator's arguments.Release-promotion PRs touch
Cargo.toml/Cargo.lock, so they still generate.fetch-depth: 2, the checkout has the PR's merge commit and its first parent, the base tip. A new first step diffs the two over those paths.::notice::and the toolchain, Python and generate steps are skipped. The job still succeeds, becauseCI Gatecounts a skipped job as a failure.What this gives up: a new rustc stable can move the musl version without any PR changing. The release workflow regenerates the notices for every build anyway, so it catches that. The job comment says so.
I didn't take the ticket's other option, caching fetched texts. CI runs only on
pull_request(V2-1353), and an Actions cache written on one PR's ref can't be read by another PR. A cache would only help re-runs of the same PR.Risk tier
Compatibility
Semver impact
Test evidence
actionlint .github/workflows/ci.yml: clean.I ran the new step's script, extracted from the YAML, against local repos:
README.mdgenerate=false, notice printedCargo.lockgenerate=true, listsCargo.lock--depth 2clone (asactions/checkoutgives)generate=falsegenerate=true(fail safe)Round 2: the step's script, extracted from the YAML, run against simulated PR merge commits, before (6169749) and after (f6b0393):
rust-toolchain.tomlrust-toolchaincrates/x/Cargo.toml.cargo/config.tomlCargo.toml/Cargo.lock/ generator /ci.ymlREADME.mdonly /src/main.rsonlydocs/Cargo.toml.md,docs/xCargo.tomlactionlintis clean on f6b0393.On this PR the job should generate, because
ci.ymlchanged. The skip path shows on the next PR that leaves those paths alone.New dependency
none
ADR
n/a
Mitigation / rollback
Revert the PR, and the job generates on every PR again.
🤖 Generated with Claude Code