fix(init): honor RTK_TELEMETRY_DISABLED in consent prompt (#1307)#1369
Open
ousamabenyounes wants to merge 1 commit intortk-ai:developfrom
Open
fix(init): honor RTK_TELEMETRY_DISABLED in consent prompt (#1307)#1369ousamabenyounes wants to merge 1 commit intortk-ai:developfrom
ousamabenyounes wants to merge 1 commit intortk-ai:developfrom
Conversation
`rtk init -g --hook-only --auto-patch` hangs in non-interactive environments (devcontainer postCreateCommand, some CI agents) when `is_terminal()` returns true on a pseudo-TTY that nobody can answer. Setting `RTK_TELEMETRY_DISABLED=1` used to only gate `telemetry::maybe_ping`, so the documented workaround still hit the blocking prompt. Short-circuit `prompt_telemetry_consent` on that env var before the TTY heuristic so the init flow exits cleanly in any non-interactive context. Fixes rtk-ai#1307
Collaborator
📊 Automated PR Analysis
SummaryFixes a hang in Review Checklist
Linked issues: #1307 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
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
prompt_telemetry_consentwhenRTK_TELEMETRY_DISABLED=1sortk initno longer hangs in non-interactive environments (devcontainerpostCreateCommand, CI agents with pseudo-TTY) whereis_terminal()alone is not enough.telemetry::maybe_ping, so both the prompt and the ping honour the documented opt-out consistently.Fixes #1307
Test plan
cargo fmt --all && cargo clippy --all-targets && cargo test— 1591 pass, 0 clippy errors, format cleantest_telemetry_disabled_by_env_honors_opt_outcovers unset,"1", and common non-"1"values ("0","true","false","yes","no","") — bundled in one#[test]to serialize env-var mutations.