fix(setup): explain environment secret readiness - #304
Conversation
📝 WalkthroughWalkthroughSetup now detects environment-backed secrets, reports readiness in CLI and Console completion, and adds client-specific handoff guidance while keeping secret values out of generated JSON, configuration output, and browser payloads. ChangesEnvironment readiness
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Config
participant SetupCompletion
participant ClientSnippets
participant CLIConsole
Config->>SetupCompletion: extract environment references
SetupCompletion->>SetupCompletion: inspect variable availability
SetupCompletion->>CLIConsole: return readiness and next action
Config->>ClientSnippets: pass required variable names
ClientSnippets->>CLIConsole: render non-secret handoff guidance
Possibly related PRs
Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/cli/setup.ts`:
- Around line 378-381: Update src/cli/setup.ts lines 378-381 to call
inspectSetupEnvironment(requiredEnvironmentVariables) unconditionally,
preserving the returned not-required state when no references exist, and pass
that result through completion. In src/console/console-application-service.ts
lines 465-472, pass the unconditional inspection result to createSetupCompletion
so both setup flows emit not-required readiness states.
In `@src/console/console-application-service.ts`:
- Around line 941-942: Update the Console rendering logic in console-assets.ts
to display first.guidance persistently alongside the generated first.json client
snippet. Preserve the existing JSON rendering and ensure the guidance explains
required variables and process inheritance for the client handoff.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 958c4f8d-c2c3-4290-b8b6-665d1809c543
📒 Files selected for processing (12)
src/cli/client-snippets.tssrc/cli/init.tssrc/cli/main.tssrc/cli/setup.tssrc/console/console-application-service.tssrc/console/console-assets.tssrc/setup/setup-completion.tstests/client-snippets.test.tstests/console-application-service.test.tstests/console-server.test.tstests/setup-command.test.tstests/setup-completion.test.ts
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/setup/setup-completion.ts`:
- Around line 294-296: Update the missingVariables initialization in the
setup-completion validation flow to preserve all normalized
readiness.missingVariables without filtering against requiredVariables. Leave
the normalized requiredVariables handling unchanged so state-specific validation
can reject contradictory names such as missing variables that are not required.
- Around line 179-184: The env-file deferral return in the setup completion flow
must preserve all variables required by the separately launched process. Update
the `requiredVariables` field to use `readiness.requiredVariables`, while
retaining `readiness.missingVariables` only for deciding whether to defer and
keeping `missingVariables` as the missing subset.
In `@tests/setup-command.test.ts`:
- Around line 462-464: Update inspectSetupEnvironment’s readiness detection to
treat empty string environment values the same as undefined values when
determining missing setup requirements. Preserve existing handling for populated
values and ensure the “Missing from this setup process” message is emitted for
an empty SENTRY_ACCESS_TOKEN.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: c3762664-a5a2-4e21-8578-324e84f2419b
📒 Files selected for processing (10)
src/cli/client-snippets.tssrc/cli/init.tssrc/cli/main.tssrc/cli/setup.tssrc/console/console-application-service.tssrc/setup/setup-completion.tstests/client-snippets.test.tstests/console-server.test.tstests/setup-command.test.tstests/setup-completion.test.ts
Dismissed as stale after all actionable findings were resolved. Exact head c592986 passed full Linux, macOS, and Windows CI and independent review approved it. The latest CodeRabbit incremental review was rate-limited, so this dismissal does not claim a new CodeRabbit approval.
|
Final review record for
The two stale CodeRabbit change-request reviews were dismissed with this same rationale. |
* fix(console): explain filtered configurations (#302) Show aggregate discovered/ready/attention counts without exposing rejected paths, explain safe repair categories, and preserve trusted discovery containment. Includes regression contracts and all review fixes. Closes #203. * fix(console): preserve valid sessions across reloads (#303) * fix(console): resume valid sessions after reload * fix(console): explain unlock rate limiting * fix(setup): explain environment secret readiness (#304) * fix(setup): explain environment secret readiness * fix: make secret readiness guidance truthful * fix: keep readiness guidance visible * fix: preserve environment readiness invariants * fix: prevent stale readiness guidance * release: prepare v0.5.2 (#306) * release: prepare v0.5.2 * test: bind release notes to current patch * test: scope release links to fixed section
Summary
Security impact
Validation
npm test(1,797 passed; 33 platform/conditional skips)npm run test:core(425 passed; 26 platform/conditional skips)npm run test:coverage(1,797 passed; 33 skips; 95.67% statements)npm run lintnpm run typechecknpm run buildnpm run smoke:clinpm run check:packnpm run test:packageCloses #301