Skip to content

fix: filter existing paths for apispec in workspace#7104

Merged
bijin-bruno merged 1 commit intousebruno:mainfrom
naman-bruno:bugfix/spec-filter
Feb 11, 2026
Merged

fix: filter existing paths for apispec in workspace#7104
bijin-bruno merged 1 commit intousebruno:mainfrom
naman-bruno:bugfix/spec-filter

Conversation

@naman-bruno
Copy link
Collaborator

@naman-bruno naman-bruno commented Feb 11, 2026

Description

JIRA

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

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

  • Bug Fixes
    • Improved reliability of workspace API specification loading by skipping specifications with missing or inaccessible file paths.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 11, 2026

Walkthrough

The PR adds filesystem validation to the workspace API specs loader. After resolving relative paths to absolute ones, specs with non-existent file paths are filtered out. This prevents loading invalid entries during workspace initialization.

Changes

Cohort / File(s) Summary
Workspace API Specs Validation
packages/bruno-electron/src/ipc/workspace.js
Added .filter() to remove specs with missing or non-existent file paths after resolving relative paths to absolute ones using fs.existsSync() check.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

size/XS

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • bijin-bruno

Poem

✨ Paths resolved, then validated with care,
Non-existent specs filtered from the air,
Workspace loads only what's really there! 📁

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: filtering existing paths for API specs in the workspace, which aligns with the implemented fix in the code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
packages/bruno-electron/src/ipc/workspace.js (1)

214-224: Good fix — mirrors the existing collections pattern nicely.

The filtering of non-existent spec paths is a solid defensive measure that aligns well with how collections are handled in prepareWorkspaceConfigForClient (lines 36–43).

One minor inconsistency: line 219 uses path.join(workspacePath, spec.path) while the analogous collections code at line 39 uses path.resolve(workspacePath, collection.path). path.resolve is slightly more robust when relative paths contain .. segments. Consider using path.resolve here for consistency.

Suggested diff
       .map((spec) => {
         if (spec.path && !path.isAbsolute(spec.path)) {
           return {
             ...spec,
-            path: path.join(workspacePath, spec.path)
+            path: path.resolve(workspacePath, spec.path)
           };
         }
         return spec;
       })

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


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 and usage tips.

@bijin-bruno bijin-bruno merged commit 215c9f9 into usebruno:main Feb 11, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants