Skip to content

feat: implement collection migration to YML format - #7669

Merged
naman-bruno merged 7 commits into
usebruno:mainfrom
naman-bruno:feat/yml-migration
Jun 22, 2026
Merged

naman-bruno merged 7 commits into
usebruno:mainfrom
naman-bruno:feat/yml-migration

Conversation

@naman-bruno

@naman-bruno naman-bruno commented Apr 3, 2026 •

Copy link
Copy Markdown
Collaborator

Description

JIRA

Contribution Checklist:

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

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

Summary

  • New Features

    • Added a BRU-only “Migrate to YML” area to Collection Overview with a “Convert to YML” confirmation flow, disabled/loading state during migration, and success/error toasts.
    • Added a dismissible “Migrate to YML” pill in the collection header (dismissal is remembered), plus an export/backup option inside the migration flow.
  • Tests

    • Added end-to-end coverage for pill visibility/dismissal persistence and BRU-to-YML conversion, including verifying resulting files and that requests run after migration.

@coderabbitai

coderabbitai Bot commented Apr 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds a BRU→YML collection migration feature with a dismissible toolbar pill that alerts users, a settings component providing conversion with backup export options, a Redux thunk orchestrating the Electron-side migration, and E2E test coverage for the pill behavior. The toolbar pill persists dismissal state in localStorage by collection pathname; clicking navigates to settings where users confirm conversion and trigger the thunk.

Changes

BRU to YML Migration Feature

Layer / File(s) Summary
CollectionHeader Toolbar Pill
packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js, packages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.js
Adds a "Migrate to YML" pill for non-scratch BRU-format collections. Dismissal state persists in localStorage keyed by collection pathname. Component reads state on mount via readDismissedCollections() helper that safely parses stored JSON, renders transform icon with dismiss control, and prevents re-showing. dismissMigratePill handler appends pathname to dismissed list and updates both localStorage and local React state. StyledWrapper defines pill layout, label font weight, dismiss-icon sizing, opacity transitions, and hover behaviors.
Migration Component with Modal and Backup
packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js, packages/bruno-app/src/components/CollectionSettings/Overview/Migration/StyledWrapper.js
Component renders only for collection.format === 'bru'. Displays "Convert to YML" button that opens confirmation modal with collection name. handleMigrate manages loading state, dispatches migration thunk, and swallows errors. handleExportBackup invokes Electron IPC renderer:export-collection-zip for backup, shows success/error toast, and manages exporting state. Modal includes backup export button with disabled/loading states. StyledWrapper defines migration and backup section layout, icon colors tied to theme yellow, borders, typography, spacing, and action button styling.
Redux Migration Thunk
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
Adds migrateCollectionToYml(collectionUid) thunk that validates collection, invokes Electron IPC renderer:migrate-collection-to-yml, removes collection and closes tabs, reopens/remounts via openCollectionEvent and mountCollection, retries reopen-only on mount failure, conditionally expands collection via toggleCollection, creates and selects collection-settings tab with overview subtab. Completes with success or failure toast; rejects on error.
Pill Dismissal E2E Test
tests/collection/migrate-to-yml/migrate-to-yml-pill.spec.ts
Playwright test validates pill lifecycle: clears prior localStorage dismissal state, opens fixture collection, asserts pill and dismiss-icon visible with label, verifies pill-body click navigates without dismissing, dismisses via cross icon and validates hidden state, checks persistence by reading localStorage with path-separator normalization, confirms pill remains hidden across settings tab switches, captures pageerror events and asserts none occurred.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • bijin-bruno
  • sid-bruno

Poem

🌊 A pill appears in the toolbar's glow,
"Convert to YML"—let the migrations flow.
Click, dismiss, or navigate with care,
localStorage remembers you were there. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the primary feature being added—collection migration to YML format—which is the core focus of all substantial changes across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js (1)

53-72: Add a stable test id to the new migration CTA.

This button is now part of the e2e surface, so giving it a data-testid will make the spec less brittle to copy or layout changes.

♻️ Suggested change
             <Button
+              data-testid="migrate-collection-to-yml-button"
               size="sm"
               color="primary"
               className="mt-2"

