Repository navigation
feat: add default .gitignore file creation in workspace and collection - #6778
Conversation
WalkthroughAdds a default Changes
Sequence Diagram(s)sequenceDiagram
participant Renderer
participant MainIPC as Electron IPC (main)
participant FS as Filesystem
Renderer->>MainIPC: request create collection / workspace
MainIPC->>FS: write config (writeCollectionConfig / writeWorkspaceConfig)
FS-->>MainIPC: config written
MainIPC->>FS: write .gitignore (DEFAULT_GITIGNORE)
FS-->>MainIPC: .gitignore written
MainIPC->>MainIPC: compute stats / open collection
MainIPC-->>Renderer: reply collectionOpened / workspaceCreated
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/bruno-electron/src/utils/filesystem.js (1)
8-18: Add trailing newline to the gitignore content.The file content should end with a newline character per POSIX convention. Without it, Git will show "No newline at end of file" when viewing diffs.
Suggested fix
const DEFAULT_GITIGNORE = [ '# Secrets', '.env', '', '# Dependencies', 'node_modules', '', '# OS files', '.DS_Store', - 'Thumbs.db' -].join('\n'); + 'Thumbs.db', + '' +].join('\n');
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
packages/bruno-electron/src/ipc/collection.jspackages/bruno-electron/src/ipc/workspace.jspackages/bruno-electron/src/utils/filesystem.js
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CODING_STANDARDS.md)
**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions.() => {}is good
No space between function name and parentheses.func()notfunc ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly
Files:
packages/bruno-electron/src/utils/filesystem.jspackages/bruno-electron/src/ipc/workspace.jspackages/bruno-electron/src/ipc/collection.js
🧠 Learnings (2)
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.
Applied to files:
packages/bruno-electron/src/utils/filesystem.jspackages/bruno-electron/src/ipc/workspace.jspackages/bruno-electron/src/ipc/collection.js
📚 Learning: 2025-12-16T07:16:23.647Z
Learnt from: sanish-bruno
Repo: usebruno/bruno PR: 6090
File: tests/scripting/hooks/init-user-data/ui-state-snapshot.json:1-8
Timestamp: 2025-12-16T07:16:23.647Z
Learning: For e2e tests in the bruno repository: Collections that are shared between CLI and UI tests (comprehensive test suites testing core functionality) should be placed in `packages/bruno-tests/` to avoid duplication. The `tests/**/fixtures/collection` pattern should be used for test-specific collections that test particular UI behaviors or are specific to a single test file.
Applied to files:
packages/bruno-electron/src/ipc/collection.js
🧬 Code graph analysis (2)
packages/bruno-electron/src/ipc/workspace.js (1)
packages/bruno-electron/src/utils/filesystem.js (3)
writeFile(96-105)path(1-1)DEFAULT_GITIGNORE(8-18)
packages/bruno-electron/src/ipc/collection.js (1)
packages/bruno-electron/src/utils/filesystem.js (3)
writeFile(96-105)path(1-1)DEFAULT_GITIGNORE(8-18)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Unit Tests
- GitHub Check: CLI Tests
- GitHub Check: Playwright E2E Tests
- GitHub Check: SSL Tests - Windows
- GitHub Check: SSL Tests - macOS
- GitHub Check: SSL Tests - Linux
🔇 Additional comments (5)
packages/bruno-electron/src/utils/filesystem.js (1)
471-471: LGTM!Export addition is correctly placed and follows the existing pattern.
packages/bruno-electron/src/ipc/collection.js (2)
27-52: LGTM!Import addition is correct and follows the existing destructuring pattern.
164-165: LGTM!The
.gitignorecreation is correctly placed after config generation. Error handling via the outer try-catch is appropriate.Consider whether
renderer:clone-collectionandrenderer:import-collectionshould also create a.gitignoreif one doesn't already exist in the source. Currently onlyrenderer:create-collectioninitializes it.packages/bruno-electron/src/ipc/workspace.js (2)
8-8: LGTM!Import extension is correct. The destructured imports follow the existing pattern.
89-89: LGTM!The
.gitignorecreation mirrors the collection creation flow, maintaining consistency. Placement afterwriteWorkspaceConfigis appropriate.
Description
JIRA: https://usebruno.atlassian.net/browse/BRU-1441
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.