fix(registry): suppress X-Nono-UUID when update check is opted out - #1508
Merged
Conversation
read_installation_uuid() returned the persisted installation UUID whenever the state file existed, so registry.nono.sh requests kept sending the X-Nono-UUID identifier even after the user opted out via NONO_NO_UPDATE_CHECK or [updates] check = false. Because the first run writes the state file before any opt-out can take effect, this made the documented opt-out inaccurate in the common case. Add a single authoritative update_check_opted_out() predicate and gate read_installation_uuid() on it, so the persistent identifier is suppressed at the source for every consumer. Route start_background_check() and pack_update_hint::is_opted_out() through the same predicate to remove duplicated opt-out logic. The coarse platform/arch/CI/install-source headers are intentionally out of scope, and the on-disk state file is left untouched (transmission stops; users still delete the file to remove the stored UUID). Fixes nolabs-ai#1507 Signed-off-by: Stephen Parkinson <scparkinson@gmail.com>
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Contributor
PR Review SummarySize
Affected crates
Blast radius — ContainedThis PR touches: source code Updated automatically on each push to this PR. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1507.
Registry requests to
registry.nono.shcontinued to send the persistent installation identifierX-Nono-UUIDeven after the user opted out of the update check, whenever the update-check state file already existed on disk (the default after the firstnonorun). The opt-out (NONO_NO_UPDATE_CHECK/[updates] check = false) gated only theupdate.nono.shping, not the registry header, so the documented opt-out was inaccurate in the common case.Approach
update_check_opted_out()incrates/nono-cli/src/update_check.rs(envNONO_NO_UPDATE_CHECKpresence — any value — or config[updates] check = false).start_background_check()through it (behaviour-preserving).read_installation_uuid()on the predicate — it now returnsNonewhen opted out, suppressingX-Nono-UUIDat the source for every consumer, even if a state file was written on an earlier run. The state file is intentionally not deleted (transmission stops; users still remove the file to erase the on-disk UUID).pack_update_hint::is_opted_out()to reuse the shared predicate.registry_client.rs.The coarse fingerprinting headers (
X-Nono-Platform/Arch/CI/Install-Source) are intentionally out of scope — they remain gated by the separately-tracked master telemetry switch. This change is limited to the persistent identifier.Tests
update_check::test_read_installation_uuid_respects_opt_out— reader returns the UUID when opted in;Noneunder both the env-var and config opt-outs; state file left on disk.registry_client::context_headers_gate_uuid_on_opt_out—X-Nono-UUIDpresent when opted in, absent when opted out, whileX-Nono-Platform/X-Nono-Install-Sourceremain (pins the scope boundary).Both tests are hermetic (serialized on
ENV_LOCK, all env vars guard-managed, isolated tempHOME/XDG_STATE_HOME/XDG_CONFIG_HOME).make ciis clean locally.Files consulted
crates/nono-cli/src/update_check.rs,crates/nono-cli/src/registry_client.rs,crates/nono-cli/src/pack_update_hint.rs,crates/nono-cli/src/config/user.rs,crates/nono-cli/src/state_paths.rs,crates/nono-cli/src/config/mod.rs,crates/nono-cli/src/test_env.rs.Contributor disclosure
This PR was prepared by an AI-assisted contributor at the request of the maintainer, following the repository Coding Agent Contribution Policy (issue filed and disclosed before any code change).
Agent Compliance Check
unwrap/expectin production code (test code uses.expect()consistent with the repo's existing test convention;clippy::unwrap_usedpasses undermake ci)