As per coding guidelines, 'Add data-testid to testable elements for Playwright.'

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js`
around lines 53 - 72, The new migration CTA lacks a stable test id; add a
data-testid attribute to the Button that opens the confirm modal (the Button
with onClick={() => setShowConfirmModal(true)} and props disabled={isMigrating}
loading={isMigrating}) such as data-testid="migrate-to-yml-cta" and also add a
matching data-testid to the confirm button inside the Modal (the Modal using
title="Migrate to YML format" and handleConfirm={handleMigrate}) so Playwright
tests can reliably target both the CTA and the confirm action.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`:
- Around line 3236-3249: The current flow removes the old collection
(dispatch(_removeCollection) and dispatch(closeAllCollectionTabs)) before
attempting to open/mount the replacement, which can leave the UI without the
collection if openCollectionEvent(uid, collectionPathname, updatedBrunoConfig)
or mountCollection(...) fails; change the sequence so you first attempt to open
and mount the new collection (dispatch(openCollectionEvent(...)) and await
dispatch(mountCollection(...))) and only after both succeed
dispatch(_removeCollection({ collectionUid })) and
dispatch(closeAllCollectionTabs({ collectionUid })), or alternatively implement
a failure rollback that re-dispatches the old collection state and reopens tabs
when mountCollection fails; ensure you reference the same
uid/collectionPathname/updatedBrunoConfig when performing the open/mount and use
collectionUid when removing/closing tabs so state remains consistent.

In `@packages/bruno-electron/src/ipc/collection.js`:
- Around line 2466-2517: The migration must be made transactional: instead of
writing final yml files and deleting .bru sources as you go, stage every
converted file using temporary names (e.g., create yml content via
stringifyCollection/stringifyFolder/stringifyRequest/stringifyEnvironment and
write to a safe temp pathname alongside the target using writeFile), keep track
of mappings from temp -> final and original -> backup, and only perform atomic
swaps (fs.renameSync temp -> final) and delete originals (fs.unlinkSync original
.bru and only remove collectionBruPath and brunoJsonPath) after all conversions
succeed; on any error, roll back by removing any staged temp files and leaving
originals untouched (or restore from backups if you implemented backup renames)
and rethrow/handle the error.

---

Nitpick comments:
In
`@packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js`:
- Around line 53-72: The new migration CTA lacks a stable test id; add a
data-testid attribute to the Button that opens the confirm modal (the Button
with onClick={() => setShowConfirmModal(true)} and props disabled={isMigrating}
loading={isMigrating}) such as data-testid="migrate-to-yml-cta" and also add a
matching data-testid to the confirm button inside the Modal (the Modal using
title="Migrate to YML format" and handleConfirm={handleMigrate}) so Playwright
tests can reliably target both the CTA and the confirm action.
🪄 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

Run ID: 82026683-25f1-4e3b-8a12-e58dda96e098

📥 Commits

Reviewing files that changed from the base of the PR and between 5db34df and 0ca7c0c.

📒 Files selected for processing (15)
  • packages/bruno-app/src/components/CollectionSettings/Overview/Info/index.js
  • packages/bruno-app/src/components/CollectionSettings/Overview/Migration/StyledWrapper.js
  • packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
  • packages/bruno-electron/src/ipc/collection.js
  • tests/collection/migrate-to-yml/fixtures/collection/api/folder.bru
  • tests/collection/migrate-to-yml/fixtures/collection/api/get-users.bru
  • tests/collection/migrate-to-yml/fixtures/collection/bruno.json
  • tests/collection/migrate-to-yml/fixtures/collection/collection.bru
  • tests/collection/migrate-to-yml/fixtures/collection/environments/Local.bru
  • tests/collection/migrate-to-yml/fixtures/collection/environments/Production.bru
  • tests/collection/migrate-to-yml/fixtures/collection/ping.bru
  • tests/collection/migrate-to-yml/fixtures/collection/post-json.bru
  • tests/collection/migrate-to-yml/init-user-data/preferences.json
  • tests/collection/migrate-to-yml/migrate-to-yml.spec.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (2)
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js (1)

3235-3256: ⚠️ Potential issue | 🟠 Major

Don't tear down the live collection before the replacement mounts.

Lines 3240-3241 remove the collection and close all of its tabs before openCollectionEvent() and mountCollection() have succeeded. If either step fails, the fallback only recreates bare collection state; it does not restore the user's tabs or mount state. Keep the existing collection alive until the replacement mount completes, or capture and restore that UI state during rollback.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`
around lines 3235 - 3256, The code removes the live collection
(dispatch(_removeCollection) and dispatch(closeAllCollectionTabs)) before the
new YAML-backed collection is opened and mounted, risking lost tabs/state on
failure; change the flow so you first capture the current collection UI state
(tabs and mount info), then invoke ipcRenderer and call
dispatch(openCollectionEvent(...)) and await dispatch(mountCollection(...)) for
the updatedBrunoConfig, and only after the mount succeeds dispatch
_removeCollection/closeAllCollectionTabs for the old collection (or
alternatively dispatch replacement actions that preserve tabs); on any error use
the captured UI state plus oldBrunoConfig to fully restore tabs and mount state
in the catch block (referencing openCollectionEvent, mountCollection,
_removeCollection, closeAllCollectionTabs, oldBrunoConfig, updatedBrunoConfig,
and reopenError).
packages/bruno-electron/src/ipc/collection.js (1)

