Skip to content

otto: forward astro telemetry-disabled state to Otto#2130

Open
jlaneve wants to merge 2 commits into
mainfrom
otto-respect-telemetry-config
Open

otto: forward astro telemetry-disabled state to Otto#2130
jlaneve wants to merge 2 commits into
mainfrom
otto-respect-telemetry-config

Conversation

@jlaneve
Copy link
Copy Markdown
Contributor

@jlaneve jlaneve commented May 8, 2026

Summary

  • when astro telemetry is off (astro telemetry disable or ASTRO_TELEMETRY_DISABLED=1), forward that to Otto by setting OTTO_TELEMETRY_DISABLE=1 on the spawned process
  • Otto already has its own kill switch on that env var; this just wires astro-cli's existing setting through to it
  • direct otto / SDK invocations still need the env var explicitly, since they bypass astro-cli

Test plan

  • go test ./pkg/otto/... passes
  • manual: astro telemetry disable && astro otto and confirm OTTO_TELEMETRY_DISABLE=1 reaches the child env
  • manual: astro telemetry enable && astro otto and confirm the var is absent

Users who run `astro telemetry disable` (or set ASTRO_TELEMETRY_DISABLED=1)
expect that to cover anything launched via `astro otto` too. BuildEnv now
checks internal/telemetry.IsEnabled() and sets OTTO_TELEMETRY_DISABLE=1 on
the child when telemetry is off.

Otto already has its own kill switch on that env var; this just plumbs
astro-cli's existing setting through to it.
@jlaneve jlaneve requested a review from a team as a code owner May 8, 2026 18:22
BuildEnv now calls telemetry.IsEnabled(), which reaches into
config.CFG.TelemetryEnabled and panics if viper hasn't been initialized.
TestConfigSuite was already calling testUtil.InitTestConfig — TestAfSuite
wasn't, so TestBuildEnv_PrependsBinDirToPath nil-derefed in CI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coveralls-official
Copy link
Copy Markdown

Coverage Report for CI Build 0

Coverage increased (+0.002%) to 39.748%

Details

  • Coverage increased (+0.002%) from the base build.
  • Patch coverage: 7 of 7 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 65901
Covered Lines: 26194
Line Coverage: 39.75%
Coverage Strength: 9.43 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant