Skip to content

fix(vscode,docs): gitignore .env in scaffolded projects; finish the docs.rocketride.org rename - #1737

Open
ptlnextdoor wants to merge 3 commits into
rocketride-org:developfrom
ptlnextdoor:docs/RR-1201-env-gitignore-and-stale-extension-claim
Open

fix(vscode,docs): gitignore .env in scaffolded projects; finish the docs.rocketride.org rename#1737
ptlnextdoor wants to merge 3 commits into
rocketride-org:developfrom
ptlnextdoor:docs/RR-1201-env-gitignore-and-stale-extension-claim

Conversation

@ptlnextdoor

@ptlnextdoor ptlnextdoor commented Jul 29, 2026

Copy link
Copy Markdown

Closes #1201. Closes #1534.

#1201.env holds a real key and wasn't gitignored

Connecting to a self-hosted engine writes a live ROCKETRIDE_APIKEY into the workspace .env (Connection.syncEnvFile, apps/vscode/src/connection/connection.ts:280), but ensureGitignore only ever added .rocketride/. A fresh scaffolded project was one git add . from committing that key.

  • ensureGitignore now reconciles a list of entries (.rocketride/, .env) and appends only what's missing, so re-running never duplicates a line.
  • The pure reconciliation moved to apps/vscode/src/shared/util/gitignoreEntries.ts. That directory is vscode-free, so it's unit-testable — the same seam envFile.ts already uses for exactly this reason. agent-manager.ts imports vscode at module scope and can't be loaded under node:test.
  • Matching is on exact trimmed lines. A user who already wrote *.env keeps their own rule and gets one redundant line at worst; silently trusting a pattern we didn't write seemed worse than that. Both cases are tested.
  • .env does not match .env.example, so the example file stays committable. Also tested, since that's the property the whole "commit only the example" instruction rests on.

Docs, per the issue's follow-ups:

  • new checklist step: make sure .env is gitignored, commit only the example
  • env.example.env.example (ROCKETRIDE_README.md, and ROCKETRIDE_COMPONENT_REFERENCE.md:441)
  • replaced "open .env as a visible tab" with confirming the variable names the pipeline actually expects

The issue mentions the packages/agents-core copy from #1034/#1110 and a docs-sync.ts — neither exists on develop yet, so there's nothing to mirror. Whoever lands those will want to carry GITIGNORE_ENTRIES across.

#1534 — three .ai references, not one

The issue names .github/ISSUE_TEMPLATE/config.yml. Two others were still live:

  • .github/SUPPORT.md:7
  • packages/client-python/src/rocketride/__init__.py:54 — the rocketride package docstring, which ships to PyPI and is the most user-visible of the three

grep -rn "docs.rocketride.ai" is now empty.

On #1200 — I think it's already fixed, please close

Not touched here, because the behaviour it reports as removed is back. #1200 says #803 deleted the extension's .env handling, so the checklist line is false. On develop:

  • Connection.syncEnvFile (connection.ts:280) writes ROCKETRIDE_URI / ROCKETRIDE_APIKEY into the workspace .env
  • resolveConnectionEnv (shared/util/envFile.ts:163) gates it: development group only, self-hosted modes only, cloud skipped because an OAuth token isn't a usable SDK key

The current checklist line — "On connect to a self-hosted engine (local/docker/service/onprem), the extension auto-populates .env … for cloud, set ROCKETRIDE_APIKEY manually" — matches that exactly. Rewriting it per #1200 to say the agent must create .env itself would make the doc wrong.

One nuance the line leaves out, if you want it tightened: only the development connection group writes .env — the deployment group deliberately never touches it. Happy to add that in a follow-up.

Verification

  • npx tsx --test src/test/gitignoreEntries.test.ts8 passed
  • npx tsc --noEmit -p apps/vscode/tsconfig.json0 errors
  • npx prettier --check on all changed TS → clean
  • grep -rn "docs.rocketride.ai" → no matches

I don't have the engine build locally, so builder targets haven't been run.

Summary by CodeRabbit

  • Documentation

    • Updated documentation, support, issue template, and package links to the new docs.rocketride.org site.
    • Clarified environment variable setup, including .env and .env.example requirements.
    • Added guidance to verify all pipeline-required environment variables.
  • Bug Fixes

    • Projects now automatically exclude both .rocketride/ and .env from version control.
    • Improved .gitignore updates to preserve existing content, formatting, and avoid unnecessary rewrites.

…rg#1201)

Connecting to a self-hosted engine writes a real ROCKETRIDE_APIKEY into
the workspace .env (Connection.syncEnvFile), but ensureGitignore only ever
added `.rocketride/`. A fresh project was one `git add .` away from
committing a live key.

