Skip to content

make yml default option#6985

Merged
bijin-bruno merged 4 commits intousebruno:mainfrom
naman-bruno:feat/yml-default
Feb 2, 2026
Merged

make yml default option#6985
bijin-bruno merged 4 commits intousebruno:mainfrom
naman-bruno:feat/yml-default

Conversation

@naman-bruno
Copy link
Collaborator

@naman-bruno naman-bruno commented Jan 30, 2026

Description

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

  • New Features

    • Advanced Options dropdown in Create Collection to choose collection file format.
  • UI Updates

    • Removed beta badge indicators from Share Collection and Create Collection.
    • Reworked Create Collection footer layout to surface the advanced-options control.
  • Changes

    • Default collection format changed to YAML for new collections and imports.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

Walkthrough

Centralized DEFAULT_COLLECTION_FORMAT = 'yml' added and replaces hardcoded 'bru' defaults across filestore, electron IPC, and app code. CreateCollection UI now conditionally shows file format via a dropdown and footer layout changed. Beta badge removed from ShareCollection and CreateCollection styles.

Changes

Cohort / File(s) Summary
ShareCollection UI
packages/bruno-app/src/components/ShareCollection/.../StyledWrapper.js, packages/bruno-app/src/components/ShareCollection/index.js
Removed beta badge styling and removed the Beta span/relative positioning from the second share option.
CreateCollection UI
packages/bruno-app/src/components/Sidebar/CreateCollection/.../StyledWrapper.js, packages/bruno-app/src/components/Sidebar/CreateCollection/index.js
Removed beta-badge and discussion-link styles; added AdvancedOptions dropdown (forwardRef) to toggle file format visibility, replaced external-link icon with caret, reworked footer into two-sided layout.
Default Constant (app & filestore)
packages/bruno-app/src/utils/common/constants.js, packages/bruno-filestore/src/constants.ts
Added exported DEFAULT_COLLECTION_FORMAT with value 'yml'.
Filestore API & Workers
packages/bruno-filestore/src/index.ts, packages/bruno-filestore/src/workers/..., packages/bruno-filestore/src/workers/worker-script.ts
Replaced hardcoded 'bru' defaults with DEFAULT_COLLECTION_FORMAT in multiple public function/worker defaults; re-exported constants.
Electron IPC & Utils
packages/bruno-electron/src/ipc/collection.js, packages/bruno-electron/src/utils/collection-import.js, packages/bruno-electron/src/utils/collection.js, packages/bruno-electron/src/utils/parse.js
Switched default format parameters to DEFAULT_COLLECTION_FORMAT and propagated import from filestore; parse functions ensure request.body fields exist after parsing.
App-level fallbacks & actions
packages/bruno-app/src/components/SaveTransientRequest/index.js, packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
Replaced hardcoded 'bru' fallback with DEFAULT_COLLECTION_FORMAT when deriving filenames and in import actions.
CLI behavior
packages/bruno-cli/src/commands/run.js
Explicitly calls parseEnvironment with { format: 'bru' } for non-JSON/YAML env files and uses .bru when deriving basename for BRU files.

Sequence Diagram(s)

sequenceDiagram
    participant UI as CreateCollection UI
    participant App as Renderer (App)
    participant IPC as Electron IPC
    participant Filestore as `@usebruno/filestore`
    participant Worker as Filestore Worker

    UI->>App: user selects format / creates collection (uses DEFAULT_COLLECTION_FORMAT)
    App->>IPC: send create/import collection (format default from constant)
    IPC->>Filestore: invoke parse/stringify with format (DEFAULT_COLLECTION_FORMAT)
    Filestore->>Worker: enqueueTask / parseRequest (format forwarded)
    Worker-->>Filestore: parsed/stringified payload
    Filestore-->>IPC: result
    IPC-->>App: result
    App-->>UI: show success/failure
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #6366 — Related changes to CreateCollection defaults and format UI.
  • #6784 — Related edits to CLI/environment parsing logic.
  • #6547 — Touches ShareCollection component; UI-related overlap.

Suggested labels

pr-feature

Suggested reviewers

  • helloanoop
  • lohit-bruno

Poem

🎀 From 'bru' to 'yml' the default takes wing,
Constants aligned, the pipelines sing,
Dropdowns reveal formats on demand,
Badges fade quietly, styles unspanned,
Code flows clearer — small cheer, big plan. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective: changing the default collection format from 'bru' to 'yml' across the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

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

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.

Copy link
Collaborator

@bijin-bruno bijin-bruno left a comment

Choose a reason for hiding this comment

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

@naman-bruno
I think we have to handle additional places like

  1. import collection
  2. in several places in codease, we have format defaults to 'bru'. Let's put this as a constant at a common place and use in those places.
    etc

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 (1)
packages/bruno-electron/src/utils/parse.js (1)

3-10: ⚠️ Potential issue | 🟡 Minor

Update JSDoc to match the new default format.

The comment still says the default is 'bru', but the function now defaults to DEFAULT_COLLECTION_FORMAT ('yml').

📝 Suggested doc fix
- * `@param` {string} format - Collection format, defaults to 'bru'
+ * `@param` {string} format - Collection format, defaults to DEFAULT_COLLECTION_FORMAT ('yml')
🤖 Fix all issues with AI agents
In `@packages/bruno-filestore/src/index.ts`:
- Around line 41-46: The default format constant DEFAULT_COLLECTION_FORMAT is
'yml' but parseRequestAndRedactBody only accepts 'bru', causing an error when no
format is passed; update the default to 'bru' so the function's default matches
supported formats. Locate the DEFAULT_COLLECTION_FORMAT definition and change
its value to 'bru' (or alternatively change the function signature/default
options for parseRequestAndRedactBody to use { format: 'bru' }) so
parseRequestAndRedactBody(content, options?) will use 'bru' by default and call
bruRequestParseAndRedactBodyData without throwing.
🧹 Nitpick comments (1)
packages/bruno-app/src/components/Sidebar/CreateCollection/index.js (1)

94-106: Add a brief JSDoc for AdvancedOptions.

It’s a new abstraction; a short doc comment clarifies intent and props usage.

✍️ Suggested JSDoc
-  const AdvancedOptions = forwardRef((props, ref) => {
+  /**
+   * Advanced options dropdown trigger for the Create Collection dialog.
+   */
+  const AdvancedOptions = forwardRef((props, ref) => {
As per coding guidelines: Add JSDoc comments to abstractions for additional details.

@@ -1,5 +1,7 @@
export type CollectionFormat = 'bru' | 'yml';

export const DEFAULT_COLLECTION_FORMAT: CollectionFormat = 'yml';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this is not a type, I think we should move DEFAULT_COLLECTION_FORMAT to ./constants.ts

bijin-bruno
bijin-bruno previously approved these changes Feb 2, 2026
@bijin-bruno bijin-bruno merged commit 8c997c4 into usebruno:main Feb 2, 2026
7 of 8 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Feb 20, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants