Repository navigation
fix: handle ellipsis folder names during Postman import - #8846
Ms-Kulkarni wants to merge 1 commit into
Conversation
WalkthroughThe filesystem name sanitizer now replaces ChangesName sanitization
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/bruno-electron/src/utils/filesystem.js (1)
244-244: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for ellipsis names.
Line 244 changes the sanitizer contract, but the adjacent
packages/bruno-electron/src/utils/filesystem.test.jssuite does not test this behavior. Add cases for an exact...name and an embedded sequence such asparent...child.Proposed test
+ it('should replace ellipsis sequences with underscores', () => { + expect(sanitizeName('...')).toEqual('_'); + expect(sanitizeName('parent...child')).toEqual('parent_child'); + });🤖 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 `@packages/bruno-electron/src/utils/filesystem.js` at line 244, Add regression cases in the filesystem sanitizer tests for an exact "..." name and an embedded "parent...child" sequence, asserting both are sanitized to underscores according to the replacement in the name-sanitization logic.
🤖 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.
Nitpick comments:
In `@packages/bruno-electron/src/utils/filesystem.js`:
- Line 244: Add regression cases in the filesystem sanitizer tests for an exact
"..." name and an embedded "parent...child" sequence, asserting both are
sanitized to underscores according to the replacement in the name-sanitization
logic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: d32b3e02-0d35-4387-948c-9c0e8307dd90
📒 Files selected for processing (1)
packages/bruno-electron/src/utils/filesystem.js
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0c8637136
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| const sanitizeName = (name) => { | ||
| const invalidCharacters = /[<>:"/\\|?*\x00-\x1F]/g; | ||
| name = name.replace(/\.\.\./g, '_'); |
There was a problem hiding this comment.
Limit ellipsis rewrite to empty path segments
When importing a Postman collection with sibling items such as api...v1 and api_v1, this global replacement maps both names to api_v1. Embedded periods were already safe because only trailing dots are stripped below, and the import paths use the sanitized name directly when creating folders/files, so this can turn previously distinct folders or requests into the same filesystem path and merge or overwrite their contents. Restrict the special case to names that would otherwise sanitize to empty, such as exactly ..., or deduplicate after sanitization.
Useful? React with 👍 / 👎.
Description
This PR fixes the Postman import issue where folders named
...(ellipsis) cause structural corruption in Bruno's collection tree. The fix replaces...with_during the sanitization process, ensuring proper folder naming and preserving the collection structure.Problem
When importing a Postman collection that contains folders named
..., Bruno mishandles these folders, causing:Fix #8845
The
sanitizeNamefunction infilesystem.jshas been updated to replace...with_(underscore) during the import process:Screenshots
| Before

| After |

Contribution Checklist:
Summary by CodeRabbit