Skip to content

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

Open
sharan-bruno wants to merge 3 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 3 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 when exporting/importing collections (generating opencollection.yml by default).
  • Bug Fixes

    • Improved default import behavior so collections generate the expected folder/file structure when no format is chosen, and avoid generating bruno.json in the default flow.
  • Tests

    • Added end-to-end coverage validating the Bulk Import modal’s default “File Format” selection and confirming the generated output files and exclusions.

@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: 5e062dba-d98a-40f4-9875-1d0c339fafb3

📥 Commits

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

📒 Files selected for processing (3)
  • packages/bruno-app/src/components/Sidebar/BulkImportCollectionLocation/index.js
  • tests/import/bulk-import/yml-as-default-file-format.spec.ts
  • tests/utils/page/locators.ts
✅ Files skipped from review due to trivial changes (1)
  • tests/utils/page/locators.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/import/bulk-import/yml-as-default-file-format.spec.ts
  • packages/bruno-app/src/components/Sidebar/BulkImportCollectionLocation/index.js

Walkthrough

The bulk import modal and CLI collection generation now default to yml instead of bru. The modal also gains test IDs, and a new Playwright spec validates the default selector and generated file names.

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 state default and the CLI fallback format both change from bru to yml.
Test ID attributes on bulk import modal
packages/bruno-app/src/components/Sidebar/BulkImportCollectionLocation/index.js
The bulk import modal, location input, and format selector gain test identifiers.
Playwright locators and e2e spec for yml default
tests/utils/page/locators.ts, tests/utils/page/actions.ts, tests/import/bulk-import/yml-as-default-file-format.spec.ts
Bulk import locators and a modal-opening helper are added, along with a new spec that checks the yml default and filesystem output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

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

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • bijin-bruno

Poem

.bru drifts off in a gentle breeze,
yml now settles in with ease.
The modal glows with test IDs bright,
And Playwright nods, “Yes, that looks right.”

🚥 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 reflects the main change: switching 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.

✏️ 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.

@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

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