Repository navigation
feat(#9060)!: provision and rotate GitHub trace signing keys in repos install - #9477
Conversation
…step EnsureTraceSigningKeys plans the trace signing key of each selected GitHub repository before repos.yaml is written: a fresh install, recovery when FULLSEND_TRACE_SIGNING_KEY is missing or FULLSEND_TRACE_SIGNING_KEY_ID is absent or names a retained key, or a rotation on request. It records the installation ID and public keys in the repository's repos.yaml entry, carving a glob-covered repository into its own entry. Before any edit it refuses an entry that contradicts the committed trace_context or the key ID variable, a key ID variable that is not 16 lowercase hex characters, and a read-only manifest that must record a key. GitLab repositories are skipped without any read. convergeTraceSigningKey writes a plan before the scaffold or config commit. It reads FULLSEND_TRACE_SIGNING_KEY_ID again and stops unless its presence and value are unchanged, then deletes it, writes the seed and sets it to the new key ID, each step only after the one before succeeds. Nothing calls EnsureTraceSigningKeys yet. Signed-off-by: Dharit Shah <dhshah@redhat.com>
…ys in repos install repos install now plans trace signing keys after it records the install defaults and before it writes repos.yaml. It persists the trace_context edits with its other manifest edits, under the compare-before-write guard and the size limit, and convergence writes FULLSEND_TRACE_SIGNING_KEY and FULLSEND_TRACE_SIGNING_KEY_ID before the scaffold or config commit. - A fresh install from a writable repos.yaml gets a new installation ID and key pair. A later run writes a new pair, keeping the installation ID and retaining the previous public key, when the secret is missing or the key ID variable is missing or names a retained key. - --rotate-trace-signing-key writes a new pair for a healthy install and gives an existing install without trace_context its first keys. - Install stops before it writes repos.yaml or any key when an entry contradicts the committed trace_context or the key ID variable, when that variable is not a key ID, and when a read-only repos.yaml must record a key. From a read-only repos.yaml, a fresh install without the flag goes ahead without keys and says so. - The token-scope check and the sign-off identity lookup now run before install plans any repos.yaml edit, so a failure there leaves repos.yaml unchanged instead of recording a key that is never written. - Output shows installation and key IDs, never the seed. The progress line of the repos.yaml edit that copies a glob-covered repository into its own entry, whether the tracker default or the trace_context, names the new entry and the glob. When writing the seed or setting the key ID variable fails after the variable was deleted, the error says to keep and commit the repos.yaml the run wrote and to retry with it, since the seed may have been written. Repositories skipped for adoption get no key. GitLab repositories get no key yet, and install says so. - On GitHub, repos uninstall now deletes FULLSEND_TRACE_SIGNING_KEY_ID, so its Removed: line counts one more variable, and the orphan check counts the variable as managed. - repos uninstall --help says that only GitLab uninstall deletes .fullsend/config.yaml. BREAKING CHANGE: repos install now records each GitHub repository's trace signing keys as config.trace_context in its repos.yaml entry, on a fresh install from a writable repos.yaml and on the first --rotate-trace-signing-key run of an existing install. A repository that only a glob entry covers gets its own entry, copied from the glob, when that happens, so later edits to the glob entry do not reach it; edit its own entry instead. Keep and commit the repos.yaml edits install makes: a later install from a copy without them stops the run, except after a run that failed writing the seed or the key ID variable, when it replaces the key that run may have written without retaining it. If the copy with those edits is lost, rebuild the entry's trace_context from the block in the .fullsend/config.yaml that the last install committed. An entry that already declares trace_context by hand gets a new key pair, as a recovery, on its first install with this release; from a read-only repos.yaml that run stops. fullsend v0.37.0 through v0.55.0 refuse a repos.yaml that contains trace_context, and earlier releases cannot read this manifest format. v0.56.0 accepts it but does not manage FULLSEND_TRACE_SIGNING_KEY_ID: its repos status reports the variable as orphan drift and its repos uninstall leaves it, after which this release refuses the repository when it is declared again without keys, until the variable is deleted or the entry's trace_context is restored. Use a release with this change for every repos command on that manifest. Runs are unaffected: releases before v0.56.0 ignore the block in .fullsend/config.yaml, and v0.56.0 validates it. Signed-off-by: Dharit Shah <dhshah@redhat.com>
Document the key lifecycle in the trace context reference, the trace signing keys section and flag in the repos CLI reference, the trace_context config reference, the variable and secret inventories, the glob carve-out and repos.yaml write cases in the guides, and the parity paragraph in the Go contributor guide. GitLab keys, removing a retained key, keys from install flags and delivery to runs are marked planned. Signed-off-by: Dharit Shah <dhshah@redhat.com>
The ADR 0154 status note now says that repos install provisions the signing keys of GitHub repositories; the rest stays pending. Signed-off-by: Dharit Shah <dhshah@redhat.com>
PR Summary by QodoProvision and rotate GitHub trace signing keys during repos install
AI Description
Diagram
High-Level Assessment
Files changed (35)
|
|
🤖 Finished Review · ✅ Success · Started 1:17 PM UTC · Completed 1:28 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $4.20 |
Site previewPreview: https://fa3ca81f-site.fullsend-ai.workers.dev Commit: |
Code Review by Qodo
1.
|
|
Risk Assessment: moderate (2/5) DetailsLarge diff across 39 files with breaking manifest changes and moderate git churn is balanced by strong test coverage, zero protected or security-sensitive paths, and close alignment with a planned slice of linked issue #9060. Previous runRisk Assessment: moderate (2/5) DetailsLarge diff across 39 files with breaking manifest changes and moderate git churn is balanced by strong test coverage, zero protected or security-sensitive paths, and close alignment with a planned slice of linked issue #9060. Previous run (2)Risk Assessment: moderate (2/5) DetailsLarge diff across 35 files with moderate git churn and breaking manifest changes is balanced by strong test coverage, zero protected or security-sensitive paths, and close alignment with a planned slice of the linked issue. |
ReviewFindingsMedium
Low
Earlier findings
1 finding(s) below the Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJjb21tZW50IiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJiYWNrd2FyZC1pbmNvbXBhdGlibGUiLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvbWFuaWZlc3RfZWRpdC5nbyIsImlkIjoiZl82NGE2MjIwMzljYTcxYmI0IiwiYWN0aW9uYWJsZSI6ZmFsc2UsImRpbWVuc2lvbiI6ImNyb3NzLXJlcG8tY29udHJhY3RzIn0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYmFja3dhcmQtaW5jb21wYXRpYmxlIiwiZmlsZSI6ImludGVybmFsL2NsaS9yZXBvcy5nbyIsImlkIjoiZl9iNjgyOGJkNTZiMDdlYmM2IiwiYWN0aW9uYWJsZSI6ZmFsc2UsImRpbWVuc2lvbiI6ImNyb3NzLXJlcG8tY29udHJhY3RzIn0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYmFja3dhcmQtaW5jb21wYXRpYmxlIiwiZmlsZSI6ImludGVybmF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aGFwZSIsImZpbGUiOiJpbnRlcm5hbC9yZXBvcy90cmFjZV9rZXlzLmdvIiwiaWQiOiJmXzZhNTNhMjJjNzkxOWY3ZWQiLCJsaW5lIjo1MCwiYWN0aW9uYWJsZSI6ZmFsc2UsImRpbWVuc2lvbiI6InN0eWxlLWNvbnZlbnRpb25zIn0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYmFja3dhcmQtaW5jb21wYXRpYmxlIiwiZmlsZSI6ImludGVybmFsL2NsaS9yZXBvcy5nbyIsImlkIjoiZl9iNjgyOGJkNTZiMDdlYmM2IiwiYWN0aW9uYWJsZSI6ZmFsc2UsImRpbWVuc2lvbiI6ImNyb3NzLXJlcG8tY29udHJhY3RzIn0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYmFja3dhcmQtaW5jb21wYXRpYmxlIiwiZmlsZSI6ImludGVybmFsL3JlcG9zL3RyYWNlX2tleXMuZ28iLCJpZCI6ImZfNWFhNzEyMzcwMjdhZTg0OCIsImFjdGlvbmFibGUiOmZhbHNlLCJkaW1lbnNpb24iOiJjcm9zcy1yZXBvLWNvbnRyYWN0cyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImJyZWFraW5nLWNsaSIsImZpbGUiOiJpbnRlcm5hbC9jbGkvcmVwb3MuZ28iLCJpZCI6ImZfNmYzZGFkNWY3MTU5N2YyMCIsImFjdGlvbmFibGUiOmZhbHNlLCJkaW1lbnNpb24iOiJjcm9zcy1yZXBvLWNvbnRyYWN0cyJ9XX0= --> ReviewFindingsMedium
Low
Labels: PR changes the repos install CLI flow and Go code. Next steps:
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
waynesun09
left a comment
There was a problem hiding this comment.
Review-only pass: three MEDIUM findings, posted inline below. None of them overlaps the existing qodo or review-agent threads.
….Reason a string EnsureTraceSigningKeys replaces a nil progress with a no-op, as the other exported repos functions that take a ProgressFunc do, so a caller without one no longer panics at the first line it reports. repos install always passes one. TraceKeyPlan.Reason is a plain string, so the exported field no longer has an unexported type. The reason values and the progress output are unchanged. Signed-off-by: Dharit Shah <dhshah@redhat.com>
ManifestReadOnly counted a failed open for writing as read-only only when it was a permission error. A repos.yaml on a read-only file system, such as a Docker :ro bind mount or a ConfigMap volume, keeps its write bits and fails that open with EROFS, so it counted as writable. A fresh GitHub install, which records its trace keys in repos.yaml, then stopped at that write and converged nothing; repos uninstall tore the repository down before its manifest write failed; and repos set failed on its temporary file. isWriteDenied counts EROFS along with a permission error, so such a file takes the read-only path of a file without write permission: install goes ahead without trace keys and names the run that adds them, uninstall refuses before any teardown, and repos set reports the read-only manifest. Signed-off-by: Dharit Shah <dhshah@redhat.com>
…all refuses One repository's trace signing key refusal stopped the whole repos install: a malformed FULLSEND_TRACE_SIGNING_KEY_ID, an entry that contradicts the committed trace_context or the key ID variable, or a plain run's recovery that a read-only repos.yaml cannot record kept every other selected repository from converging. EnsureTraceSigningKeys now returns these as refusals, and repos install skips each refused repository and lists it as FAILED, as it does one that needs adoption (fullsend-ai#8511). The trace preflight runs before the tracking writeback, and the skip list also reaches that writeback, the safety and infrastructure preflights and convergence, so a refused repository gets no repos.yaml edit, no key and no commit; its commit would have replaced the committed trace_context with the entry's. A read error, or --rotate-trace-signing-key with a read-only repos.yaml, still stops the run, and that error also names every refusal. A refusal now says that install wrote nothing for the repository. A contradicting entry's remedy is to restore its trace_context from the repos.yaml the last install wrote, not to switch to that file, which would drop the keys the run recorded for other repositories. The help text and docs say which trace key problems fail one repository and which stop the run. Signed-off-by: Dharit Shah <dhshah@redhat.com>
…annot hold repos install records a new trace signing key in repos.yaml before convergence writes its seed. A run that stops a repository before its key step, at a run-level input check, at one of the repository's convergence checks or at another convergence error, leaves that key recorded without its seed, and the next run's recovery retained it. A repository that kept failing gained one retained key per attempt, and the commit that finally landed trusted every one of them. A recovery now replaces the recorded active key instead of retaining it when the secret cannot hold it: FULLSEND_TRACE_SIGNING_KEY_ID names a retained key and the committed config does not list the active key, since a key write deletes the variable before it writes the seed; or neither the variable nor the secret exists and no block of this installation is committed. Progress names the key ID it replaces. Otherwise the key stays retained: while the variable is absent and the secret exists, or after repos uninstall --uninstall-only of an install whose commit landed, install cannot tell whether the seed was written. The rule also replaces a key whose seed was written once but never committed: after --uninstall-only before the install's first commit landed, and for a hand-declared trace_context that no secret holds. The help text and docs state the rule, the failures before the key step and the growth that remains. Signed-off-by: Dharit Shah <dhshah@redhat.com>
…ery release that lacks the key ID variable On an existing install, repos install writes a new trace signing key's seed and FULLSEND_TRACE_SIGNING_KEY_ID before the commit that adds its public key to .fullsend/config.yaml is on the default branch: until the install pull request merges, also when --direct falls back to a pull request on a protected branch, and after a failed commit until a later run's commit lands. Until then the default branch's config does not list the key the secret holds, and a plain run counts the install as healthy, writes no key and delivers the commit again. The trace context reference (Writes and recovery, Rotation), the write order in the repos CLI reference and the convergence comment now say so. The write order stays. Install cannot publish the key first and switch later: the seed exists only in the run that generates it, GitHub never returns a secret's value, and v1 has one secret name. The compatibility note named v0.56.0 as the release that accepts trace_context but does not manage FULLSEND_TRACE_SIGNING_KEY_ID. v0.56.1 does the same, so the note now names the releases from v0.56.0 without this change. Signed-off-by: Dharit Shah <dhshah@redhat.com>
… when recording its trace keys Install selects a glob-covered repository with filepath.Match, which is case-sensitive, and takes the first matching glob in manifest order. The trace key step then carved the repository's own entry from the first glob that matches ignoring case. With acme/A* listed before acme/api*, acme/api, selected through acme/api*, got a copy of acme/A*, so recording its keys could change its fullsend_ref, roles or kill_switch, and the proposed-configuration safety check allows that relaxation because the copied value is declared explicitly. Glob expansion now records the glob entry that selected each repository, and the key step copies that entry. A repository selected by name that expansion does not list, such as a fork, still gets the first glob that covers it ignoring case, as its selection does. The first-install tracker default and ResolveConfigWithGlobs still match ignoring case, as in released versions. Install resolved the sign-off identities and the --fullsend-binary and --fullsend-source check before that edit, through the first glob that matches ignoring case. A repository whose copied entry differs could then fail at its scaffold commit, after its trace key and repos.yaml were written, or have those flags refused or silently ignored. Install now resolves both from the edited manifest, after the manifest edits and before the repos.yaml write, so a failure still leaves repos.yaml and the keys unwritten. Signed-off-by: Dharit Shah <dhshah@redhat.com>
…gn-off identity lookup A repository whose trace keys install refuses, that needs adoption, or whose GitLab trigger-account containment failed gets no scaffold commit, but SignoffForgesFor still counted it. With a token that has no user identity, such as a GitHub App installation token, such a repository with signoff enabled stopped the whole run at the identity lookup, before any other repository converged. Install now passes the repositories that convergence leaves out, and SignoffForgesFor leaves out an explicit entry or a concrete filter name among them. A glob entry still counts, since it may select other repositories. The --fullsend-binary and --fullsend-source check still counts a skipped repository: the flags are accepted, the other repositories converge, and the skipped one is listed as FAILED. Signed-off-by: Dharit Shah <dhshah@redhat.com>
|
qodo finding 4 (ADR status claim without pinned evidence): intentional. It's a status annotation on an accepted ADR, which docs/contributing/adrs.md allows; the commit-SHA evidence rule there is for new ADRs. The note links the key lifecycle reference the way the status already links the v1 specification. |
Thanks for the context. I agree the rule doesn't apply here. I haven't dismissed |
|
🤖 Review · ❌ Terminated · Started 12:54 AM UTC · Ended 1:05 AM UTC Commit: |
|
qodo Dismiss finding 4 as intentional. |
Dismissed |
Superseded by updated review
|
🤖 Finished Review · ✅ Success · Started 12:54 AM UTC · Completed 1:05 AM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $3.02 |
EnsureTraceSigningKeys dereferenced a nil TraceKeysConfig.Manifest, while its sibling EnsureManagedConfigDefaults returns "manifest is required". It now returns the same error. repos install, its only caller, always passes the loaded manifest, so install behaves as before. Signed-off-by: Dharit Shah <dhshah@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 12:54 PM UTC · Completed 1:02 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $2.04 |
Summary
Third slice of the trace signing key work in #9060 (ADR 0154), after #9321, #9322 and #9391.
fullsend repos installnow provisions and rotates the signing keys of GitHub repositories: the installation ID and public keys go in the repo'srepos.yamlentry asconfig.trace_context, the private seed inFULLSEND_TRACE_SIGNING_KEY, and its key ID in theFULLSEND_TRACE_SIGNING_KEY_IDvariable from the design note on #9060. Nothing reads the key at run time yet; GitLab keys, keys from install flags, removing a retained key and delivery to runs come later.Related Issue
Part of #9060
Changes
internal/repos/trace_keys.go:EnsureTraceSigningKeysplans each selected GitHub repo's key beforerepos.yamlis written (a fresh install; a recovery when the secret is missing or the key ID variable is absent or names a retained key; a rotation) and records the block in the repo's entry. A recovery moves the previous active key toretained, or replaces it when the secret cannot hold it: when the variable names a retained key and the committed config does not list the active key, or when neither the variable nor the secret exists and no block of the installation is committed. Before any edit it refuses an entry that conflicts with the committedtrace_context, the variable or another entry's installation ID, a variable that is not a key ID, and a plain run's recovery that a read-only manifest cannot record. It returns those refusals with the plans, so only the refused repo fails; a read error, or--rotate-trace-signing-keyfrom a read-only manifest, stops the run.internal/repos/trace_keys.goandinternal/repos/converge.go: before the scaffold or config commit,convergeTraceSigningKeyreads the variable again and stops unless it is unchanged, then deletes the variable, writes the seed and sets the variable, each step only after the one before succeeds. A failed step stops that repo before its commit. When the seed or variable write fails, the error says to keep and commit therepos.yamlthe run wrote and to retry with it, since the secret may already hold the new seed.internal/repos/manifest_edit.goandinternal/repos/managed_config_writeback.go:carveOutForForgereturns the name of the glob it copied, in place of the forge name no caller used. The progress line of the edit that copies a glob-covered repo into its own entry, the first-installtrackerdefault ortrace_context, names the new entry and that glob.internal/repos/manifest.go,internal/repos/manifest_edit.goandinternal/repos/trace_keys.go: glob expansion records the glob entry that selected each repo, and the key step copies that entry when it gives a glob-covered repo its own entry, so recording keys keeps the settings selection resolved, even when an earlier glob matches the repo only if case is ignored. The first-installtrackerdefault and the entry suggested for a read-only manifest still copy the first glob that matches ignoring case (repos: a glob carve-out copies a different glob entry than selection matched when the repository name differs in case #9572).internal/repos/managed_config_writeback.go:ManifestReadOnlyalso counts arepos.yamlon a read-only file system as read-only. Every fresh GitHub install now writesrepos.yaml, so a manifest on a read-only mount failed the install at that write. Install,repos uninstallandrepos setnow treat it like a file without write permission.internal/cli/repos.go: install runs the key preflight before the first-installtrackerdefault and therepos.yamlwrite, persists its edits under the compare-before-write guard and the size limit, and adds--rotate-trace-signing-key. A repo whose keys the preflight refuses is skipped like an adoption failure: no key, no first-installtrackerdefault or glob carve-out, no later preflight and no convergence; it is listed as FAILED while the other repos converge. A repo that convergence leaves out, refused or not, no longer counts for the sign-off identity lookup (SignoffForgesForininternal/repos/manifest.gotakes the list). The token-scope check moves before anyrepos.yamledit. The sign-off identity lookup, and the check that a selected repo uses--fullsend-binaryor--fullsend-source, run on the edited manifest just before therepos.yamlwrite, since an entry copied from a glob takes that glob's settings; a failure in any of these checks leaves the file unchanged and writes no key.repos uninstall --helpnow says only GitLab uninstall deletes.fullsend/config.yaml.internal/forge/forge.go,internal/repos/uninstall.goandinternal/repos/drift.go:forge.VarTraceSigningKeyIDnames the variable. On GitHub, uninstall deletes it and the orphan check counts it as managed.docs/reference/trace-context.md; indocs/cli/repos.md, the Trace signing keys section, the flag, the uninstall notes, the read-only manifest definitions and which checks run before and after therepos.yamlwrite;docs/reference/config-reference.md; the variable and secret inventories; the glob carve-out notes in the getting-started guides;cli-internals.md; and the parity paragraph indocs/contributing/go-code.md. What telemetry: implement ADR 0154 trace continuity #9060 still owes is marked planned.docs/ADRs/0154-correlate-work-item-and-behaviour-scenario-traces.md) now saysrepos installprovisions the signing keys of GitHub repositories; the rest stays pending. Context, Decision and Consequences are unchanged.Behaviour notes
feat(#9060)!): install now writesconfig.trace_contextintorepos.yamlon a fresh GitHub install from a writable file and on the first--rotate-trace-signing-keyrun of an existing install. Keep and commit those edits: a later install from a copy without them fails that repository, except after a run that failed writing the seed or the key ID variable, when it replaces the key that run may have written without retaining it. A lost entry can be rebuilt from the block in the committed.fullsend/config.yaml. An entry that declarestrace_contextby hand gets a new key pair, as a recovery, on its first install with this release: the declared active key moves toretained, or is replaced when neither the secret nor the variable exists and no block of this installation is committed; from a read-onlyrepos.yamlthat repository fails.repos.yamlthat containstrace_context, and earlier releases cannot read this manifest format. Releases from v0.56.0 without this change accept it but do not manageFULLSEND_TRACE_SIGNING_KEY_ID: theirrepos statusreports the variable as orphan drift and theirrepos uninstallleaves it, after which this release refuses the repo when it is declared again without keys, until the variable is deleted or the entry'strace_contextis restored. Use a release with this change for everyreposcommand on such a manifest. Runs are unaffected: releases before v0.56.0 ignore the block in.fullsend/config.yaml, and v0.56.0 and later validate it.trace_context; its first--rotate-trace-signing-keyrun does, one opt-in per repository. Plain-run provisioning would, on the first upgrade, copy every glob-covered install into its own entry and make every existing install depend on a committedrepos.yamledit.trackerdefault copied a glob-covered repo into its own entry. Now every GitHub repo that only a glob covers gets one when install first records its keys, copied from the glob entry that selected it, and the output names the new entry and the glob. Later glob edits, such as afullsend_refpin,kill_switchor role and resource restrictions, no longer reach that repo. Fleet-wide controls belong ingithub.config,defaults.configorgithub.fullsend_ref, but a copied entry keeps the values it copied and they still apply, so a control moved off the glob also has to be deleted from each copied entry.Removed:line ofrepos uninstallcounts one more variable, since deleting a missing variable returns no error.FULLSEND_TRACE_SIGNING_KEY_IDonce per selected GitHub repo in the preflight and once more before each key write. It also checks thatFULLSEND_TRACE_SIGNING_KEYexists when the entry has keys, or when that decides whether a keyless repo was fully uninstalled.--rotate-trace-signing-keygives it keys (repos install: convergence lists glob orgs again after the preflights #9571).repos.yamland before a repository's key step records a key it never writes. The next run replaces it, unlessFULLSEND_TRACE_SIGNING_KEY_IDis absent whileFULLSEND_TRACE_SIGNING_KEYexists, or the install's configuration was committed before an--uninstall-only; then it retains it, one retained key per failed attempt (repos install: a trace key recorded before convergence stays retained when the run stops before its key step #9570).--directfalls back to a pull request), or after a failed commit until a later run's commit lands. Until then the default branch's.fullsend/config.yamldoes not list the key the secret holds. #9060 records this for the delivery of the key to runs.Review bot
The review bot's summary lists four ids with no thread:
f_64a622039ca71bb4(glob carve-out): intentional.trace_contextis per repository, and an explicit entry replaces its glob entry instead of layering over it, so recording a key needs the repository's own entry; atrace_context-only entry would drop the glob's other settings. The new entry copies the glob entry that selected the repository, install names it, anddocs/cli/repos.md(Trace signing keys) says where fleet-wide controls go. repos: a glob carve-out copies a different glob entry than selection matched when the repository name differs in case #9572 tracks the older first-installtrackerdefault, which can copy a different glob than selection matched.f_b6828bd56b07ebc6(older releases): declared with!, the BREAKING CHANGE footer and the Releases note above, which now covers v0.56.1.f_5aa71237027ae848(hand-declaredtrace_context): declared in the Breaking note above; keys supplied through install flags come in a later PR.f_6f3dad5f71597f20(flag semantics): settled in the Existing installs note above.Testing
make lintpasses:pre-commit run --from-ref b2945ba14 --to-ref HEADruns its hooks, semgrep and gitleaks included, over every changed file.internal/repos/trace_keys_test.go,internal/repos/trace_keys_converge_test.goandinternal/cli/repos_trace_keys_test.goare new, andTestIsWriteDeniedis new ininternal/repos/config_layers_test.go. Of 86 mutants of the new code, 82 make a test fail. One survivor drops earlier failures from a failed key step's error; another makes the same change on the fresh path, where the key step's error has no earlier failures to keep, so no test can catch it. A third keeps the old permission-only check inManifestReadOnly; only the read-only disk-image check below catches it. The fourth matches the recorded glob ignoring case, which is equivalent because manifest validation rejects entry names that differ only in case.go test -race -count=1overinternal/repos,internal/cli,internal/forge/...andinternal/scaffoldat the head, and over every package at 202a2f5 (internal/runtimein a separate run,internal/mintcorewith-tags github): 0 data races. On macOS, five tests fail, as they do on v0.56.0 and v0.56.1 (CA pool, temp path, two gateway-refresh timings, the arm64 install script). The twoTestRunAgenttests that call the live GitHub API (TestRunAgent_URLRefsNoOrgConfig calls api.github.com and hangs when the call is rate limited #9372) were skipped.golangci-lint run --new-from-rev b2945ba14 ./...reports 0 issues.pre-commitand the race tests ofinternal/repos,internal/forge/...andinternal/scaffoldand of thereposcommands ininternal/cli, apart from the same macOS failures.repos.yamlon a read-only file system, checked on macOS with a read-only disk image (not in CI): install converges without keys and prints the not-provisioned notice, where it failed at therepos.yamlwrite before;repos uninstallrefuses the manifest before any teardown;repos setreports the read-only manifest.carveOutGlobEntry's return for a name no glob covers.Checklist
!for breaking changes)