2469-2553: ⚠️ Potential issue | 🔴 Critical

Make the on-disk migration atomic.

Lines 2524-2528 start deleting the source .bru files and bruno.json before the handler knows the rest of the migration has succeeded. If any later delete or getCollectionStats() call fails, the catch block only removes the new .yml files, so the collection can be left with neither the original sources nor the migrated output. Once bruno.json is gone, the watcher restart path can also no longer reconstruct the original config. Stage the YML files first and only swap/delete originals after every conversion succeeds.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/bruno-electron/src/ipc/collection.js` around lines 2469 - 2553, The
migration currently deletes originals (bruFilesToDelete and brunoJsonPath via
fs.unlinkSync) before verifying conversion succeeded; move the deletion/swap so
originals are only removed after conversion, stats and ymlBrunoConfig updates
succeed. Concretely: keep collecting writtenYmlFiles and bruFilesToDelete and do
not call fs.unlinkSync(bruFile) or fs.unlinkSync(brunoJsonPath) inside the try
block before getCollectionStats(); instead, after awaiting getCollectionStats()
and assigning ymlBrunoConfig.size/filesCount (but before returning
ymlBrunoConfig), perform the deletion of each path in bruFilesToDelete and then
unlink brunoJsonPath (or perform an atomic rename/swap if preferred). Ensure the
catch block still only cleans up writtenYmlFiles and that watcher.addWatcher can
read bruno.json if deletion never occurred.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`:
- Around line 3233-3255: The rollback currently reopens the collection using
oldBrunoConfig which lacks opencollection and causes Redux to treat the restored
UI as BRU; change the catch rollback to reopen using updatedBrunoConfig (or
reload the brunoConfig from disk) when calling openCollectionEvent so the
restored collection format matches the migrated files—update the restore call
that currently references oldBrunoConfig to use updatedBrunoConfig (or invoke
the config reload helper before dispatching openCollectionEvent) and keep
mountCollection/openCollectionEvent usage consistent.
- Around line 3259-3260: The code unconditionally dispatches
toggleCollection(uid), which flips the collapsed state and can re-collapse a
migrated collection; instead, before dispatching, check the current collection
collapsed state (e.g., via the store/selector for collection with id uid or
using getState()) and only call dispatch(toggleCollection(uid)) if that
collection is currently collapsed, or replace the call with an explicit expand
action (e.g., dispatch(expandCollection(uid))) if such an action exists; update
the logic around toggleCollection, uid and the collection state check
accordingly.

---

