Skip to content

feat(import): set yml as a default file formal accross all type of imports#8363

Open
sharan-bruno wants to merge 4 commits into
usebruno:mainfrom
sharan-bruno:feat/set_yml_to_default_collection_format
Open

feat(import): set yml as a default file formal accross all type of imports#8363
sharan-bruno wants to merge 4 commits into
usebruno:mainfrom
sharan-bruno:feat/set_yml_to_default_collection_format

Conversation

@sharan-bruno

@sharan-bruno sharan-bruno commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Jira: https://usebruno.atlassian.net/browse/BRU-3654

Description

This PR sets OpenCollection (YAML) as the default file format for the Bulk Import flow — the format selector in the Bulk Import modal now defaults to yml instead of bru, so imported collections are written as opencollection.yml unless the user explicitly switches to BRU. To cover this, it adds an e2e spec (yml-as-default-file-format.spec.ts) verifying both the UI default and that importing with the default actually writes opencollection.yml (and never bruno.json) to disk. Along the way, it adds stable data-testids to the Bulk Import modal and its format selector, and exposes matching locators in the shared test helper so the suite relies on test ids rather than CSS class selectors.

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 by CodeRabbit

  • New Features

    • Bulk Import now defaults to YAML for new collection exports/imports (creating opencollection.yml by default).
  • Bug Fixes

    • Default serialization behavior now consistently uses the standard collection format when no format is selected, avoiding generation of bruno.json in the default flow.
  • Tests

    • Added end-to-end coverage verifying the Bulk Import modal’s default “File Format” selection and the resulting output files.
    • Improved test locators and added a helper to open the Bulk Import modal.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2a1da1e6-699d-4d2c-a6a5-abac601f0860

📥 Commits

Reviewing files that changed from the base of the PR and between 7ba25e2 and bcb01b5.

📒 Files selected for processing (2)
  • packages/bruno-app/src/components/Sidebar/BulkImportCollectionLocation/index.js
  • packages/bruno-cli/src/utils/collection.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/bruno-app/src/components/Sidebar/BulkImportCollectionLocation/index.js

Walkthrough

The bulk import UI and CLI now default unspecified collection formats to yml. The modal also adds test IDs, and a new Playwright spec validates the default selector and generated files.

Changes

Bulk Import Default Format: bru → yml

Layer / File(s) Summary
Default format switch in app UI and CLI
packages/bruno-app/src/components/Sidebar/BulkImportCollectionLocation/index.js, packages/bruno-cli/src/utils/collection.js
The bulk import component and CLI collection serialization now use DEFAULT_COLLECTION_FORMAT instead of hardcoded bru.
Bulk import test hooks and locators
packages/bruno-app/src/components/Sidebar/BulkImportCollectionLocation/index.js, tests/utils/page/locators.ts, tests/utils/page/actions.ts
The bulk import modal and its inputs gain test IDs, and the page helpers add bulk import locators plus an opener for the modal flow.
Playwright spec for the yml default
tests/import/bulk-import/yml-as-default-file-format.spec.ts
A new end-to-end test checks the default yml selection and the resulting collection files written to disk.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • usebruno/bruno#6533: Updates collection import format plumbing through a closely related import flow.
  • usebruno/bruno#6985: Switches default collection format handling toward yml in collection generation and import code.
  • usebruno/bruno#7017: Changes the import modal’s initial collection format state from bru to yml.

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • bijin-bruno

Poem

.bru steps aside with a quiet sigh,
yml now takes the open sky.
Test IDs sparkle, the checks all sing,
And bulk import hums in default spring.

🚥 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 is relevant and describes the main change: changing the default import file format to YAML/yml.
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.
✨ 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.

@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)
tests/import/bulk-import/yml-as-default-file-format.spec.ts (1)

8-17: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use a fixtures directory for bulk import sample files.

The test currently pulls sample inputs from ../test-data; for consistency with the E2E convention, move these assets under a fixtures path and update testDataDir accordingly.

Suggested minimal update
-  const testDataDir = path.join(__dirname, '../test-data');
+  const testDataDir = path.join(__dirname, 'fixtures');

As per path instructions, "Ensure that the fixtures like the collections are nested inside the fixtures folder".

🤖 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/import/bulk-import/yml-as-default-file-format.spec.ts` around lines 8 -
17, Move the bulk import sample inputs out of the test-data location and point
the test to a fixtures directory instead, following the E2E convention that
collections and sample assets live under fixtures. Update the testDataDir setup
in yml-as-default-file-format.spec.ts so openBulkImportModal and any other
import helpers resolve sample-postman.json and sample-insomnia.json from the new
fixtures path, and keep the existing helper names unchanged so the rest of the
test remains intact.

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/import/bulk-import/yml-as-default-file-format.spec.ts`:
- Around line 8-17: Move the bulk import sample inputs out of the test-data
location and point the test to a fixtures directory instead, following the E2E
convention that collections and sample assets live under fixtures. Update the
testDataDir setup in yml-as-default-file-format.spec.ts so openBulkImportModal
and any other import helpers resolve sample-postman.json and
sample-insomnia.json from the new fixtures path, and keep the existing helper
names unchanged so the rest of the test remains intact.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 672008de-959b-476a-94ac-1d3f68bfb23a

📥 Commits

Reviewing files that changed from the base of the PR and between 7765320 and eca062e.

📒 Files selected for processing (4)
  • packages/bruno-app/src/components/Sidebar/BulkImportCollectionLocation/index.js
  • packages/bruno-cli/src/utils/collection.js
  • tests/import/bulk-import/yml-as-default-file-format.spec.ts
  • tests/utils/page/locators.ts

@sharan-bruno sharan-bruno changed the title feat(import): set yml as a default file formal accross all type of im… feat(import): set yml as a default file formal accross all type of imports Jun 24, 2026
Comment thread tests/import/bulk-import/yml-as-default-file-format.spec.ts Outdated
Comment thread tests/import/bulk-import/yml-as-default-file-format.spec.ts Outdated
Comment thread packages/bruno-app/src/components/Sidebar/BulkImportCollectionLocation/index.js Outdated
Comment thread tests/utils/page/locators.ts Outdated
Comment thread tests/import/bulk-import/yml-as-default-file-format.spec.ts Outdated
const [applyToCollection, setApplyToCollection] = useState(false);
const [groupingType, setGroupingType] = useState('tags');
const [collectionFormat, setCollectionFormat] = useState('bru');
const [collectionFormat, setCollectionFormat] = useState('yml');

@vijayh-bruno vijayh-bruno Jun 26, 2026

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.

we have 'yml' set as a constant for default format- https://github.com/usebruno/bruno/blob/main/packages/bruno-filestore/src/constants.ts

use that instead of hardcoding. Do this everywhere

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

addressed this - using DEFAULT_COLLECTION_FORMAT from constants

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