- ensureGitignore now reconciles a list of entries (`.rocketride/`, `.env`)
  and appends only the missing ones, so it never duplicates a line.
- The pure reconciliation moves to shared/util/gitignoreEntries.ts, which
  is vscode-free and therefore unit-testable -- the same seam envFile.ts
  already uses. Matching is on exact trimmed lines: a user who wrote
  `*.env` keeps their own rule and gets a redundant line at worst, which
  beats us second-guessing their config.
- Agent checklist: adds an explicit "make sure .env is gitignored" step,
  renames `env.example` -> `.env.example` (also in COMPONENT_REFERENCE),
  and replaces "open .env as a visible tab" with verifying the variable
  names the pipeline actually expects.

Note `.env` does not match `.env.example`, so the example file stays
committable -- covered by a test.

Verified: 8/8 node:test pass; tsc --noEmit clean; prettier clean.
…g#1534)

The issue names .github/ISSUE_TEMPLATE/config.yml, but two more remained:
.github/SUPPORT.md and the rocketride package docstring in
packages/client-python/src/rocketride/__init__.py -- the last of which
ships to PyPI and is the most user-visible of the three.

`grep -rn docs.rocketride.ai` is now empty.
@ptlnextdoor
ptlnextdoor requested a review from kwit75 as a code owner July 29, 2026 22:16
Copilot AI review requested due to automatic review settings July 29, 2026 22:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added docs Documentation module:client-python Python SDK and MCP client module:vscode VS Code extension ci/cd CI/CD and build system labels Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 53bb58c9-6cf6-4a61-b76a-ed86afaee535

📥 Commits

Reviewing files that changed from the base of the PR and between 703c14a and 8331b39.

📒 Files selected for processing (2)
  • apps/vscode/src/shared/util/gitignoreEntries.ts
  • apps/vscode/src/test/gitignoreEntries.test.ts

📝 Walkthrough

Walkthrough

The PR adds reusable .gitignore reconciliation for .rocketride/ and .env, tests its matching and formatting behavior, updates environment setup guidance, and changes documentation links to docs.rocketride.org.

Changes

Gitignore protection and documentation updates

Layer / File(s) Summary
Gitignore reconciliation and validation
apps/vscode/src/shared/util/gitignoreEntries.ts, apps/vscode/src/agents/agent-manager.ts, apps/vscode/src/test/gitignoreEntries.test.ts
Shared helpers detect missing entries and append .rocketride/ and .env without rewriting unchanged files. Tests cover matching, formatting, and append behavior.
Documentation and domain updates
docs/agents/*, .github/ISSUE_TEMPLATE/config.yml, .github/SUPPORT.md, packages/client-python/src/rocketride/__init__.py
Environment setup guidance now references .env.example, .env protection, and expected variables. Documentation links use docs.rocketride.org.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AgentManager
  participant GitignoreUtility
  participant Workspace
  AgentManager->>Workspace: Read .gitignore
  AgentManager->>GitignoreUtility: Reconcile .rocketride/ and .env
  GitignoreUtility-->>AgentManager: Updated content or null
  AgentManager->>Workspace: Write only when content changed
Loading

Possibly related issues

  • rocketride-org/rocketride-server#1534 — Directly matches the documentation contact-link domain update.
  • rocketride-org/rocketride-server#1200 — Covers the environment setup guidance updated in this PR.

Possibly related PRs

Suggested reviewers: jmaionchi, rod-christensen, stepmikhaylov

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: ignoring .env in scaffolded VS Code projects and completing the documentation domain rename.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/vscode/src/shared/util/gitignoreEntries.ts

Oops! Something went wrong! :(

ESLint: 9.39.5

TypeError: expand is not a function
at Minimatch.braceExpand (/node_modules/.pnpm/minimatch@3.1.5/node_modules/minimatch/minimatch.js:271:10)
at Minimatch.make (/node_modules/.pnpm/minimatch@3.1.5/node_modules/minimatch/minimatch.js:180:33)
at new Minimatch (/node_modules/.pnpm/minimatch@3.1.5/node_modules/minimatch/minimatch.js:156:8)
at doMatch (/node_modules/.pnpm/@eslint+config-array@0.21.2/node_modules/@eslint/config-array/dist/cjs/index.cjs:422:13)
at match (/node_modules/.pnpm/@eslint+config-array@0.21.2/node_modules/@eslint/config-array/dist/cjs/index.cjs:756:11)
at /node_modules/.pnpm/@eslint+config-array@0.21.2/node_modules/@eslint/config-array/dist/cjs/index.cjs:772:10
at Array.some ()
at pathMatches (/node_modules/.pnpm/@eslint+config-array@0.21.2/node_modules/@eslint/config-array/dist/cjs/index.cjs:767:44)
at /node_modules/.pnpm/@eslint+config-array@0.21.2/node_modules/@eslint/config-array/dist/cjs/index.cjs:1368:8
at FlatConfigArray.forEach ()

apps/vscode/src/test/gitignoreEntries.test.ts

Oops! Something went wrong! :(

ESLint: 9.39.5

TypeError: expand is not a function
at Minimatch.braceExpand (/node_modules/.pnpm/minimatch@3.1.5/node_modules/minimatch/minimatch.js:271:10)
at Minimatch.make (/node_modules/.pnpm/minimatch@3.1.5/node_modules/minimatch/minimatch.js:180:33)
at new Minimatch (/node_modules/.pnpm/minimatch@3.1.5/node_modules/minimatch/minimatch.js:156:8)
at doMatch (/node_modules/.pnpm/@eslint+config-array@0.21.2/node_modules/@eslint/config-array/dist/cjs/index.cjs:422:13)
at match (/node_modules/.pnpm/@eslint+config-array@0.21.2/node_modules/@eslint/config-array/dist/cjs/index.cjs:756:11)
at /node_modules/.pnpm/@eslint+config-array@0.21.2/node_modules/@eslint/config-array/dist/cjs/index.cjs:772:10
at Array.some ()
at pathMatches (/node_modules/.pnpm/@eslint+config-array@0.21.2/node_modules/@eslint/config-array/dist/cjs/index.cjs:767:44)
at /node_modules/.pnpm/@eslint+config-array@0.21.2/node_modules/@eslint/config-array/dist/cjs/index.cjs:1368:8
at FlatConfigArray.forEach ()


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/vscode/src/agents/agent-manager.ts (1)

318-339: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Document this extension-surface change under apps/vscode/docs/.

ensureGitignore now modifies workspace files and protects .env, which is user-visible VS Code extension behavior. The supplied documentation changes are under docs/agents/, but the repository rules require VS Code extension-surface changes to be documented in apps/vscode/docs/.

As per coding guidelines, VS Code extension-surface changes must be documented in apps/vscode/docs/. As per path instructions, this requirement applies to changes under apps/vscode/src/**/*.{ts,tsx}.