Duplicate comments:
In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`:
- Around line 3235-3256: The code removes the live collection
(dispatch(_removeCollection) and dispatch(closeAllCollectionTabs)) before the
new YAML-backed collection is opened and mounted, risking lost tabs/state on
failure; change the flow so you first capture the current collection UI state
(tabs and mount info), then invoke ipcRenderer and call
dispatch(openCollectionEvent(...)) and await dispatch(mountCollection(...)) for
the updatedBrunoConfig, and only after the mount succeeds dispatch
_removeCollection/closeAllCollectionTabs for the old collection (or
alternatively dispatch replacement actions that preserve tabs); on any error use
the captured UI state plus oldBrunoConfig to fully restore tabs and mount state
in the catch block (referencing openCollectionEvent, mountCollection,
_removeCollection, closeAllCollectionTabs, oldBrunoConfig, updatedBrunoConfig,
and reopenError).

In `@packages/bruno-electron/src/ipc/collection.js`:
- Around line 2469-2553: The migration currently deletes originals
(bruFilesToDelete and brunoJsonPath via fs.unlinkSync) before verifying
conversion succeeded; move the deletion/swap so originals are only removed after
conversion, stats and ymlBrunoConfig updates succeed. Concretely: keep
collecting writtenYmlFiles and bruFilesToDelete and do not call
fs.unlinkSync(bruFile) or fs.unlinkSync(brunoJsonPath) inside the try block
before getCollectionStats(); instead, after awaiting getCollectionStats() and
assigning ymlBrunoConfig.size/filesCount (but before returning ymlBrunoConfig),
perform the deletion of each path in bruFilesToDelete and then unlink
brunoJsonPath (or perform an atomic rename/swap if preferred). Ensure the catch
block still only cleans up writtenYmlFiles and that watcher.addWatcher can read
bruno.json if deletion never occurred.
🪄 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

Run ID: bc7ae1b6-af91-4268-a180-7e4aa66d370a

📥 Commits

Reviewing files that changed from the base of the PR and between 0ca7c0c and cd4bb83.

📒 Files selected for processing (2)
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
  • packages/bruno-electron/src/ipc/collection.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js (1)

3238-3250: ⚠️ Potential issue | 🟠 Major

Collection removed before replacement is ready.

The collection is removed from Redux and tabs are closed (lines 3238-3239) before openCollectionEvent and mountCollection complete. If either fails, the collection disappears from the UI. The catch block at line 3251 attempts recovery but doesn't call mountCollection, leaving the collection in an unmounted state (no watcher, items won't load).

Consider reordering so removal happens only after successful mount, or ensure the fallback also mounts the collection.

🔧 Suggested reordering approach
       .then(async (updatedBrunoConfig) => {
-        // Remove old collection state so we can recreate it with the new yml config.
-        // openCollectionEvent requires no existing collection with the same pathname.
-        dispatch(_removeCollection({ collectionUid }));
-        dispatch(closeAllCollectionTabs({ collectionUid }));
-
         try {
+          // Remove old collection state so we can recreate it with the new yml config.
+          // openCollectionEvent requires no existing collection with the same pathname.
+          dispatch(_removeCollection({ collectionUid }));
+          dispatch(closeAllCollectionTabs({ collectionUid }));
+
           // Reopen the collection with updated config (now yml format)
           await dispatch(openCollectionEvent(uid, collectionPathname, updatedBrunoConfig));

           // Mount the collection (starts the watcher and loads items)
           await dispatch(mountCollection({
             collectionUid: uid,
             collectionPathname: collectionPathname,
             brunoConfig: updatedBrunoConfig
           }));
         } catch (reopenError) {
           // Files on disk are already yml, so restore with updatedBrunoConfig (not old bru config)
           await dispatch(openCollectionEvent(uid, collectionPathname, updatedBrunoConfig));
+          await dispatch(mountCollection({
+            collectionUid: uid,
+            collectionPathname: collectionPathname,
+            brunoConfig: updatedBrunoConfig
+          }));
           throw reopenError;
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`
around lines 3238 - 3250, The code dispatches _removeCollection and
closeAllCollectionTabs before attempting openCollectionEvent and
mountCollection, so failures leave the collection removed/unmounted; change the
flow so you first call await dispatch(openCollectionEvent(...)) and await
dispatch(mountCollection(...)) and only after both succeed
dispatch(_removeCollection({ collectionUid })) and
dispatch(closeAllCollectionTabs({ collectionUid })), or alternatively keep the
current removal ordering but update the catch block to call
dispatch(mountCollection(...)) with the original/updated brunoConfig (and
re-open via openCollectionEvent if needed) to ensure the collection is mounted
and watcher/items are started on recovery; update references around
openCollectionEvent, mountCollection, _removeCollection, and
closeAllCollectionTabs accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`:
- Around line 3238-3250: The code dispatches _removeCollection and
closeAllCollectionTabs before attempting openCollectionEvent and
mountCollection, so failures leave the collection removed/unmounted; change the
flow so you first call await dispatch(openCollectionEvent(...)) and await
dispatch(mountCollection(...)) and only after both succeed
dispatch(_removeCollection({ collectionUid })) and
dispatch(closeAllCollectionTabs({ collectionUid })), or alternatively keep the
current removal ordering but update the catch block to call
dispatch(mountCollection(...)) with the original/updated brunoConfig (and
re-open via openCollectionEvent if needed) to ensure the collection is mounted
and watcher/items are started on recovery; update references around
openCollectionEvent, mountCollection, _removeCollection, and
closeAllCollectionTabs accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2504a85f-aa63-441b-a012-49b00dd0c5c1

📥 Commits

Reviewing files that changed from the base of the PR and between cd4bb83 and e0d95b7.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
✅ Files skipped from review due to trivial changes (1)
  • packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js (1)

24-26: ⚡ Quick win

Do not silently swallow migration failures.

The empty catch drops the rejection context, which makes failed migrations look like no-ops and hurts diagnosability. Handle the error explicitly (toast/log/rethrow) while keeping the finally reset.

Suggested minimal change
   dispatch(migrateCollectionToYml(collection.uid))
-    .catch(() => { })
+    .catch((error) => {
+      toast.error(error?.message || 'Failed to migrate collection');
+    })
     .finally(() => setIsMigrating(false));
🤖 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/CollectionSettings/Overview/Migration/index.js`
around lines 24 - 26, The catch block in the migration promise chain (where
migrateCollectionToYml is called) silently swallows errors with an empty
handler, making failures invisible and hard to debug. Replace the empty catch
block with explicit error handling that either logs the error, shows a toast
notification, or rethrows it to provide visibility into migration failures,
while keeping the finally block that resets setIsMigrating(false) intact.
🤖 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/RequestTabs/CollectionHeader/index.js`:
- Around line 602-620: The migrate pill button contains a nested interactive
element (the span with className pill-dismiss that has onClick and
role="button") inside the outer button, which violates HTML semantics and
creates keyboard accessibility issues. Refactor the structure by wrapping both
interactive elements in a parent container and making them sibling buttons: the
main outer button should handle the viewCollectionSettings action, and the
dismiss span with className pill-dismiss should be converted to a separate
sibling button that handles the dismissMigratePill action instead of being
nested as a child with onClick.

---

Nitpick comments:
In
`@packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js`:
- Around line 24-26: The catch block in the migration promise chain (where
migrateCollectionToYml is called) silently swallows errors with an empty
handler, making failures invisible and hard to debug. Replace the empty catch
block with explicit error handling that either logs the error, shows a toast
notification, or rethrows it to provide visibility into migration failures,
while keeping the finally block that resets setIsMigrating(false) intact.
🪄 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

Run ID: a750e444-052a-4154-a804-6d0565984a8e

📥 Commits

Reviewing files that changed from the base of the PR and between e0d95b7 and 1970d22.

📒 Files selected for processing (5)
  • packages/bruno-app/src/components/CollectionSettings/Overview/Migration/StyledWrapper.js
  • packages/bruno-app/src/components/CollectionSettings/Overview/Migration/index.js
  • packages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.js
  • packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js
  • tests/collection/migrate-to-yml/migrate-to-yml-pill.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/bruno-app/src/components/CollectionSettings/Overview/Migration/StyledWrapper.js

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.js (1)

194-200: ⚡ Quick win

Align .display-icon block with repo formatting rules.

Please add spacing before { and a trailing semicolon after the border-radius declaration to keep this block consistent with the project’s JS/styled-components style conventions.

Proposed minimal diff
-  .display-icon{
+  .display-icon {
     padding: 4px;
     box-sizing: content-box;
     &:hover {
       background: ${(props) => props.theme.sidebar.collection.item.hoverBg};
-      border-radius: ${(props) => props.theme.border.radius.sm}
+      border-radius: ${(props) => props.theme.border.radius.sm};
     }
   }

As per coding guidelines, statements should end with semicolons and punctuation/spacing should remain consistent.

🤖 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/StyledWrapper.js`
around lines 194 - 200, The `.display-icon` CSS block in StyledWrapper.js has
two formatting inconsistencies with the project's style guidelines. Add a space
before the opening brace after `.display-icon` (changing `.display-icon{` to
`.display-icon {`), and add a trailing semicolon after the `border-radius` CSS
property declaration within the `&:hover` block. These changes ensure the
styled-components syntax adheres to the repository's formatting conventions for
consistency.

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.

Nitpick comments:
In
`@packages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.js`:
- Around line 194-200: The `.display-icon` CSS block in StyledWrapper.js has two
formatting inconsistencies with the project's style guidelines. Add a space
before the opening brace after `.display-icon` (changing `.display-icon{` to
`.display-icon {`), and add a trailing semicolon after the `border-radius` CSS
property declaration within the `&:hover` block. These changes ensure the
styled-components syntax adheres to the repository's formatting conventions for
consistency.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 971fa1df-07be-4601-803e-c3f544b7a37a

📥 Commits

Reviewing files that changed from the base of the PR and between 1970d22 and de51b87.

📒 Files selected for processing (3)
  • packages/bruno-app/src/components/RequestTabs/CollectionHeader/StyledWrapper.js
  • packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
💤 Files with no reviewable changes (1)
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/bruno-app/src/components/RequestTabs/CollectionHeader/index.js

@utkarsh-bruno utkarsh-bruno left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see the critical coderabbit review is already addressed. Looks good to me.

This was referenced Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants