Repository navigation
yml migration rework - #8795
yml migration rework#8795
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughThis PR replaces in-place BRU-to-YML conversion with a Redux-managed modal, cancellable Electron filesystem migration, expanded filestore worker support, targeted cache cleanup, and updated unit, integration, and end-to-end coverage. ChangesYML migration workflow
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant CollectionSettings
participant ReduxStore
participant RendererMigration
participant ElectronMigration
participant FileSystem
CollectionSettings->>ReduxStore: show migration modal
ReduxStore->>RendererMigration: start migration
RendererMigration->>ElectronMigration: invoke migration IPC
ElectronMigration->>FileSystem: parse, convert, write, and finalize files
FileSystem-->>ElectronMigration: progress or cancellation result
ElectronMigration-->>RendererMigration: reopen collection
RendererMigration-->>ReduxStore: remount collection and end migration
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js (1)
716-747: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winHeader migrate-pill entry point is still commented out.
The whole
migrate-yml-pillblock (including the just-updatedonClickhandler dispatchingshowMigrateToYmlModal) sits inside a JSX comment, so this header entry point never renders/fires. The PR's migration-workflow summary describes entry points from both collection settings and headers, but this one is currently inert dead code being kept in sync for no runtime benefit.Either restore this block (uncomment) so the header entry point actually works, or remove the dead JSX/
migratePillDismissedstate/readDismissedCollections/dismissMigratePillhelpers entirely to avoid maintaining logic that never runs.🤖 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-app/src/components/RequestTabs/CollectionHeader/index.js` around lines 716 - 747, Restore the commented-out migrate-yml-pill JSX in the collection header so the header entry point renders and its showMigrateToYmlModal handler can fire. Keep the related migratePillDismissed state, readDismissedCollections logic, and dismissMigratePill helper active and aligned with the restored block.packages/bruno-electron/src/services/mount/manager.js (1)
89-116: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winFailed cold-start leaves a zombie mount entry.
entryis registered in#mounts(line 97) before the cold-start work runs. If#reconcile/#emitTreethrows inside thetry(lines 101-111), there's nocatchto remove the entry — onlyfinallyresetsloading. A latermount()call for the samecollectionUidthen takes the "already mounted" reload branch (lines 75-84), which never callsaddWatcher, leaving the collection silently unwatched for live file changes until app restart.🔧 Proposed fix
entry.emit.loading(true); try { entry.state = this.#getIndex().entries(collectionPath); await this.#reconcile(entry); await this.#emitTree(collectionUid, entry); // skip the startup walk (already done) and stage live edits into the cache const collectionWatcher = require('../../app/collection-watcher'); collectionWatcher.addWatcher(entry.win, collectionPath, collectionUid, brunoConfig, false, false, { ignoreInitial: true, fileIndex: this.#getIndex() }); collectionWatcher.addTempDirectoryWatcher(entry.win, tempDirectoryPath, collectionUid, collectionPath); + } catch (err) { + this.#mounts.delete(collectionUid); + throw err; } finally { entry.emit.loading(false); } return tempDirectoryPath;🤖 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/services/mount/manager.js` around lines 89 - 116, Update the cold-start flow in the mount method so any failure during `#reconcile`, `#emitTree`, or watcher setup removes the newly registered collectionUid entry from `#mounts` before rethrowing. Preserve the loading reset in finally, and ensure failed mounts do not cause later mount() calls to take the already-mounted reload path.
🧹 Nitpick comments (6)
tests/utils/page/collection/migrate-to-yml.ts (1)
8-8: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winPrefer semantic selectors in the page module.
Replace
.bruno-modaland#sidebar-collection-namewith stable role/test-ID selectors, or add dedicated test IDs if no accessible selector exists.As per path instructions, page modules should use semantic selectors such as
getByRole,getByLabel, orgetByTestIdinstead of CSS selectors.Also applies to: 30-31
🤖 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 `@tests/utils/page/collection/migrate-to-yml.ts` at line 8, Update the modal locator in the page module to use a stable semantic selector via getByRole, getByLabel, or getByTestId instead of .bruno-modal, and replace the `#sidebar-collection-name` selector at the referenced lines using the same approach. Add dedicated test IDs only if no suitable accessible selector exists.Source: Path instructions
tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts (1)
66-66: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep selector ownership in page modules.
tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts#L66-L66: consume the existing overview pane locator.tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts#L74-L74: add and use a page-module locator for the missing-request message.tests/collection/migrate-to-yml/migrate-to-yml.spec.ts#L40-L50: use existing sidebar, pane, and migration locators.tests/collection/migrate-to-yml/migrate-to-yml.spec.ts#L121-L132: centralize sidebar-item and overview selectors.🤖 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 `@tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts` at line 66, Move selector ownership into the relevant page modules: in tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts:66, use the existing overview pane locator; at :74, add and use a page-module locator for the missing-request message; in tests/collection/migrate-to-yml/migrate-to-yml.spec.ts:40-50, reuse the existing sidebar, pane, and migration locators; and at :121-132, centralize the sidebar-item and overview selectors.Source: Path instructions
packages/bruno-app/src/components/MigrateCollectionToYmlModal/index.js (1)
98-110: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd progress-bar ARIA semantics.
The migration progress track/fill/label currently have no
role="progressbar"/aria-valuenow/aria-valuemin/aria-valuemax, so assistive tech gets no indication of migration progress.♿ Proposed fix
- <div className="migration-progress mt-4" data-testid="migration-progress"> - <div className="migration-progress-track"> + <div + className="migration-progress mt-4" + data-testid="migration-progress" + role="progressbar" + aria-valuenow={progressPercent} + aria-valuemin={0} + aria-valuemax={100} + > + <div className="migration-progress-track">🤖 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-app/src/components/MigrateCollectionToYmlModal/index.js` around lines 98 - 110, Add progress-bar accessibility semantics to the migration progress elements in MigrateCollectionToYmlModal: assign role="progressbar" to the migration progress track, expose progressPercent through aria-valuenow with aria-valuemin set to 0 and aria-valuemax set to 100, and associate the existing migration-progress-label via an accessible label reference.packages/bruno-electron/src/ipc/workspace.js (1)
548-561: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract shared cache-invalidation helper. Both sites perform the identical
removeWatcher→unmount→clearCollectionIndex→clearBrunoConfig→clearRequestUidsForCollectionsequence for a collection's deterministic uid; one root cause is the lack of a shared helper, leading to copy-pasted logic with divergent import styles.
packages/bruno-electron/src/ipc/workspace.js#L548-L561: replace the inlinerequire()calls (including the duplicatedrequire('./mount')) with a call to a sharedclearCollectionCaches(collectionPath, collectionUid, mainWindow, watcher)helper.packages/bruno-electron/src/ipc/yml-migration.js#L230-L243: move this block's logic into the same shared helper (using its existing top-level imports) and call it from both places.🤖 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/ipc/workspace.js` around lines 548 - 561, Extract the duplicated collection cache-invalidation sequence into a shared clearCollectionCaches(collectionPath, collectionUid, mainWindow, watcher) helper. In packages/bruno-electron/src/ipc/workspace.js lines 548-561, replace the inline requires and operations with the helper call; in packages/bruno-electron/src/ipc/yml-migration.js lines 230-243, move the existing logic into that helper and call it there, reusing the existing top-level imports and preserving the operation order.packages/bruno-filestore/src/workers/worker-script.ts (1)
56-60: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winFail fast when
parentPortis unavailable.
parentPort?.on(...)silently skips message registration when the module is loaded outside a worker, leaving queued operations unresolved. Guard explicitly, then callparentPort.on(...).🤖 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-filestore/src/workers/worker-script.ts` around lines 56 - 60, Update the worker message registration around the parentPort message handler to fail immediately when parentPort is unavailable, then register the handler with a non-optional parentPort.on call. Preserve the existing async handler logic and task processing in runTask.Source: Coding guidelines
packages/bruno-filestore/src/index.ts (1)
78-92: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd worker-boundary coverage for the new task routes.
The change adds four exported wrappers, four worker methods, and four dispatch branches, but the supplied tests only exercise direct YML format functions. Add deterministic tests through the worker API for folder/environment parsing and stringifying in both formats, including BRU folder serialization.
packages/bruno-filestore/src/index.ts#L78-L92: cover each exported wrapper.packages/bruno-filestore/src/workers/index.ts#L87-L101: verify method-to-task-type mapping.packages/bruno-filestore/src/workers/worker-script.ts#L37-L50: verify format-specific dispatch.As per coding guidelines, meaningful new functionality must have behavior-focused tests.
🤖 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-filestore/src/index.ts` around lines 78 - 92, Add deterministic behavior-focused tests covering all four exported wrappers in packages/bruno-filestore/src/index.ts (lines 78-92) through the worker API, including folder/environment parsing and stringifying for both formats and BRU folder serialization. In packages/bruno-filestore/src/workers/index.ts (lines 87-101), verify each worker method maps to the correct task type; in packages/bruno-filestore/src/workers/worker-script.ts (lines 37-50), verify format-specific dispatch for every route. No direct production change is required unless needed to make these worker-boundary tests pass.Source: Coding guidelines
🤖 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 `@packages/bruno-app/src/components/MigrateCollectionToYmlModal/index.js`:
- Around line 44-46: Update handleCancelMigration to attach a catch handler to
the promise returned by dispatch(cancelMigrateCollectionToYml(...)), matching
the existing error-handling pattern in handleMigrate and preventing rejected IPC
promises from becoming unhandled.
In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`:
- Around line 3640-3654: Preserve the original migration error while handling
remountReopenedCollection failure in the catch block: do not silently swallow a
remount timeout or other error. Surface a specific remount-failure toast and
keep the migration failure propagated, while retaining the existing
migrationEnded cleanup and cancellation behavior.
In `@packages/bruno-electron/src/ipc/yml-migration.js`:
- Around line 165-182: In the Phase 3 backup-copy loop over originalsToRemove,
call checkCancelled() before each fsExtra.copy operation, matching the per-file
cancellation behavior already used by the subsequent unlink loop. Keep the
existing backup paths and copy order unchanged.
In `@packages/bruno-filestore/src/formats/yml/parseFolder.spec.ts`:
- Around line 54-65: Narrow metadata before asserting sequence values: in
parseFolder.spec.ts lines 54-65, assert the parsed folder metadata and expected
name first, then access meta.seq directly in both tests; apply the same
metadata-existence assertion and remove optional chaining in
stringifyFolder.spec.ts lines 49-65.
In `@packages/bruno-filestore/src/formats/yml/parseFolder.ts`:
- Around line 20-23: Require finite numeric sequence values in both YML folder
handlers. In packages/bruno-filestore/src/formats/yml/parseFolder.ts lines
20-23, update the guard around meta.seq to accept only finite numbers; make the
same change before assigning info.seq in
packages/bruno-filestore/src/formats/yml/stringifyFolder.ts lines 43-49.
Preserve omission of seq for missing, non-numeric, NaN, and Infinity values.
In `@tests/collection/migrate-to-yml-cancel/migrate-to-yml-cancel.spec.ts`:
- Around line 50-73: Replace the raw page selectors and text lookup in the
migration-cancellation spec with locators and interactions exposed through
buildCommonLocators or the existing tests/utils/page helpers. Update the
progress, cancellation confirmation, sidebar collection, settings-tab, and
convert-button checks to use those helpers, and reuse
openMigrateToYmlModalFromOverview for the reopen sequence instead of duplicating
its selector chain.
In
`@tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts`:
- Around line 62-64: Replace the visibility assertions for migrated request tabs
with removal assertions using toHaveCount(0): update the root-req, users, and
deep tabs in
tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts
lines 62-64, and the ping tab in
tests/collection/migrate-to-yml/migrate-to-yml.spec.ts lines 128-132.
In `@tests/utils/page/collection/migrate-to-yml.ts`:
- Around line 28-33: The shared Electron/renderer lifecycle setup must be
corrected so both migration entry points keep the page alive through the
convert-button interaction; do not add waits. Update
openMigrateToYmlModalFromOverview in
tests/utils/page/collection/migrate-to-yml.ts at lines 28-33 and the
nested-collection migration entry point in
tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts
at lines 44-46, ensuring both use the correct shared renderer/Electron lifecycle
handling before clicking the convert button.
---
Outside diff comments:
In `@packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js`:
- Around line 716-747: Restore the commented-out migrate-yml-pill JSX in the
collection header so the header entry point renders and its
showMigrateToYmlModal handler can fire. Keep the related migratePillDismissed
state, readDismissedCollections logic, and dismissMigratePill helper active and
aligned with the restored block.
In `@packages/bruno-electron/src/services/mount/manager.js`:
- Around line 89-116: Update the cold-start flow in the mount method so any
failure during `#reconcile`, `#emitTree`, or watcher setup removes the newly
registered collectionUid entry from `#mounts` before rethrowing. Preserve the
loading reset in finally, and ensure failed mounts do not cause later mount()
calls to take the already-mounted reload path.
---
Nitpick comments:
In `@packages/bruno-app/src/components/MigrateCollectionToYmlModal/index.js`:
- Around line 98-110: Add progress-bar accessibility semantics to the migration
progress elements in MigrateCollectionToYmlModal: assign role="progressbar" to
the migration progress track, expose progressPercent through aria-valuenow with
aria-valuemin set to 0 and aria-valuemax set to 100, and associate the existing
migration-progress-label via an accessible label reference.
In `@packages/bruno-electron/src/ipc/workspace.js`:
- Around line 548-561: Extract the duplicated collection cache-invalidation
sequence into a shared clearCollectionCaches(collectionPath, collectionUid,
mainWindow, watcher) helper. In packages/bruno-electron/src/ipc/workspace.js
lines 548-561, replace the inline requires and operations with the helper call;
in packages/bruno-electron/src/ipc/yml-migration.js lines 230-243, move the
existing logic into that helper and call it there, reusing the existing
top-level imports and preserving the operation order.
In `@packages/bruno-filestore/src/index.ts`:
- Around line 78-92: Add deterministic behavior-focused tests covering all four
exported wrappers in packages/bruno-filestore/src/index.ts (lines 78-92) through
the worker API, including folder/environment parsing and stringifying for both
formats and BRU folder serialization. In
packages/bruno-filestore/src/workers/index.ts (lines 87-101), verify each worker
method maps to the correct task type; in
packages/bruno-filestore/src/workers/worker-script.ts (lines 37-50), verify
format-specific dispatch for every route. No direct production change is
required unless needed to make these worker-boundary tests pass.
In `@packages/bruno-filestore/src/workers/worker-script.ts`:
- Around line 56-60: Update the worker message registration around the
parentPort message handler to fail immediately when parentPort is unavailable,
then register the handler with a non-optional parentPort.on call. Preserve the
existing async handler logic and task processing in runTask.
In
`@tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts`:
- Line 66: Move selector ownership into the relevant page modules: in
tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts:66,
use the existing overview pane locator; at :74, add and use a page-module
locator for the missing-request message; in
tests/collection/migrate-to-yml/migrate-to-yml.spec.ts:40-50, reuse the existing
sidebar, pane, and migration locators; and at :121-132, centralize the
sidebar-item and overview selectors.
In `@tests/utils/page/collection/migrate-to-yml.ts`:
- Line 8: Update the modal locator in the page module to use a stable semantic
selector via getByRole, getByLabel, or getByTestId instead of .bruno-modal, and
replace the `#sidebar-collection-name` selector at the referenced lines using the
same approach. Add dedicated test IDs only if no suitable accessible selector
exists.
🪄 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: CHILL
Plan: Pro Plus
Run ID: 7f5bff37-0e97-49a1-b015-8164d0556c39
📒 Files selected for processing (55)
packages/bruno-app/src/components/CollectionSettings/Overview/Migration/MigrateToYmlModal/index.jspackages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.jspackages/bruno-app/src/components/MigrateCollectionToYmlModal/StyledWrapper.jspackages/bruno-app/src/components/MigrateCollectionToYmlModal/index.jspackages/bruno-app/src/components/RequestTabs/CollectionHeader/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/index.jspackages/bruno-app/src/providers/App/index.jspackages/bruno-app/src/providers/App/useIpcEvents.jspackages/bruno-app/src/providers/ReduxStore/index.jspackages/bruno-app/src/providers/ReduxStore/middlewares/snapshot/middleware.jspackages/bruno-app/src/providers/ReduxStore/slices/collection-migration.jspackages/bruno-app/src/providers/ReduxStore/slices/collection-migration.spec.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/actions.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/collection-format.spec.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/migrate-in-place.spec.jspackages/bruno-app/src/providers/ReduxStore/slices/tabs-migrate.spec.jspackages/bruno-app/src/providers/ReduxStore/slices/tabs.jspackages/bruno-electron/src/cache/requestUids.jspackages/bruno-electron/src/index.jspackages/bruno-electron/src/ipc/collection.jspackages/bruno-electron/src/ipc/mount.jspackages/bruno-electron/src/ipc/workspace.jspackages/bruno-electron/src/ipc/yml-migration.jspackages/bruno-electron/src/ipc/yml-migration.spec.jspackages/bruno-electron/src/services/mount/file-index.jspackages/bruno-electron/src/services/mount/manager.jspackages/bruno-electron/src/services/mount/manager.spec.jspackages/bruno-electron/src/services/snapshot/index.jspackages/bruno-electron/src/store/bruno-config.jspackages/bruno-electron/tests/services/snapshot-remap.spec.jspackages/bruno-filestore/src/formats/yml/parseFolder.spec.tspackages/bruno-filestore/src/formats/yml/parseFolder.tspackages/bruno-filestore/src/formats/yml/stringifyFolder.spec.tspackages/bruno-filestore/src/formats/yml/stringifyFolder.tspackages/bruno-filestore/src/index.tspackages/bruno-filestore/src/workers/WorkerQueue/index.tspackages/bruno-filestore/src/workers/index.tspackages/bruno-filestore/src/workers/worker-script.tstests/collection/migrate-to-yml-cancel/fixtures/collection/api/folder.brutests/collection/migrate-to-yml-cancel/fixtures/collection/api/get-users.brutests/collection/migrate-to-yml-cancel/fixtures/collection/bruno.jsontests/collection/migrate-to-yml-cancel/fixtures/collection/collection.brutests/collection/migrate-to-yml-cancel/fixtures/collection/environments/Local.brutests/collection/migrate-to-yml-cancel/fixtures/collection/environments/Production.brutests/collection/migrate-to-yml-cancel/fixtures/collection/ping.brutests/collection/migrate-to-yml-cancel/fixtures/collection/post-json.brutests/collection/migrate-to-yml-cancel/init-user-data/preferences.jsontests/collection/migrate-to-yml-cancel/migrate-to-yml-cancel.spec.tstests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.tstests/collection/migrate-to-yml/keep-request-tab-open.spec.tstests/collection/migrate-to-yml/migrate-to-yml.spec.tstests/utils/page/collection/migrate-to-yml.tstests/utils/page/index.tstests/utils/page/locators.ts
💤 Files with no reviewable changes (9)
- packages/bruno-app/src/components/CollectionSettings/Overview/Migration/MigrateToYmlModal/index.js
- packages/bruno-app/src/providers/ReduxStore/slices/collections/migrate-in-place.spec.js
- tests/collection/migrate-to-yml/keep-request-tab-open.spec.ts
- packages/bruno-electron/src/services/mount/manager.spec.js
- packages/bruno-electron/tests/services/snapshot-remap.spec.js
- packages/bruno-app/src/providers/ReduxStore/slices/tabs-migrate.spec.js
- packages/bruno-electron/src/services/snapshot/index.js
- packages/bruno-electron/src/ipc/collection.js
- packages/bruno-app/src/providers/ReduxStore/slices/tabs.js
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/bruno-electron/src/ipc/collection.js (2)
2570-2581: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winReject symlink traversal before exporting.
The lexical
startsWith()check can pass a path like/exports/linked-dir/../outside.json, thenwriteFile()writes throughsafeWriteFile()into the symlink target because it only sanitizes the final basename. Validate that the resolved file’s real parent stays under the selected export directory, or restrictfileNameto a basename before writing.🤖 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/ipc/collection.js` around lines 2570 - 2581, Harden the export path validation around resolvedDir, filePath, and writeFile so symlink traversal cannot escape the selected export directory. Resolve the real export directory and file parent (or restrict fileName to a basename) and reject any target whose real parent is outside the export directory before overwrite checks or writing.
2577-2581: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winMake
overwrite: falseatomic.
existsSync()is still separate fromwriteFile(), so two concurrent exports can both pass theoverwrite: falsecheck and then overwrite one another. Use the exclusive-open write path (fs.writeFile(filePath, content, { flag: 'wx' })) and keep the existingEEXISTbehavior.🤖 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/ipc/collection.js` around lines 2577 - 2581, Update the export write flow around writeFile so overwrite: false uses an atomic exclusive write with the wx flag instead of a separate existsSync check; preserve the existing path-already-exists error behavior when the write fails with EEXIST, while retaining normal writes when overwriting is enabled.
♻️ Duplicate comments (1)
tests/utils/page/collection/migrate-to-yml.ts (1)
29-35: 🩺 Stability & Availability | 🟠 MajorThe previous page-lifecycle failure is still unresolved.
This helper still reaches
convertButton().click()without fixing the Electron/renderer lifecycle. CI previously failed at this exact interaction withTarget page, context or browser has been closed; correct the shared setup before relying on this helper rather than adding waits.🤖 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 `@tests/utils/page/collection/migrate-to-yml.ts` around lines 29 - 35, Update the shared page or Electron/renderer setup used by openMigrateToYmlModalFromOverview so the target remains attached and active before convertButton().click() executes. Resolve the lifecycle issue in the common setup or locator initialization rather than adding waits in this helper, and preserve the existing navigation and modal-wait flow.Source: Pipeline failures
🤖 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.
Outside diff comments:
In `@packages/bruno-electron/src/ipc/collection.js`:
- Around line 2570-2581: Harden the export path validation around resolvedDir,
filePath, and writeFile so symlink traversal cannot escape the selected export
directory. Resolve the real export directory and file parent (or restrict
fileName to a basename) and reject any target whose real parent is outside the
export directory before overwrite checks or writing.
- Around line 2577-2581: Update the export write flow around writeFile so
overwrite: false uses an atomic exclusive write with the wx flag instead of a
separate existsSync check; preserve the existing path-already-exists error
behavior when the write fails with EEXIST, while retaining normal writes when
overwriting is enabled.
---
Duplicate comments:
In `@tests/utils/page/collection/migrate-to-yml.ts`:
- Around line 29-35: Update the shared page or Electron/renderer setup used by
openMigrateToYmlModalFromOverview so the target remains attached and active
before convertButton().click() executes. Resolve the lifecycle issue in the
common setup or locator initialization rather than adding waits in this helper,
and preserve the existing navigation and modal-wait flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a22f9a56-22d8-4c9a-87eb-2249baba42de
📒 Files selected for processing (20)
packages/bruno-app/src/components/MigrateCollectionToYmlModal/index.jspackages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.jspackages/bruno-app/src/components/RequestTabs/CollectionHeader/index.jspackages/bruno-app/src/providers/ReduxStore/middlewares/snapshot/middleware.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/actions.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/index.jspackages/bruno-electron/src/index.jspackages/bruno-electron/src/ipc/collection.jspackages/bruno-electron/src/ipc/yml-migration.jspackages/bruno-electron/src/services/mount/manager.jspackages/bruno-electron/src/services/snapshot/index.jspackages/bruno-filestore/src/formats/yml/parseFolder.spec.tspackages/bruno-filestore/src/formats/yml/parseFolder.tspackages/bruno-filestore/src/formats/yml/stringifyFolder.spec.tspackages/bruno-filestore/src/formats/yml/stringifyFolder.tstests/collection/migrate-to-yml-cancel/migrate-to-yml-cancel.spec.tstests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.tstests/collection/migrate-to-yml/migrate-to-yml.spec.tstests/utils/page/collection/migrate-to-yml.tstests/utils/page/locators.ts
💤 Files with no reviewable changes (1)
- packages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.js
🚧 Files skipped from review as they are similar to previous changes (15)
- packages/bruno-filestore/src/formats/yml/stringifyFolder.ts
- packages/bruno-filestore/src/formats/yml/parseFolder.spec.ts
- packages/bruno-electron/src/index.js
- packages/bruno-filestore/src/formats/yml/parseFolder.ts
- packages/bruno-filestore/src/formats/yml/stringifyFolder.spec.ts
- packages/bruno-electron/src/services/snapshot/index.js
- tests/collection/migrate-to-yml-cancel/migrate-to-yml-cancel.spec.ts
- tests/utils/page/locators.ts
- packages/bruno-electron/src/services/mount/manager.js
- tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts
- packages/bruno-electron/src/ipc/yml-migration.js
- packages/bruno-app/src/components/MigrateCollectionToYmlModal/index.js
- packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
- packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
- tests/collection/migrate-to-yml/migrate-to-yml.spec.ts
utkarsh-bruno
left a comment
There was a problem hiding this comment.
Took care of the coderabbit comments, rest looks good to me
|
After migrate from workspace B, workspace A still has npx playwright test \
tests/snapshots/repro-migrate-shared-workspace.spec.ts \
--project=default --reporter=line --workers=1Observed failure: Repro (desired contract; currently fails): import fs from 'fs';
import path from 'path';
import { test, expect } from '../../playwright';
import {
buildCommonLocators,
confirmMigration,
createCollection,
createRequest,
openCollection,
openMigrateToYmlModalFromOverview,
openRequest,
openWorkspaceFromDialog,
switchWorkspace,
waitForReadyPage
} from '../utils/page';
/**
* Failure chain:
* 1. Persist ReqA.bru tabs in workspace A for a shared bru collection
* 2. Open the same collection in workspace B and migrate to yml there
* 3. Migration flushSnapshotNow only rewrites the active workspace entry
* 4. serializeSnapshot preserves workspace A's ReqA.bru tabs verbatim
* 5. Switching back restores a dead "Not Found" tab against the yml collection
*/
test('migration clears stale tabs for the same collection in another workspace', async ({
launchElectronApp,
createTmpDir
}) => {
test.setTimeout(90_000);
const userDataPath = await createTmpDir('migrate-shared-workspace-user-data');
const collectionParentPath = await createTmpDir('migrate-shared-workspace-collection');
const workspaceBPath = await createTmpDir('migrate-shared-workspace-b');
const sharedCollectionPath = path.join(collectionParentPath, 'SharedCol');
fs.writeFileSync(
path.join(workspaceBPath, 'workspace.yml'),
[
'opencollection: 1.0.0',
'info:',
' name: WorkspaceB',
' type: workspace',
'collections:',
'specs: []',
"docs: ''",
''
].join('\n')
);
const app = await launchElectronApp({ userDataPath });
const page = await waitForReadyPage(app);
const locators = buildCommonLocators(page);
await test.step('Create a bru collection and persist ReqA in the default workspace', async () => {
await createCollection(page, 'SharedCol', collectionParentPath, 'bru');
await createRequest(page, 'ReqA', 'SharedCol', {
url: 'https://echo.usebruno.com',
method: 'GET'
});
await createRequest(page, 'ReqB', 'SharedCol', {
url: 'https://echo.usebruno.com',
method: 'GET'
});
await openRequest(page, 'SharedCol', 'ReqA', { persist: true });
await page.waitForTimeout(2_000);
});
await test.step('Open WorkspaceB, add the same collection, and persist ReqB', async () => {
await openWorkspaceFromDialog(app, page, workspaceBPath);
await expect(page.getByTestId('workspace-name')).toHaveText('WorkspaceB');
await app.evaluate(
({ dialog }, targetPath: string) => {
(dialog as any).showOpenDialog = () =>
Promise.resolve({ canceled: false, filePaths: [targetPath] });
},
sharedCollectionPath
);
await page.getByTestId('collections-header-add-menu').click();
await page.locator('.tippy-box .dropdown-item').filter({ hasText: 'Open collection' }).click();
await expect(locators.sidebar.collection('SharedCol')).toBeVisible();
await openCollection(page, 'SharedCol');
await openRequest(page, 'SharedCol', 'ReqB', { persist: true });
await page.waitForTimeout(2_000);
});
await test.step('Migrate the shared collection from WorkspaceB', async () => {
await openMigrateToYmlModalFromOverview(page, 'SharedCol');
await confirmMigration(page);
await expect(page.getByText('Collection migrated to YML format successfully')).toBeVisible({
timeout: 30_000
});
});
await test.step('Switch back to the default workspace and open the shared collection', async () => {
await switchWorkspace(page, 'My Workspace');
await expect(locators.sidebar.collection('SharedCol')).toBeVisible();
await openCollection(page, 'SharedCol');
});
await test.step('Stale bru tabs from the inactive workspace must not come back', async () => {
await page.waitForTimeout(2_000);
const tabLabels = await page.getByTestId('request-tab').allTextContents();
// Restored dead ReqA.bru tab is labeled "Not Found", not "ReqA".
expect(tabLabels.some((label) => /Not Found/i.test(label))).toBe(false);
});
});Fix direction if we keep shared-collection workspaces in scope: clear/remap tabs for that collection pathname across all workspace snapshot entries during migrate, or restore |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/snapshots/repro-migrate-shared-workspace.spec.ts (1)
65-65: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low valueReduce
page.waitForTimeout()usage for snapshot persistence waits.Three hardcoded 2s waits are used to let snapshot debounce/persist settle. As per path instructions, reduce
page.waitForTimeout()"unless absolutely necessary and the locator cannot be found using existingexpect()playwright calls."Also applies to: 85-85, 103-103
🤖 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 `@tests/snapshots/repro-migrate-shared-workspace.spec.ts` at line 65, Replace the three 2-second page.waitForTimeout calls in the snapshot persistence flow with existing Playwright expect-based locator assertions that wait for the persisted snapshot state. Retain a timeout only if no suitable locator assertion can observe completion, and keep the test’s snapshot verification behavior unchanged.Source: 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.
Nitpick comments:
In `@tests/snapshots/repro-migrate-shared-workspace.spec.ts`:
- Line 65: Replace the three 2-second page.waitForTimeout calls in the snapshot
persistence flow with existing Playwright expect-based locator assertions that
wait for the persisted snapshot state. Retain a timeout only if no suitable
locator assertion can observe completion, and keep the test’s snapshot
verification behavior unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 365def86-a26a-4fe0-a1ac-209508a750a6
📒 Files selected for processing (12)
packages/bruno-app/src/providers/App/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/actions.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/index.jspackages/bruno-app/src/providers/ReduxStore/slices/tabs-restore.spec.jspackages/bruno-app/src/providers/ReduxStore/slices/tabs.jspackages/bruno-electron/src/ipc/yml-migration.jspackages/bruno-electron/src/ipc/yml-migration.spec.jspackages/bruno-electron/src/services/snapshot/index.jspackages/bruno-electron/tests/services/snapshot-remap.spec.jstests/snapshots/repro-migrate-shared-workspace.spec.tstests/utils/page/index.tstests/utils/page/locators.ts
🚧 Files skipped from review as they are similar to previous changes (5)
- tests/utils/page/index.ts
- packages/bruno-app/src/providers/App/index.js
- tests/utils/page/locators.ts
- packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
- packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (4)
tests/snapshots/repro-migrate-shared-workspace.spec.ts (2)
79-80: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winInline selectors belong in a page module.
getByTestId('collections-header-add-menu')and especially the raw CSS.tippy-box .dropdown-itemshould live intests/utils/page/*and be consumed viabuildCommonLocators— the spec already imports helpers for everything else. Same forpage.getByTestId('workspace-name')(Line 70) andpage.getByTestId('request-tab')(Line 104).As per path instructions, centralize selectors and interactions in
tests/utils/page/*page modules and avoid inlinepage.locator(...)/getByTestId(...)in spec files.🤖 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 `@tests/snapshots/repro-migrate-shared-workspace.spec.ts` around lines 79 - 80, Move the inline selectors and interactions for the collections add menu, workspace name, and request tab from the spec into the appropriate page module, exposing them through buildCommonLocators. Update the spec to consume those page-module helpers instead of calling getByTestId or the raw .tippy-box .dropdown-item locator directly, while preserving the existing test flow.Source: Path instructions
103-103: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winThree fixed 2s sleeps stand in for event-driven waits. Each one waits for snapshot persistence or tab restore to settle by wall clock, which is both slow and flaky under CI load.
tests/snapshots/repro-migrate-shared-workspace.spec.ts#L103-L103: replace with an auto-retryingexpect(...)on the restored tab state (orlocator.waitFor()) before readingallTextContents().tests/snapshots/repro-migrate-shared-workspace.spec.ts#L65-L65: wait for an observable signal that the snapshot flushed (e.g. poll the snapshot file, or assert the active tab state) instead of sleeping.tests/snapshots/repro-migrate-shared-workspace.spec.ts#L85-L85: same — assertReqBis the active/visible tab rather than sleeping.As per path instructions, reduce usage of
page.waitForTimeout()unless absolutely necessary and the locator cannot be found using existingexpect()playwright calls.🤖 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 `@tests/snapshots/repro-migrate-shared-workspace.spec.ts` at line 103, Replace all three fixed page.waitForTimeout calls in tests/snapshots/repro-migrate-shared-workspace.spec.ts at lines 103-103, 65-65, and 85-85 with event-driven Playwright waits: at 103-103, auto-retry the restored tab state or use locator.waitFor() before allTextContents(); at 65-65, poll the snapshot file or assert the active tab state until persistence is observable; and at 85-85, assert that ReqB is active or visible. Preserve the existing test flow while avoiding sleeps unless no suitable locator or expect assertion exists.Source: Path instructions
packages/bruno-electron/src/ipc/yml-migration.spec.js (1)
42-42: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider covering the
migrateCollectionToYmlwrapper too.Only
migrateCollectionOnDiskis exercised. The wrapper owns the newly critical contracts —remapCollectionTabPathsreceiving thetabPathMap, andreopenCollectionrunning on success and failure — which is precisely the regression the shared-workspace e2e spec chases. All its collaborators are already mocked here, so a couple of assertions are cheap.🤖 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/ipc/yml-migration.spec.js` at line 42, Extend the yml migration tests to cover the migrateCollectionToYml wrapper, using the existing mocks for remapCollectionTabPaths and reopenCollection. Assert that the wrapper passes tabPathMap to remapCollectionTabPaths and invokes reopenCollection after both successful and failed migrations, while preserving the existing migrateCollectionOnDisk coverage.packages/bruno-electron/src/ipc/yml-migration.js (1)
87-142: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low valueAll converted content is buffered in memory before any write.
Deliberate for the atomicity guarantee, but on very large collections
conversionPlanholds every YAML payload at once. If that becomes a problem, a staging directory (write.yml.tmpper file, rename at commit) keeps the same rollback semantics with bounded memory.🤖 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/ipc/yml-migration.js` around lines 87 - 142, Review the conversion flow around conversionPlan so converted YAML is staged incrementally rather than retaining every ymlContent in memory. Write each converted payload to a temporary staging file, track the staged paths for the commit phase, and rename staged files atomically only after all parsing succeeds; preserve cancellation, parse-error handling, tabPathMap updates, and rollback semantics.
🤖 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 `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`:
- Around line 3671-3678: Update the error toast in the catch block of the
migration action to use the same null-safe error-message access as the
cancellation check, so non-Error or nullish rejections fall back to “Unknown
error” without throwing. Preserve the existing cancellation detection and toast
behavior.
In `@packages/bruno-electron/src/ipc/yml-migration.js`:
- Around line 227-232: Move the collection-format validation and bruno.json
read/parse in the migration handler into the existing try/finally or equivalent
guarded section that guarantees reopenCollection on every exit. Preserve the
current errors for already-YML collections and invalid or unreadable
configuration, while ensuring those failures still trigger reopenCollection
before propagating.
In `@tests/snapshots/repro-migrate-shared-workspace.spec.ts`:
- Around line 104-106: Strengthen the assertions around tabLabels in the
snapshot migration test: retain the check that no tab is labeled “Not Found,”
and add a positive assertion confirming the expected migrated ReqA or overview
tab is present. Ensure the test cannot pass when the collection fails to open or
no request tabs render.
---
Nitpick comments:
In `@packages/bruno-electron/src/ipc/yml-migration.js`:
- Around line 87-142: Review the conversion flow around conversionPlan so
converted YAML is staged incrementally rather than retaining every ymlContent in
memory. Write each converted payload to a temporary staging file, track the
staged paths for the commit phase, and rename staged files atomically only after
all parsing succeeds; preserve cancellation, parse-error handling, tabPathMap
updates, and rollback semantics.
In `@packages/bruno-electron/src/ipc/yml-migration.spec.js`:
- Line 42: Extend the yml migration tests to cover the migrateCollectionToYml
wrapper, using the existing mocks for remapCollectionTabPaths and
reopenCollection. Assert that the wrapper passes tabPathMap to
remapCollectionTabPaths and invokes reopenCollection after both successful and
failed migrations, while preserving the existing migrateCollectionOnDisk
coverage.
In `@tests/snapshots/repro-migrate-shared-workspace.spec.ts`:
- Around line 79-80: Move the inline selectors and interactions for the
collections add menu, workspace name, and request tab from the spec into the
appropriate page module, exposing them through buildCommonLocators. Update the
spec to consume those page-module helpers instead of calling getByTestId or the
raw .tippy-box .dropdown-item locator directly, while preserving the existing
test flow.
- Line 103: Replace all three fixed page.waitForTimeout calls in
tests/snapshots/repro-migrate-shared-workspace.spec.ts at lines 103-103, 65-65,
and 85-85 with event-driven Playwright waits: at 103-103, auto-retry the
restored tab state or use locator.waitFor() before allTextContents(); at 65-65,
poll the snapshot file or assert the active tab state until persistence is
observable; and at 85-85, assert that ReqB is active or visible. Preserve the
existing test flow while avoiding sleeps unless no suitable locator or expect
assertion exists.
🪄 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: CHILL
Plan: Pro Plus
Run ID: 96ba87f6-50fd-41b4-9377-8fa56117d637
📒 Files selected for processing (59)
packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.jspackages/bruno-app/src/components/CollectionSettings/Overview/Migration/MigrateToYmlModal/index.jspackages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.jspackages/bruno-app/src/components/MigrateCollectionToYmlModal/StyledWrapper.jspackages/bruno-app/src/components/MigrateCollectionToYmlModal/index.jspackages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.jspackages/bruno-app/src/components/RequestTabs/CollectionHeader/index.jspackages/bruno-app/src/components/Sidebar/Collections/Collection/index.jspackages/bruno-app/src/providers/App/index.jspackages/bruno-app/src/providers/App/useIpcEvents.jspackages/bruno-app/src/providers/ReduxStore/index.jspackages/bruno-app/src/providers/ReduxStore/middlewares/snapshot/middleware.jspackages/bruno-app/src/providers/ReduxStore/slices/collection-migration.jspackages/bruno-app/src/providers/ReduxStore/slices/collection-migration.spec.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/actions.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/collection-format.spec.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/index.jspackages/bruno-app/src/providers/ReduxStore/slices/collections/migrate-in-place.spec.jspackages/bruno-app/src/providers/ReduxStore/slices/tabs-migrate.spec.jspackages/bruno-app/src/providers/ReduxStore/slices/tabs-restore.spec.jspackages/bruno-app/src/providers/ReduxStore/slices/tabs.jspackages/bruno-electron/src/cache/requestUids.jspackages/bruno-electron/src/index.jspackages/bruno-electron/src/ipc/collection.jspackages/bruno-electron/src/ipc/mount.jspackages/bruno-electron/src/ipc/workspace.jspackages/bruno-electron/src/ipc/yml-migration.jspackages/bruno-electron/src/ipc/yml-migration.spec.jspackages/bruno-electron/src/services/mount/file-index.jspackages/bruno-electron/src/services/mount/manager.jspackages/bruno-electron/src/services/mount/manager.spec.jspackages/bruno-electron/src/services/snapshot/index.jspackages/bruno-electron/src/store/bruno-config.jspackages/bruno-electron/tests/services/snapshot-remap.spec.jspackages/bruno-filestore/src/formats/yml/parseFolder.spec.tspackages/bruno-filestore/src/formats/yml/parseFolder.tspackages/bruno-filestore/src/formats/yml/stringifyFolder.spec.tspackages/bruno-filestore/src/formats/yml/stringifyFolder.tspackages/bruno-filestore/src/index.tspackages/bruno-filestore/src/workers/WorkerQueue/index.tspackages/bruno-filestore/src/workers/index.tspackages/bruno-filestore/src/workers/worker-script.tstests/collection/migrate-to-yml-cancel/fixtures/collection/api/folder.brutests/collection/migrate-to-yml-cancel/fixtures/collection/api/get-users.brutests/collection/migrate-to-yml-cancel/fixtures/collection/bruno.jsontests/collection/migrate-to-yml-cancel/fixtures/collection/collection.brutests/collection/migrate-to-yml-cancel/fixtures/collection/environments/Local.brutests/collection/migrate-to-yml-cancel/fixtures/collection/environments/Production.brutests/collection/migrate-to-yml-cancel/fixtures/collection/ping.brutests/collection/migrate-to-yml-cancel/fixtures/collection/post-json.brutests/collection/migrate-to-yml-cancel/init-user-data/preferences.jsontests/collection/migrate-to-yml-cancel/migrate-to-yml-cancel.spec.tstests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.tstests/collection/migrate-to-yml/keep-request-tab-open.spec.tstests/collection/migrate-to-yml/migrate-to-yml.spec.tstests/snapshots/repro-migrate-shared-workspace.spec.tstests/utils/page/collection/migrate-to-yml.tstests/utils/page/index.tstests/utils/page/locators.ts
💤 Files with no reviewable changes (8)
- packages/bruno-electron/src/services/mount/manager.spec.js
- tests/collection/migrate-to-yml/keep-request-tab-open.spec.ts
- packages/bruno-electron/src/ipc/collection.js
- packages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.js
- packages/bruno-app/src/providers/ReduxStore/slices/tabs-migrate.spec.js
- packages/bruno-app/src/providers/ReduxStore/slices/tabs.js
- packages/bruno-app/src/components/CollectionSettings/Overview/Migration/MigrateToYmlModal/index.js
- packages/bruno-app/src/providers/ReduxStore/slices/collections/migrate-in-place.spec.js
🚧 Files skipped from review as they are similar to previous changes (44)
- packages/bruno-app/src/providers/ReduxStore/slices/tabs-restore.spec.js
- tests/collection/migrate-to-yml-cancel/fixtures/collection/environments/Production.bru
- tests/collection/migrate-to-yml-cancel/fixtures/collection/bruno.json
- packages/bruno-filestore/src/formats/yml/parseFolder.ts
- tests/utils/page/index.ts
- tests/collection/migrate-to-yml-cancel/fixtures/collection/collection.bru
- packages/bruno-app/src/providers/ReduxStore/slices/collections/collection-format.spec.js
- tests/collection/migrate-to-yml-cancel/fixtures/collection/api/folder.bru
- packages/bruno-filestore/src/formats/yml/parseFolder.spec.ts
- packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js
- packages/bruno-electron/tests/services/snapshot-remap.spec.js
- packages/bruno-app/src/providers/ReduxStore/slices/collection-migration.js
- packages/bruno-filestore/src/formats/yml/stringifyFolder.spec.ts
- tests/collection/migrate-to-yml-cancel/fixtures/collection/ping.bru
- packages/bruno-electron/src/cache/requestUids.js
- packages/bruno-electron/src/ipc/mount.js
- packages/bruno-filestore/src/formats/yml/stringifyFolder.ts
- tests/collection/migrate-to-yml-cancel/fixtures/collection/environments/Local.bru
- packages/bruno-app/src/providers/ReduxStore/slices/collection-migration.spec.js
- packages/bruno-app/src/components/Sidebar/Collections/Collection/index.js
- packages/bruno-electron/src/store/bruno-config.js
- packages/bruno-electron/src/services/mount/file-index.js
- packages/bruno-filestore/src/workers/index.ts
- packages/bruno-app/src/components/MigrateCollectionToYmlModal/index.js
- packages/bruno-app/src/providers/App/useIpcEvents.js
- tests/collection/migrate-to-yml-cancel/init-user-data/preferences.json
- packages/bruno-filestore/src/workers/worker-script.ts
- tests/collection/migrate-to-yml-cancel/migrate-to-yml-cancel.spec.ts
- packages/bruno-electron/src/services/mount/manager.js
- packages/bruno-electron/src/index.js
- packages/bruno-app/src/providers/ReduxStore/middlewares/snapshot/middleware.js
- packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js
- tests/utils/page/locators.ts
- packages/bruno-app/src/providers/ReduxStore/index.js
- packages/bruno-filestore/src/workers/WorkerQueue/index.ts
- tests/collection/migrate-to-yml-cancel/fixtures/collection/api/get-users.bru
- packages/bruno-app/src/components/MigrateCollectionToYmlModal/StyledWrapper.js
- packages/bruno-electron/src/ipc/workspace.js
- tests/collection/migrate-to-yml-nested-multi/migrate-to-yml-nested-multi.spec.ts
- packages/bruno-filestore/src/index.ts
- tests/utils/page/collection/migrate-to-yml.ts
- packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js
- packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
- tests/collection/migrate-to-yml/migrate-to-yml.spec.ts
There was a problem hiding this comment.
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 (2)
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js (2)
3658-3663: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRestore the original collapsed state instead of toggling unconditionally.
This checks
migratedCollection.collapsed, not the originalcollection.collapsed. Freshly remounted collections that start collapsed will therefore be expanded even when the collection was originally collapsed. Toggle only when the two states differ.Proposed fix
- if (migratedCollection?.collapsed) { + if (migratedCollection && migratedCollection.collapsed !== collection.collapsed) { dispatch(toggleCollection(collectionUid)); }🤖 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-app/src/providers/ReduxStore/slices/collections/actions.js` around lines 3658 - 3663, Update the migration flow around remountReopenedCollection and migratedCollection so it compares migratedCollection.collapsed with the original collection.collapsed state, dispatching toggleCollection(collectionUid) only when those values differ. Preserve the original collapsed state after remounting.
3643-3653: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winEnsure migration state is finalized when snapshot flushing fails.
flushSnapshotNow(getState)runs aftermigrationStarted()but before thetry/finally. If snapshot persistence rejects,migrationEnded()is never dispatched, leaving the modal/state stuck inmigratingand preventing subsequent migrations. Move this work under the lifecycle cleanup, while avoiding rollback remount logic when disk migration has not started.🤖 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-app/src/providers/ReduxStore/slices/collections/actions.js` around lines 3643 - 3653, Move flushSnapshotNow(getState) into the existing try/finally lifecycle after migrationStarted(), ensuring migrationEnded() is dispatched if snapshot persistence rejects. Track whether disk migration has begun so the finally block skips rollback/remount logic when flushing fails before disk migration starts, while preserving normal cleanup once migration begins.
🤖 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 `@packages/bruno-electron/src/ipc/yml-migration.js`:
- Around line 235-237: Update the reopen flows around openCollection at all
referenced call sites to inspect its returned opened flag instead of relying
only on exceptions. When opened is false, log or report the returned error and
prevent migration from taking the success path; preserve exception handling for
genuinely thrown errors.
---
Outside diff comments:
In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`:
- Around line 3658-3663: Update the migration flow around
remountReopenedCollection and migratedCollection so it compares
migratedCollection.collapsed with the original collection.collapsed state,
dispatching toggleCollection(collectionUid) only when those values differ.
Preserve the original collapsed state after remounting.
- Around line 3643-3653: Move flushSnapshotNow(getState) into the existing
try/finally lifecycle after migrationStarted(), ensuring migrationEnded() is
dispatched if snapshot persistence rejects. Track whether disk migration has
begun so the finally block skips rollback/remount logic when flushing fails
before disk migration starts, while preserving normal cleanup once migration
begins.
🪄 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: CHILL
Plan: Pro Plus
Run ID: c4e2efd9-6463-4f64-abd7-df36fd4d784e
📒 Files selected for processing (2)
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.jspackages/bruno-electron/src/ipc/yml-migration.js
* fix(ws): keep body-mode dropdown above collapsed sticky headers (#8622) * fix(ws): keep body-mode dropdown above collapsed sticky headers * fix * add: test * rm: only * improvement * fix(app): point generated docs to api-docs CDN path (#8633) * test(sidebar): move sidebar locators to a dedicated file (#8634) Co-authored-by: Bijin A B <[email protected]> * fix(ai): align AI buttons to primary color and refine copy (#8627) * fix(ai): align AI buttons to primary color and refine copy * fix: test --------- Co-authored-by: naman-bruno <[email protected]> * improve: test file arrangement * fix(new-app): prevented validation error on blur and dialog layout shift (#8624) * add: unit test * feat(proxy-settings): show "last refreshed" timestamp on System Proxy panel (#8640) * refactor: improve Wysiwyg editor toolbar interactions, add delete table option * refactor: update documentation code block background theme colors * reconciled autocomplete suggestions against typed prefix to stop dupes + invalid res (#8621) * fix(ai): scope autocomplete API hints by scriptType so pre-request never suggests res * fix(ai): de-duplicated typed token in autocomplete + unify suggestion sanitization * resolved the coderabit review. * fix(ai): reconciled autocomplete suggestions against typed prefix to stop dupes + invalid res * fix(ws): keep selection on current message when deleting another (#8643) * Generate documentation modal text and style changes (#8644) * fix(ui): visual improvements for tables in FileBody and EnvironmentVarsTable (#8632) * fix(StyledWrapper): improve table header styling and add ellipsis for overflow text * fix(FileBody): add truncation to 'Selected' column for better overflow handling * fix: ui improvements for descriptions and tables * fix(EnvironmentVariablesTable): improve formatting and overflow handling in EnvVarValueCell * fix(EnvironmentVariablesTable): add testId to SecretEyeButton for better testing support * chore(claude): add .claude config into the repo (#8648) * fix(app): resolve collection level variables in bru.ctx and add app logs to console (#8650) * fix(app): resolve collection level variables in bru.ctx.variables * fix(app): log bru.ctx.log output into app console * refactor(app): integrate Portal component and enhance form submission (#8645) * chore(mount): route request entries through buildRequestNode in buildTree (#8658) * Update CODEOWNERS (#8666) * refactor: replace DocsLinkModal with contextual DocsLinkPopover and update toolbar link handling * test(environments): env tab eye icon (#8655) * fix(interpolation): add interpolation for akamai-auth (#8631) * fix: show correct New Request shortcut in response placeholder (#8116) * refactor: redesign documentation editor table styles, update mode switch UI * fix(ai): respected the redact-secret-variables toggle for name-pattern variables (#8657) * fix(app): chevron positioning and selector width (#8669) * refactor: extract richtext editor test utility and modularize test suites * fix(ai): improve script types and clarify res restrictions in pre scripts (#8678) * Update beta features section in preferences (#8642) * Refine bug report issue template UI * Rename config.yaml to config.yml * Update FeatureRequest.yaml * chore(ui-component)/added radio group component with storybook and updated the preset component * added storybook docs * added tests for radio group * fix(environments): keep secret values on the secret row when a variable shares its name (#8679) * fix(environments): keep secret values on the secret row when a variable shares its name * rm: comment * fix * fix(mount): redact large text blocks so big .bru files parse fast (#8660) Large .bru files (>=512KB) were fed whole to the ohm parser on mount, which is slow and memory-heavy. Add a redaction pass that splits the flat text blocks (bodies, scripts, tests, docs) out of the file, parses the small remaining skeleton, and re-attaches the extracted content. - redactLargeBruTextBlocks: replaces each top-level text block's content with a content-hash token, returning a skeleton + the extracted values - restoreRedactedBlocks: re-attaches values wherever the tokens land in the parsed object - parse-file uses this for request, collection and folder .bru above the size threshold - values are extracted to be byte-identical to a normal parse (leading blank lines, CRLF terminator and 2-space outdent all handled), proven by round-trip tests that deep-equal against a normal parse * added stories for ui components * feat(mount): follow symlinks when walking collections (#8649) * feat(mount): follow symlinks when walking collections Resolve symbolic-link entries during the mountv2 walk so symlinked request files and directories are classified and listed like their real counterparts. Broken links are skipped. Adds an e2e spec covering symlinked file and directory entries across both formats and with the file cache off and on. * test(mount): use waitForReadyPage and closeElectronApp helpers in symlink spec * fix(mount): guard against directory-symlink cycles when walking A directory symlink that resolves to an ancestor (or itself) previously re-entered the same subtree until the walk exhausted the stack. Track canonical directory paths and skip any directory already visited, so a cyclic link is walked at most once. Extends the symlink e2e spec with an ancestor-pointing link, asserting the mounted tree stays bounded (file-cache path). * removed preset component * fix(size/S):Minor bug fix in the version edit popup for the new version input box (#8672) * Minor bug fix for the version edit popup * Fix unit test case failing issue * added segment group component with stories and tests * revert presets to not use segment group * added theme selector * added readme for storybook * feat(ai): implement immediate security settings save (#8685) * feat(ai): implement immediate security settings save * Update packages/bruno-app/src/components/Preferences/AI/index.js * refactor: migrate editor components to RichTextEditor, and adjust ModeSwitch UI styles * refactor: rename Docs-prefixed editor extensions to Editor * refactor: rename Wysiwyg references to Rich Text * enabled code in storybook and updated Radio and Segmented control API to accept list * refactor: remove code-block test file * removed box shadow * refactor: rename docs CSS classes to editor prefix for consistency * fix(snapshot): environment loss of some workspaces (#8686) * fix: draft attempt 1 * fix(snapshot): enhance active workspace collection handling in SnapshotManager * fix(snapshot): refactor collection lookup assignments for improved readability * fix(snapshot): simplify collection lookup assignments for clarity and maintainability * fix(snapshot): improve handling of workspace-scoped collection lookups and ensure distinct entries based on active workspace preferences * fix: coderabbit comments * added a box shadow on active item * updated shadow to lighter version * improved readme file * added test and stories for toggle switch * added post css loader so Storybook can compile the app's Tailwind CSS * added dropdown stories and test * feat(ai): enhance app handling in AiChatSidebar (#8697) * fix: size of cancel button (#8692) Co-authored-by: shubh-bruno <[email protected]> * task (migration) : hiding migration options and the respective test (#8690) * fix(ui): SensitiveFieldWarning tooltip position (#8698) * feat(ai): add request handling to ai chatbar (#8700) * feat(ai): add request handling to ai chatbar * fix: test * Added changelog for v4 (#8677) * Added changelog for v4 * updated images to use s3 links * Updated url for images * Added version for docs urls * Reverted version change Co-authored-by: Bijin A B <[email protected]> * Updated the YAML migration text --------- Co-authored-by: Bijin A B <[email protected]> * fix(keybindings): new request in active tab based on active collection (#8703) * Added beta flag for AI (#8706) * chore(coderabbit)/adds coderabbit instructions for adding new file as ts/tsx in bruno app (#8717) * fix(devtools): prevent console panel from bleeding over modals (#8716) * feat(web-buidler): remote artifact builder plugin (#8718) * basic plugin * Apply suggestion from @sid-bruno * fix(settings): Enable App toggle for GQL requests (#8723) * fix(converters): add missing auth mappings on postman export, add additional parameters mapping on postman import (#8494) * fix(import): add Oauth fallback for grant authorization code, parse additional parameters. * feat(import): support NTLM auth import from postman. #BRU-3114 * feat(export): support collection level auth. support awsv4, digest, ntlm, oauth1 and oauth2 auth types. fix bearer type return structure. * test(import): add NTLM, Additional parameters tests. * fix(export): add 'in' key for 'apiKey' auth type * test(export): add test cases for bruno to postman Auth flow. * fix (export): add folder level auth in export and use ensureString for string attributes * fix(import): add missing placement default and remove grant-type redundant logic * fix: revert missed grantType variable * test(export): add auth undefined assertion (code rabbit review) * fix: use common string util method for fallback * added stories and tests for Help component * fix(mountv2): give duplicate-named env variables distinct uids (#8730) * refactor(tests): update data type assertions to use data-selected-type attribute for consistency (#8731) * added stories and tests for accordian * fix(secrets): environment table (#8733) * fix(secrets): environment table * fix: removed useeffect * added introduction md file * test(converters): add round trip tests for Postman <-> Bruno converters (#8534) * test(export): add round trip tests for Postman <-> Bruno converter * fix(export): add unique key for paths to handle duplicates, fix postman collections to handle more code coverage * fix(conveters): add diff enum for reusability * fix: add enum for auth types * fix: CJS to ESM imports * fix: update readme info for round trip * added outlined version for segmented control * updated icons * removed dropdown * chore(eslint): adds eslint config warnings for unused-vars, debuggers, duplicate-imports (#8505) * feat(tests): enhance Playwright configuration for sharded CI runs (#8742) * refactor(ui): extract richtext editor utilities to utils folder * refactor(ui): move useLinkHandlers to utils folder * refactor(ui): extract richtext editor components to components folder * refactor(ui): refactor RichTextEditor toolbar state into custom hooks * test(e2e): fix richtext editor locators and handle new button components * fix(tests-macos): update branch filters for workflow triggers to support release branches (#8752) * fix: encode url for url without protocol (#8756) * fix(cookies): toggle raw mode state in ModifyCookieModal (#8755) * refactor: reorganize RichTextEditor hooks * feat(ai): add focus for prompt input after AI response completion (#8747) * fix(security): overflow on chip list styling (#8748) * feat(converters): add support for script execution flow in yml configuration (#8745) * chore: remove accidentally added non-bruno-app files * feat(collections): open multiple collections from a monorepo (#8724) * feat(collections): open multiple collections at once * refactor(collections): rename open-collection IPC channels * test(collections): e2e coverage for open collection picker and selection modal * refactor(collections): 'no collections found' toast message * fix(collections): import hydrateCollectionWithUiStateSnapshot in workspaces actions * fix(collections): default to no selection and surface open failures * feat(collections): prevent duplicate open collection toasts * fix(collections): update auto close condition for selection modal * test(collections): open collection selection selectors moved to page module * test(collections): match open collection rows by exact title * Merge branch 'main' into feat/open-multiple-collections * fix(workspaces): switch to default workspace on close so header shows correct name (#8425) * fix(workspaces): switch to default workspace on close so header shows correct name * Added the test spec related review. * added e2e test for closing workspace returns to default * added e2e test for closing workspace returns to default * added e2e test for closing workspace returns to default * test(workspaces): used stable test ids for workspace switcher and actions in close-workspace e2e * refactor(ai): update API key handling in openai comp providers (#8749) * refactor(ai): update API key handling in openai comp providers * fix * refactor: simplify rich text editor link management with unified ToolHint components and improved URL validation logic * chore(pr-decription)/updated pr description (#8786) * removed unused stories * removed radio group * chore(eslint)/disable autofix for const (#8760) * chore(eslint)/disable autofix for const * added a config * Apply suggestion from @sid-bruno Co-authored-by: Sid <[email protected]> * Apply suggestion from @sid-bruno Co-authored-by: Sid <[email protected]> * Apply suggestion from @sid-bruno Co-authored-by: Sid <[email protected]> * Apply suggestion from @sid-bruno Co-authored-by: Sid <[email protected]> * lint fix * added inline check * removed comment --------- Co-authored-by: Sid <[email protected]> * updated segment control design * fix: decouple task lists from mixed-content lists and improve markdown serialization for block elements * Fix: binary body lost on importing from postman (#8729) * fix/3118 - Postman Import: Binary Body Type Silently Lost * fix/3118 - Postman Import: Binary Body Type Silently Lost * fix/3118 - Postman Import: Binary Body Type Silently Lost * fix/Added indentation * Import binary body mode * handling else if * Handling example with binary body * file body mode * Add tests for importing Postman binary body requests * Enhance Postman binary body import by inferring content type from file extensions and adding tests for various file types * Add mime-types as an external dependency and implement test for .bin file content type resolution in Postman to Bruno conversion * fix: import statements * fix: e2e tests * refactor: improve test structure and assertions for Postman binary body import --------- Co-authored-by: rajashreehj-bruno <[email protected]> * style: update documentation edit toggle button size to sm * updated outlined styles * style: update inline code and block styling with transparent backgrounds, borders, and light-mode adjustments * fix(timeout): allow inherit request timeout for yaml requests (#8746) * fix(timeout): allow inherit request timeout for yaml requests * fix: add test.step for timeout * fix(timeout): normalize resolveTimeoutSetting to reject non-finite/negative timeouts * style: update code and block border radius to use base theme radius * fix(environment): auto save on env table removing some characters (#8732) * fix(environment)/auto save on env table * moved autosave tests * added locators * added test for multi line * updated name * feat(code-mirror-search): add replace and replace-all with search position, debouncing and tests (#8715) * feat(environment): add default env to presets (#8612) * fix: Folder Sequencing When we try to move any folder at the bottom of the folders list (#8722) * fix: Folder Sequencing When we try to move any folder at the bottom of the folders list * fix(bruno-app): use path-segment ancestry for folder drop checks to avoid sibling-prefix false positives * fix(bruno-app): allow folder to be reordered to bottom via dropType edge zones (BRU-1112) * ci: re-run benchmark check (flaky perf gate) * docs(bruno-app): updated stale dropType comments to above/below terminology * Added the fix for bru.runner.stopExecution() while running collection run from tests (#8720) * Added the fix for bru.runner.stopExecution() while running collection run from tests * resolved the code review for coderabbit * fix * feat(collections): add description text to open collection selection modal (#8793) * fix(ws): remove auto-reconnect in websockets (#8605) * feat: add preserve scripts option for Postman import/export (#8726) * feat(import): add preserve scripts option for Postman import/export * test(import): add postman preserve scripts coverage * fix(import): align preserve scripts option place and color * fix(import): address coderabbit comments * test(import): assert export scripts and centralize import locators * fix(export): validate empty filename, dismiss dialogs between tests * refactor(import): use options object for convertCollection config params * refactor(import): remove redundant check from importPostmanV2CollectionItem * Added the ignore for the collection nested folders (#8725) * Added the ignore for the collection nested folders * Removed the unignored functionality for Collection folder for now * require path boundary in folder ignore matching to prevent prefix and empty-pattern over-matching * fix(collection): deep-cloned bruno config before transform so ignore/update never mutated the object returned to redux * resolved the coderebbit review comments * fix:env configure remains visible (#8530) Co-authored-by: Adwait Aayush <[email protected]> * fix:url truncates in docs (#8468) * fix:url truncates in docs * refactor:added unit testcases made functions modular * Keep the default selected as none in the environments (#8785) * feat(request): warn when binary body file is missing on disk (#8753) * fix/request - Binary body type - show warning on file not exists in system * Made filename extraction OS-agnostic. * Use theme tokens for warning colors in this styled-component block. * Refactor FilePickerEditor to use useMissingFileCheck hook for file existence validation and improve warning display. Introduced new hook for checking missing files and updated tests to reflect changes in file picker behavior. * Enhance FilePickerEditor: Update title handling for single/multiple filenames and improve warning tooltip layout with icon integration. Adjust StyledWrapper to utilize theme-based border radius for consistency. --------- Co-authored-by: rajashreehj-bruno <[email protected]> * updated test ids * added dev tag so stories shows in docs only * added disabled * fix: failing test case fix (#8801) * feat(db): sqlite as a re-usable SDK for secondary queries (#8533) * chore: PR checklist update (#8806) * fix: avoid network probe in PAC myIpAddress (#8588) * fix * Fix/collection runner loader issue (#8783) * fix(runner): Collection Runner - Loader still keeps running even after Cancelling the execution * added a test id for the action buttons * removed onborading section * updated bg of segment control * added disabled color * fix(bruno-response): normalize response header name lookup to be case-insensitive (#8461) * fix(bruno-response): normalize header name lookup to be case-insensitive * fix(bruno-response): handle non-string header names in getHeader method * chore: resolve GitHub review conversations * fix(dev-tools): console and network filter dropdown position to top if no space (#8713) * fix(dev-tools): console and network filter dropdown scroll * fix(ws-replace)/add height for ws msgs to fix search overlap * fixed the accordion's isSearchOpen goes stale on collapse * fix(workspace): notify about collections that fail to open in Workspa… (#8719) * fix(workspace): notify about collections that fail to open in Workspace Home * Resolved the coderabbit comments * test(workspace): added e2e coverage for collections that fail to open * resolved the code rabit comments * refactor(ui): changed data-testid prop on StatusBadge for consistency * fix(workspace): exclude failed-to-open collections when reopening on config update * test(workspace): added the switch-time aggregated toast for unopenable collections * test(workspace): guard that config updates don't reopen failed-to-open collections * feat(snapshot):persisting sidebar state in the snapshot (#8328) * chore: new folder shortcut (#8805) * refactor(ai): moved AI Assist from floating overlay into request pane and collection/folder settings tab bars (#8693) * refactor(ai): moved AI Assist from floating overlay into request pane and collection/folder settings tab bars * test(ai): added e2e coverage for AI Assist tab-bar placement across request pane, collection and folder settings * test(ai): added e2e coverage for AI Assist tab-bar placement across request pane and settings * test(ai): extended AI Assist tab-bar placement coverage to graphql, grpc, websocket, app tab and default script sub-tab * scoped AI Assist placement assertions to the tab bar and added a settings tab bar test id * feat(auth-headers):handling authorization header leaks to third party servers on redirect (#8380) * feat: add forwardAuthorizationOnRedirect setting to allow stripping sensitive headers on cross-origin redirects * feat: add forwardAuthorizationOnRedirect to opencollection types * fix: restore missing forwardAuthorizationHeader config lines in runners and filestore * feat: apply secure forwardAuthorizationHeader default to Insomnia and OpenAPI imports * refactor: remove stale module augmentations for GraphQL and HTTP request settings * refactor: centralize default HTTP request settings and improve test step organization * chore: update @opencollection/types to version 0.10.0 across packages * fix: handle cross-origin redirect auth stripping, and optimize Redux settings initialization * refactor: fix formatting in collection schemas * chore: remove unused data-testid from Settings toggle * refactor: simplify forwardAuthorizationHeader serialization logic with nullish coalescing * refactor: migrate redirect auth strip E2E tests to use common locators utility * refactor: use toBool helper in bruToJson * feat: update forwardAuthorizationHeader to respect Postman protocol profile behavior * refactor: move DEFAULT_HTTP_ITEM_SETTINGS to bruno-common and update UI layout and redirection logic * refactor: introduce type conversion helpers to simplify HTTP request setting parsing * tests: support Postman protocolProfileBehavior for authorization header forwarding * feat: add test ID to forward auth toggle * feat: enable URL encoding by default in request settings * refactor: centralize isSameOrigin utility and simplify GraphQL settings conversion logic * refactor: replace manual type checks with toBool and toNumber helpers in collection converters * refactor: migrate request settings test locators to page object model * chore: set default encodeUrl to false and add line breaks for utils * test: add regression tests for encode URL setting default behavior * refactor: migrate encode-url-default-behaviour tests to use pageWithUserData fixture * updated discable dtext opacity * fix(node-vm): resolve npm modules from additionalContextRoots via native walk-up (#8538) * fix: resolve npm modules from additionalContextRoots node_modules in NodeVM When shared script folders configured via additionalContextRoots have their own node_modules, the NodeVM runtime now searches those directories for npm packages instead of only checking the collection and Bruno paths. * fix(node-vm): enhance npm module resolution security by restricting access to ancestor node_modules Added a new function to compare resolved npm module paths against allowed roots, ensuring that modules from ancestor directories outside the configured additionalContextRoots are not accessible. Updated the loadNpmModule function to utilize this security check during module resolution. Added tests to verify that ancestor node_modules cannot be accessed when not explicitly allowed. * feat(tests): add integration tests for additionalContextRoots npm module resolution Introduced a comprehensive set of integration tests to validate the resolution of npm modules from additionalContextRoots in the CLI. The tests ensure that shared libraries are correctly resolved, ancestor node_modules are inaccessible, and that collections can successfully utilize shared scripts. Additionally, created fixture files to support the testing environment, including workspace configurations and sample scripts for both collections A and B. * chore(tests): update .gitignore to track specific node_modules for e2e tests Modified .gitignore to include tracking for node_modules in test fixtures, ensuring that fake npm packages are available for end-to-end tests. Added new files for 'forbidden-lib' and 'signature-utils' to support testing scenarios. * test(node-vm): add test for resolving npm modules via symlink in additionalContextRoots Implemented a new test to verify that npm modules can be resolved correctly when additionalContextRoots points to a symlink. The test ensures that the symlinked library is accessible and that the context variable is set appropriately, enhancing the coverage for npm module resolution scenarios. * feat(node-vm): enhance npm module resolution with additional context roots Added support for resolving npm modules from additional context roots, including symlinked modules. Introduced new functions to validate module paths against allowed roots, ensuring security and proper resolution of transitive dependencies. Updated the loadNpmModule and createNpmModuleRequire functions to incorporate these changes, improving the flexibility and reliability of module loading in the NodeVM context. * feat(node-vm): improve npm module resolution for linked packages Enhanced the module resolution logic to allow internal relative requires within npm-linked packages, even when their physical location is outside declared allowed roots. Introduced a new function to find the closest package root, ensuring that internal dependencies can be resolved correctly. Updated tests to validate this behavior, confirming that the system handles linked packages as expected. * feat(node-vm): support subpath imports for npm-linked packages Enhanced the module resolution logic to allow subpath imports from npm-linked packages, ensuring that imports like `require('linked-pkg/utils')` are correctly resolved. Updated the `isModuleLinkedFromAllowedRoot` function to utilize bare-name lookup for improved accuracy. Added tests to validate this new behavior, confirming that subpath imports function as expected in the NodeVM context. * refactor(tests): remove forbidden-lib tests and update integration scenarios Eliminated tests related to the forbidden-lib package to streamline the test suite, ensuring that ancestor node_modules are not resolvable. Updated integration tests for additionalContextRoots to reflect changes in request counts and improved clarity in test descriptions. Adjusted workspace configurations to enhance overall test coverage and maintainability. * refactor(cjs-loader): simplify module resolution documentation Updated comments in the cjs-loader.js file to clarify the module resolution order, removing redundant explanations while maintaining essential details. This change enhances the readability and understanding of the module loading process in the NodeVM context. * refactor(cjs-loader): improve comments and clarify module resolution logic Updated comments in cjs-loader.js to enhance clarity regarding module resolution, specifically indicating fallback behavior when modules are not found in the collection. Adjusted the path used in createNpmModuleRequire for improved accuracy in module loading. * feat(tests): add additional-context-root-lib and update workflows Introduced the additional-context-root-lib package with its dependencies and updated relevant workflows to install this new library. Adjusted the CLI test and flaky test detector workflows to include installation steps for the additional-context-root-lib, ensuring proper setup for testing scenarios. * refactor(tests): update npm module resolution test for additionalContextRoots Revised the test case to ensure that requiring an npm package from a sibling additionalContextRoot fails as expected. Updated the test description for clarity and adjusted the script to reflect the intended behavior of module resolution, emphasizing the limitations of cross-root discovery in the NodeVM context. * refactor(tests): clean up comments in node-vm sandbox tests * refactor(tests): update fixture URLs in additional-context-roots tests Modified the URLs in the .bru fixture files to point to the local testbench server instead of an external service. This change ensures consistent test behavior and eliminates reliance on external resources during testing. * refactor(tests): enhance node-vm sandbox tests with symlink support Introduced a symlink support check in the node-vm sandbox tests to conditionally skip tests on Windows where symlink creation is restricted. Refactored the test setup to utilize a new `makePkg` function for creating package directories and files, improving code readability and maintainability. Updated relevant tests to leverage this new structure, ensuring consistent behavior across different environments. * refactor(setup): preserve specific node_modules during cleanup Added a mechanism to preserve certain `node_modules` directories during the cleanup process in the setup script. This change ensures that fixture data remains intact for testing, specifically for directories related to additional context roots. --------- Co-authored-by: lohit-bruno <[email protected]> * feat(cli): add --global-env-var to override global environment variables at runtime (#8620) * feat(cli): add support for overriding global environment variables with --global-env-var option - Introduced the --global-env-var option to allow users to overwrite global environment variables during command execution. - Updated the command handler to validate and process global environment variable overrides. - Enhanced the persistence logic to ensure that global environment variable overrides are handled correctly without leaking into the global environment file. - Added tests to verify the correct behavior of global environment variable persistence. * test(cli): enhance integration tests for global env var overrides - Added checks to ensure that runtime overrides do not persist to the global environment file. - Updated fixture scripts to reflect the expected behavior of global environment variable persistence. - Improved the substitution logic for dynamic URLs in test fixtures to ensure accurate testing of overrides. * refactor(tests): streamline CLI test arguments and error handling - Refactored CLI test cases to use a consistent argument array for command execution. - Improved error handling by consolidating error message construction for better readability. - Ensured that the tests maintain clarity while verifying global environment variable overrides. * fix: remove global env file check for global overrides * refactor(persist-variables): enhance global environment variable handling - Introduced a new `globalOverrides` option to manage global environment variable overrides more effectively. - Updated logic to ensure that both local and global overrides are correctly applied and do not persist unintended values to the global environment file. - Improved comments for clarity on the behavior of global environment variable persistence. * fix: address review comments * fix: address review comments * removed chnages which were out of scope * remove unused no-global-env fixture * refactor(tests): update integration tests for global env var overrides - Removed outdated fixture files related to global environment variable overrides. - Enhanced the test setup to dynamically create necessary workspace and collection structures. - Improved clarity in test descriptions and logic for validating that transient overrides do not persist to the global environment file. * refactor(tests): simplify global env var test setup * refactor(tests): remove outdated test for global env var persistence * feat: add markdown mode to documentation editor and upgrade rich text editor extensions * Fix: added actions for post reposne vars in yml (#8815) * feat: introduce DocsEditor component and useDocsEditingState hook to support rich text editing in collection documentation * fix: add dynamic font size adjustment for CodeMirror info display (#8817) * fix: add dynamic font size adjustment for CodeMirror info display * test: implement comprehensive E2E test suite and resolve rich text editor formatting issues * feat(envs): adding search filter to environment selector dropdown (#8277) * feat: adding search filter to environment selector dropdown * fix: making the search input sticky * test: updating tests into individual tests for environment selector search * fix: avioding searchinput refocus if already focussed * tests: ensuring dropdown open for tests and adding first printable key test * refactor: replace inline search logic with reusable SearchInput component in EnvironmentSelector * refactor: standardize environment selector locators and test actions for improved search functionality testing * test: update environment search casing, improve tab state handling in actions * refactor: decouple and centralize collection header locators and utility functions into dedicated module * refactor: migrate environment selector locators to a dedicated utilities file and update collection header references * refactor: consolidate collection header locators and update environment selector test utilities * test: add and implement closeEnvironmentSelector utility to clean up environment selector state in tests * refactor: simplify environment selector lifecycle management by centralizing open/close logic in test hooks * refactor: lift search state to environment selector and clear input on close * test: refactor EnvironmentListContent unit tests to use a wrapper component for state management and update clear button selector * fix(locators): reverting environment selector locator reference * refactor: clear search input when switching environment tabs and ensure persistent visibility of configure button * test: add global environments data and verify search functionality in environment selector --------- Co-authored-by: sachin-thakur-bruno <[email protected]> * feat(client certs): add global client certs and allow disabling individual client certs. (#8751) * feat: add client certificates to global preferences * feat(client certificates): apply global client certs on requests, allow disabling individual certs at global and collection level * fix: create list group component. modify client certificate UI to match new mockup. * test(client certs): setup client certs test suite and add CLI test cases for client certs * test(client certs): add E2E cases for collection and global client certs * fix: fix code review comments from claude * fix: count test failures using filter to remove duplicate counting. * fix: minor UI fixes to support storybook * fix: remove duplicated onboarding config from test preferences.json * fix: use testIds on test and ws responses for better test reachability. use the new test-ids on locators * fix: coderabbit fixes * fix: fix lint issues * fix: review comment changes for test cases * fix: add timeout for the fixture setup * fix: add break for grpcCurl to match first case * test: prevent stale response reads in client-cert e2e specs * fix: add separate fixture for sandbox modes in WSS to prevent stale close connection message * fix: add regex matching for ws assertions to reduce flakiness * fix: fix list group "add button"'s icon alignment * fix: add save button to collection client certificates * test: add collection client certificate precedence test case * feat(presets)/updated the requests to use segmented control (#8816) * feat(presets)/updated the requests to use segmented control * updated icons * yml migration rework (#8795) * feat: extend markdown linkify support for relative assets in rich text editor * feat: add color-scheme support for task list items in editor styles * refactor: updating file/folder structure for docs editor files * refactor: encapsulate DocsAction styling in a new StyledWrapper component * refactor: update richtext editor tests to import utilities from actions instead of utils * fix:cmd+w now works for transient tabs (#8429) * fix:cmd+w now works for transient tabs * test: verify URL is preserved after saving and closing a transient tab * test: use centralized page locators and test.step in the transient close spec * refactor: branch on transient at the save dispatch site * refactor:use if/else branches in onSaveAndClose --------- Co-authored-by: Adwait Aayush <[email protected]> * Fix: Description missing for the import export yml for the environments (#8822) * Fix: Description not there in the import export yml for the environments * Comments addressed * Comments addressed * security(ipc): confine renderer file writes to known collections (#8274) * fix(openapi):strip trailing dots from operation names on import (#8812) * fix(openapi):strip trailing dots from operation names on import * fix(openapi): strip trailing dots from environment names on import --------- Co-authored-by: Adwait Aayush <[email protected]> * feat(rich-text-editor)/scroll persist * fix:populate collection & folder docs on OpenAPI/swagger imports (#8803) * fix:populate collection & folder docs on OpenAPI/swagger imports * fix(openapi): coerce spec descriptions to strings before use * test(openapi): extract findRequestByName/findFolderByName into shared helper * fix:guard against object names --------- Co-authored-by: Adwait Aayush <[email protected]> * fix(generate-code): generate code for url interpolation (#7308) * fix(presets)/ux fixes for dropdown and icon spacing (#8827) * fix ux * updated padding * fix(secrets): block duplicate secret names to prevent value loss (#8750) * refactor: migrate documentation edit toggle to use test ID instead of class selector * refactor: migrate collection and folder documentation edit toggle to shared DocsAction component * chore: enhance claude rules & skills * feat: support drag-and-drop and alphabetical sorting for variables (#8603) * test: update doc toggle locators to use test-ids * Mock Server Implementation (#8734) * reported how many collections failed to open on workspace load (#8831) * reported how many collections failed to open on workspace load * Added the failed collection in the overview list of collections in the workspace * test: fix the draft indicator tests for collection client certs (#8824) * fix(generate-code): encode a literal colon in the path when the toggl… (#8834) * fix(e2e): Playwright failures from mock server and lazy mount (#8835) * fix: green Linux Playwright failures from mock server and lazy mount Unscoped Create clicks collided with the new mock-server button, and sidebar-created examples open in edit mode so view-mode title asserts were stale. Cross-format drops into unmounted workspace collections also failed path confinement; mount on drop and treat last-opened collections as known roots. * Update packages/bruno-electron/src/ipc/collection.js * refactor: simplify collection path retrieval in findCollectionPathByItemPath function * test: update method search test to use test-id for environment selection * fix: simplify watcher management in CollectionWatcher class * feat(presets)/updated presets design (#8828) * feat(presets)/updated presets design * fixed text * updated the text * removed styles * ci: move all linux to self hosted (#8791) * feat(docs): syntax highlighting for code blocks in rich text docs (#8670) * feat(presets)/updated dropdown with menu dropdown and label weight ux changes (#8841) * feat(presets)/updated dropdown with menu dropdown and label weight ux changes * removed the comment * used button for dropdown trigger * feat(tests): enhance CodeEditor and EditorCodeBlock tests with additional mocks and configurations (#8858) * fix:sorting now works for secrets tab (#8871) * fix(mount): hydrate websocket message uids in the cached mount path (#8862) WS message expand/collapse is keyed by the message uid, so a message without one cannot be opened at all — the toggle bails on a falsy uid and every row renders with the same undefined React key. The v1 mount path hydrated request.body.ws (via hydrateRequestWithUuid), but mount v2's uid list omitted it. With File Cache enabled the tree is built from the cache on cold start, so every WS message arrived with no uid and its body could not be expanded. It only reproduced after a restart because live edits during a session still flow through the collection watcher's v1 hydration. Since v2 seeds uids deterministically from the file path, expanded-message state now also survives a restart instead of resetting. * fix:keep sort column header from shifting when the arrow appears (#8833) * fix:keep sort column header from shifting when the arrow appears --------- Co-authored-by: Sid <[email protected]> * fix:change-version modal ui (#8735) * fix:change-version modal ui * feat: add migrate-to-YML pill to collection header (#8882) * fix(mock-server): bring the UI in line with the rest of Bruno (#8880) * fix(mock-server): bring the UI in line with the rest of Bruno * fix --------- Co-authored-by: Utkarsh <[email protected]> * fix(ws): disable message queuing when in intermediate connection states (#8879) * feat: add disabled state to SendButton based on connection status * Update packages/bruno-app/src/components/RequestPane/WsQueryUrl/index.js Co-authored-by: Chirag Chandrashekhar <[email protected]> * fix: update WebSocket connection handling and improve run button behavior --------- Co-authored-by: Chirag Chandrashekhar <[email protected]> * fix(proxy): update timestamp label format (#8870) * fix(proxy): update timestamp label format and enhance timestamp utility function * fix(tests): update timestamp regex to match AM/PM format in system proxy tests * fix(timestamp): enhance formatProxyTimestamp function to replace non-breaking spaces and update regex for system proxy timestamp * fix: persist additional request values in preferences general tab save (#8823) * fix (transient-request): unable to create transient request when preset is websocket (#8889) * fix(transient): updated the websocket type key from websocket to ws to match the key coming from presets * test(transient): added tests, locators, and actions to validate the default request type of transient request when a preset is selected * refactor(import): imported the REQUEST_TYPE (aliased) from common utils and removed unused imports * fixes: OpenAPI Spec Viewer: throws resolver errors for `$ref` schemas (#8892) * fix(app): global environment variables for apps (#8900) * feat(mock-server): enhance MockResponseRequestPane with method selection and other minor tweaks (#8885) * fix(auth): stop AWS V4 auth headers from leaking on cross-origin redirects (#8893) * fix: strip AWS Signature V4 headers on cross-origin redirects when authorization forwarding is disabled * fix: prevent AWS SigV4 header leakage on cross-origin redirects by isolating signature removal from authorization header forwarding * refactor: update formatting of AWS SigV4 redirect comment block for readability * refactor: simplify response text extraction in redirect authentication tests using innerText * fix(editor): allow app keybindings if that keybindings is not present in rich text editor (#8894) * fix(doc-editor)/key bindings for doc editor * fix(mock-server): improve mock response name validation (#8908) * feat(migrate): enhance migration modal to handle collection drafts (#8899) * fix(codemirror-search)/keybinding for focusing search and replace inside the search container (#8895) * fix(sidebar): prevent drag divider from disappearing on zoom-out (#8266) * fix(sidebar): prevent drag divider from disappearing on zoom-out * fix(sidebar): keep resize divider visible across tabs and zoom levels * refactor: remove AI documentation assistant and related context payload generation from documentation components (#8921) * fix(editor)/add guessed language in language dropdown picket (#8925) * fix(editor): tab indentation on code blocks (#8926) * fix(git): use removePath for failed-clone cleanup ipc/git.js imported removeDirectory from utils/filesystem, which only exports removePath. On a failed clone the cleanup branch threw "TypeError: removeDirectory is not a function", replacing the rejection and hiding why the clone actually failed. removePath removes recursively, which is the semantics this call wanted. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * chore: restore upstream code the fork had stripped These files carried no RestWolf feature - the earlier squash-sync had rolled back upstream improvements, and the merge preserved those rollbacks because upstream's later edits did not textually conflict. - CreateCollection / CreateWorkspace: name trimming and validation messages - ExampleTab: exampleIndex lookup, matching the accessor restored in tabs.js and the snapshot serializer - insomnia converter specs, request-pane-interactivity, create-collection and create-workspace e2e specs Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * chore: restore remaining upstream code stripped by the fork Same pattern as the previous commit, found by diffing the merged tree against upstream/main for net deletions: - RequestTabPanel / ExampleItem: exampleIndex plumbing - insomnia-to-bruno: empty-mimeType text body handling, covered by the insomnia specs restored earlier (now passing) Remaining divergence from upstream is fork features and branding only: Azure Vault, saved auth modes, tab retention, theme colours, RestWolf branding, auto-updater, PostHog removal, and trimmed docs. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * feat(git): add Git UI tab and branch chip Upstream ships the git engine in bruno-electron/src/utils/git.js but wires only clone to IPC, so none of it is reachable from the app. This registers the rest and adds the UI. IPC (ipc/git.js): status, init, stage, unstage, discard, commit, file diff, fetch, pull, push. Each mutating handler returns the recomputed panel state so the renderer never has to re-query. UI: a Git UI tab (left panel with commit box and changed-file list, right pane with fetch/pull/push and ahead-behind), opened from a branch chip in the collection toolbar. Both read shared state via the useGitStatus hook. Two quirks in the existing utils this works around: - pullGitChanges rejects unless given an explicit merge strategy - getUnstagedFileDiff matches absolute paths, while git status reports repo-relative ones Verified against a real repository: status, branch, remote and diffs; plus a full init/stage/commit/edit/diff/discard round trip on a scratch repo. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(theme): move accent colour into the Appearance dropdown The fork repurposed ColorPicker to take value/label/onReset for the accent colour, but the merge restored upstream's per-environment call sites, which pass a `color` prop that component no longer reads. Both environment panels therefore rendered the accent picker and edited the app accent. Removes the picker from both environment panels and from the Themes preferences pane, and puts it in the Appearance dropdown behind the palette button in the status bar, where it edits the accent for whichever theme is on screen. feat(git): branch switching in the Git UI Adds a renderer:git-checkout handler and a branch switcher in the panel footer. A checkout that would overwrite local edits is left to fail, and git's own message is shown in the panel - matching how VS Code reports it - rather than being forced or auto-stashed. Verified: create-and-switch, clean switch, and a dirty switch refused with "Your local changes to the following files would be overwritten by checkout", with the edit left intact. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(theme): keep the accent picker inside the Appearance menu .theme-menu had a fixed 325px height, so the accent row rendered past the bottom edge and overlapped the status bar. min-height lets the menu grow while keeping its size steady when the theme lists are short. The swatch's own dropdown is absolutely positioned below its trigger, which falls off-screen for a menu anchored to the status bar, so it is flipped to open upward within this section. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * chore: remove screenshot committed by mistake Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(git): pass remote and branch to push and pull pushGitChanges looks the branch up by name (branchSummary.branches[remoteBranch]) and rejects with "Branch undefined does not exist" when it isn't supplied, so Push failed from the panel. Both handlers now default the remote to origin and resolve the current branch. Verified against a local bare remote: commit leaves ahead=1, push clears it, a remote commit shows behind=1 after fetch, and pull brings it down. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * feat(git): sync button and visible feedback for git operations Git operations succeed silently, so a push that worked and a push that failed looked identical - the error banner only rendered inside the sidebar's Changes section, which is collapsible and sits away from the buttons. Every operation now reports through a toast, and the error banner also shows next to the fetch/pull/push controls. Adds a Sync button that pulls before pushing, matching VS Code's ordering so a diverged branch does not hit a non-fast-forward rejection. Its label states what will move: "Sync 2 down, 1 up", "Push 3 commits", "Pull 1 commit", or "Sync Changes" when level. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * feat(secrets): secret managers with ordered vault tiers Replaces the single enable-and-configure Azure vault in General preferences with a Secrets Manager section modelled on how Bruno configures providers: add a provider, pick Azure Key Vault, enter connection details, test the connection. Providers are listed in precedence order. Environments gain an ordered list of vault secret names on the Secrets tab, matching the vault-teller tier layout (tenant, cluster, global). Resolution is first-match-wins per key, so the most specific tier sits at the top - the same precedence as vault-teller's tenant ?? cluster ?? global. Fetching shows what each tier actually contributed: a source dropdown switches between the merged view and any single secret, and keys claimed by a higher tier are struck through with the winner named, so a shadowed value is visible rather than looking ignored. Credentials are now encrypted at rest via the existing safeStorage-backed helpers instead of sitting in plain text in preferences.json, and the client secret is never sent to the renderer. The ordered secret names persist as a VAULT_SECRETS environment variable so they travel with the collection in git; the previous VAULT_SECRET is still read so existing environments keep working. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * fix(secrets): make the vault panel reachable in global environments The panel was passed as renderExtraButtonContent, which the table renders inline beside Save and Reset, so a block-level panel with tables was crushed into that row. It is now a sibling of the table inside a scrolling column, since neither the environment content area nor the table wrapper scrolls - without that, a fetched result pushed the table's Save button out of reach. The resolved table is capped and scrolls on its own, and the panel header carrying Apply is sticky so it stays available while reading a long tier. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * feat(secrets): pin each vault secret to a provider Each entry on the environment's Secrets tab now carries a vault dropdown, so a tier can name which provider serves it rather than relying on lookup order. "Any vault" keeps the previous behaviour of trying each configured provider in turn. A pinned vault is honoured or reported: an unknown vault name, or a secret missing from the pinned vault, is surfaced as an error instead of falling back to another provider, which would otherwise hand back a different environment's values under the same key. The choice persists by vault name rather than local id so it still resolves for a teammate whose provider has a different id. Entries serialise as "<vault>:<secret>" in VAULT_SECRETS, with bare names still accepted. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * style(secrets): fix operator indentation in the resolver Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * feat(secrets): clear all vault secrets from an environment Reset reverts the table to the saved environment, so once fetched secrets have been saved there is nothing for it to undo and it appears to do nothing. Removing them meant deleting each row by hand. Adds a Clear secrets action beside Apply, giving the bulk add a matching bulk removal. It drops the rows from the table only, so the environment still has to be saved and a mis-click is undone by Reset. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> * chore(release): bump RestWolf to 4.0.0 Major bump for the upstream v3-to-v4 merge and the features built on it: Git UI, secret managers with ordered vault tiers, and the accent colour move. Version lives only in packages/bruno-electron/package.json - electron-builder reads it for artifact names, and scripts/release.js bumps it from there. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> --------- Co-authored-by: Pooja <[email protected]> Co-authored-by: Sundram <[email protected]> Co-authored-by: Bijin A B <[email protected]> Co-authored-by: gopu-bruno <[email protected]> Co-authored-by: naman-bruno <[email protected]> Co-authored-by: ravindra-bruno <[email protected]> Co-authored-by: Abhishek Patil <[email protected]> Co-authored-by: Gopi-bruno <[email protected]> Co-authored-by: sachin-bruno <[email protected]> Co-authored-by: Sid <[email protected]> Co-authored-by: Chirag Chandrashekhar <[email protected]> Co-authored-by: shubh-bruno <[email protected]> Co-authored-by: Jiawen Geng <[email protected]> Co-authored-by: anusree-bruno <[email protected]> Co-authored-by: Rohan-Bruno <[email protected]> Co-authored-by: sachin-thakur-bruno <[email protected]> Co-authored-by: Ryan <[email protected]> Co-authored-by: shubh-bruno <[email protected]> Co-authored-by: Utkarsh <[email protected]> Co-authored-by: morsh-bruno <[email protected]> Co-authored-by: sanish chirayath <[email protected]> Co-authored-by: rajashreehj-bruno <[email protected]> Co-authored-by: adwait-bruno <[email protected]> Co-authored-by: Adwait Aayush <[email protected]> Co-authored-by: Rayan Salhab <[email protected]> Co-authored-by: sharan-bruno <[email protected]> Co-authored-by: lohit-bruno <[email protected]> Co-authored-by: arpit-bruno <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
BRU-3511
Description
Reworks bru → yml collection migration into a cancelable, progress-tracked, rollback-safe flow.
Migration now runs as a dedicated main-process pipeline (
yml-migrationIPC) with an app-level modal driven by acollectionMigrationRedux slice. The collection is removed from the UI while migrating, then remounted when the disk conversion finishes (or after cancel/failure restores the original bru files).Also cleans up the previous in-place / tab-remap approach: snapshot tabs are flushed before removal, stale
.brutabs andactiveTabare cleared after success, and folderseqhandling no longer invents a default that breaks alphabetical sort.Problem
The earlier migrate-to-yml path was fragile:
.brutabs after conversionseqwas missing (defaulting to1)Fix
Main process
migrateCollectionOnDiskpipeline: parse → write yml → backup + remove bru, with cooperative cancel checks between file opstabs+activeTab, then reopens the collection#mountsentries on failureRenderer
MigrateCollectionToYmlModal(survives collection unmount)collectionMigrationslice for status, progress, and cancelFilestore
seqvalues; omit missing/invalid seqTests
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.
Summary by CodeRabbit
seqis missing.