🤖 Prompt for 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.

In `@apps/vscode/src/agents/agent-manager.ts` around lines 318 - 339, Document the
user-visible behavior of ensureGitignore in apps/vscode/docs/, including that it
creates or updates the workspace .gitignore and protects .env entries. Do not
rely on documentation under docs/agents/; add or update the appropriate VS Code
extension documentation to cover this extension-surface change.

Sources: Coding guidelines, Path instructions

🤖 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 `@apps/vscode/src/shared/util/gitignoreEntries.ts`:
- Around line 48-54: Update appendGitignoreEntries to preserve the original
content, including trailing whitespace and blank lines, instead of calling
trimEnd. Add a newline separator only when content does not already end with
"\n", while ensuring whitespace-only content does not receive an unintended
leading newline.

---

Outside diff comments:
In `@apps/vscode/src/agents/agent-manager.ts`:
- Around line 318-339: Document the user-visible behavior of ensureGitignore in
apps/vscode/docs/, including that it creates or updates the workspace .gitignore
and protects .env entries. Do not rely on documentation under docs/agents/; add
or update the appropriate VS Code extension documentation to cover this
extension-surface change.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 56d4a031-3d00-4372-b435-e144070cba2f

📥 Commits

Reviewing files that changed from the base of the PR and between 6c1e33d and 703c14a.

📒 Files selected for processing (8)
  • .github/ISSUE_TEMPLATE/config.yml
  • .github/SUPPORT.md
  • apps/vscode/src/agents/agent-manager.ts
  • apps/vscode/src/shared/util/gitignoreEntries.ts
  • apps/vscode/src/test/gitignoreEntries.test.ts
  • docs/agents/ROCKETRIDE_COMPONENT_REFERENCE.md
  • docs/agents/ROCKETRIDE_README.md
  • packages/client-python/src/rocketride/__init__.py

Comment thread apps/vscode/src/shared/util/gitignoreEntries.ts
…ketride-org#1737 review)

appendGitignoreEntries trimmed the content before appending, which dropped
any blank lines the user left at the end of their .gitignore. It also
emitted a leading newline for whitespace-only content, because the
separator was decided from the untrimmed string while the prefix used the
trimmed one.

Now the existing text is preserved byte-for-byte and a separator is added
only when it does not already end in a newline. A hand-edited .gitignore
is the user's file; reformatting it while adding one line is how a tool
loses trust.

Two regression tests added for the whitespace-only and trailing-blank-line
cases. 10/10 node:test pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/cd CI/CD and build system docs Documentation module:client-python Python SDK and MCP client module:vscode VS Code extension

Projects

None yet

2 participants