fix(agents): gitignore .env and correct env-handling docs#1233
Conversation
…-org#1201) The agent setup checklist tells coding agents to write ROCKETRIDE_APIKEY into .env, but the extension's gitignore scaffolding only covered .rocketride/, so a fresh project could commit a real API key. - ensureGitignore now ensures both .rocketride/ and .env, appending only the entries that are missing. .env.example holds no secrets and is not matched by the .env rule, so it stays committable. - Docs: rename env.example -> .env.example (README + COMPONENT_REFERENCE), add a checklist step to gitignore .env and commit only .env.example, and replace "open .env as a tab" with verifying variable names so secrets aren't surfaced in a visible editor tab. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🤖 Internal: Discord sync markerAuto-managed by the Discord notification workflow. Stores the linked Discord message ID. Do not edit or delete. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe PR hardens environment file security by ensuring ChangesEnvironment file security hardening
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
The agent setup checklist (
docs/agents/ROCKETRIDE_README.md) has coding agents writeROCKETRIDE_APIKEYinto.env, but the extension's gitignore scaffolding only added.rocketride/(apps/vscode/src/agents/agent-manager.ts). So a fresh project can end up holding a real API key in.envthat the auto-generated.gitignoredoesn't cover. This closes that gap.Changes
Code —
apps/vscode/src/agents/agent-manager.tsensureGitignorenow ensures both.rocketride/and.envare present, appending only the entries that are missing (still an exact-line, idempotent match — re-runs add nothing)..env.examplecarries no secrets and is not matched by the.envrule, so it stays committable.Docs
ROCKETRIDE_README.md/ROCKETRIDE_COMPONENT_REFERENCE.md: renameenv.example→.env.example..envis gitignored and commit only.env.example..envfile in the workspace editor (as a tab)" with verifying the variable names/values, so secrets aren't surfaced in a visible editor tab.Scope notes
packages/agents-core(the verbatim copy mentioned in feat/RR-1024-cli-rocketride-init #1034 / refactor(vscode): consume @rocketride/agents-core (RR-1024 P3) — stacked on #1034 #1110) isn't ondevelopyet, so it's out of scope here; the same one-liner should land there when those merge..env" claim on the adjacent line is tracked separately in docs(agents): README claims the VS Code extension auto-writes .env (removed in #803) #1200 and intentionally left untouched.Verification
ensureGitignorereduces to the same behavior for the existing.rocketride/entry and additionally appends.env; missing-only logic keeps it idempotent.env.example(without the leading dot) in tracked docs; no dangling references to the oldGITIGNORE_ENTRYconstant.Closes #1201
🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
.gitignorehandling to properly manage multiple configuration files including environment variables.Documentation