Skip to content

add: export info & remove unused component#6547

Merged
bijin-bruno merged 2 commits intousebruno:mainfrom
naman-bruno:add/export-info
Dec 30, 2025
Merged

add: export info & remove unused component#6547
bijin-bruno merged 2 commits intousebruno:mainfrom
naman-bruno:add/export-info

Conversation

@naman-bruno
Copy link
Collaborator

@naman-bruno naman-bruno commented Dec 29, 2025

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

    • Exports now include export timestamp and the Bruno version used.
    • Import flow now shows success/error toasts and accepts additional import options.
  • Removed

    • Legacy modal-based "Export Collection" UI has been removed.
  • Refactor

    • Export and conversion logic reorganized to centralize export metadata handling.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 29, 2025

Walkthrough

Exports now carry export metadata and accept an optional version argument. Exporter signatures were updated to receive version; UI export component was removed; import flow and converters were adjusted to read/write new metadata and new BrunoConfig presets.

Changes

Cohort / File(s) Summary
Export modal removal
packages/bruno-app/src/components/Sidebar/Collections/Collection/ExportCollection/index.js
Deleted modal UI component that offered "Bruno Collection" / "Postman Collection" export actions.
Version propagation in UI
packages/bruno-app/src/components/ShareCollection/index.js
Added useApp hook usage to obtain app version and pass it as second arg to exportBrunoCollection and exportOpenCollection.
Export metadata & signature changes
packages/bruno-app/src/utils/collections/export.js, packages/bruno-app/src/utils/exporters/opencollection.js
Export functions now accept (collection, version); exported payloads gain exportedAt (ISO) and exportedUsing / extensions.bruno.exportedUsing entries.
Import sanitization
packages/bruno-app/src/utils/importers/bruno-collection.js
Added stripExportMetadata to remove exportedAt/exportedUsing from incoming Bruno collections before processing.
Import flow feedback
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js
handleImportCollectionLocation now accepts options and forwards them to importCollection; adds success/error toast handling and improved modal cleanup.
OpenCollection ↔ Bruno conversions
packages/bruno-converters/src/opencollection/bruno-to-opencollection.ts, packages/bruno-converters/src/opencollection/opencollection-to-bruno.ts, packages/bruno-converters/src/opencollection/types.ts, packages/bruno-converters/src/opencollection/common/auth.ts
Converters now use a nested bruno extension object (e.g., extensions.bruno) and support presets mapping; BrunoConfig type gains optional presets with requestType/requestUrl; some defaulting semantics adjusted for OAuth2 fields.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

size/M

Suggested reviewers

  • lohit-bruno
  • bijin-bruno
  • helloanoop

Poem

🎁 A collection packed with timestamp and name,
Bruno's version now signed in the frame,
Presets tucked where extensions reside,
Exports and imports now clearer inside —
Small tweaks, bright metadata, onward we aim!

Pre-merge checks and finishing touches

✅ 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 captures the two main objectives: adding export metadata (exportedAt, exportedUsing) and removing the ExportCollection component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e1da4c7 and 853a879.

📒 Files selected for processing (7)
  • packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js
  • packages/bruno-app/src/utils/exporters/opencollection.js
  • packages/bruno-app/src/utils/importers/bruno-collection.js
  • packages/bruno-converters/src/opencollection/bruno-to-opencollection.ts
  • packages/bruno-converters/src/opencollection/common/auth.ts
  • packages/bruno-converters/src/opencollection/opencollection-to-bruno.ts
  • packages/bruno-converters/src/opencollection/types.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-app/src/utils/importers/bruno-collection.js
  • packages/bruno-app/src/utils/exporters/opencollection.js
  • packages/bruno-converters/src/opencollection/common/auth.ts
  • packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js
  • packages/bruno-converters/src/opencollection/bruno-to-opencollection.ts
  • packages/bruno-converters/src/opencollection/opencollection-to-bruno.ts
  • packages/bruno-converters/src/opencollection/types.ts
🧠 Learnings (3)
📚 Learning: 2025-12-16T07:16:23.647Z
Learnt from: sanish-bruno
Repo: usebruno/bruno PR: 6090
File: tests/scripting/hooks/init-user-data/ui-state-snapshot.json:1-8
Timestamp: 2025-12-16T07:16:23.647Z
Learning: For e2e tests in the bruno repository: Collections that are shared between CLI and UI tests (comprehensive test suites testing core functionality) should be placed in `packages/bruno-tests/` to avoid duplication. The `tests/**/fixtures/collection` pattern should be used for test-specific collections that test particular UI behaviors or are specific to a single test file.

Applied to files:

  • packages/bruno-app/src/utils/importers/bruno-collection.js
  • packages/bruno-converters/src/opencollection/bruno-to-opencollection.ts
📚 Learning: 2025-12-17T21:41:24.730Z
Learnt from: naman-bruno
Repo: usebruno/bruno PR: 6407
File: packages/bruno-app/src/components/Environments/ConfirmCloseEnvironment/index.js:5-41
Timestamp: 2025-12-17T21:41:24.730Z
Learning: Do not suggest PropTypes validation for React components in the Bruno codebase. The project does not use PropTypes, so reviews should avoid proposing PropTypes and rely on the existing typing/validation approach (e.g., TypeScript or alternative runtime checks) if applicable. This guideline applies broadly to all JavaScript/JSX components in the repo.

Applied to files:

  • packages/bruno-app/src/utils/importers/bruno-collection.js
  • packages/bruno-app/src/utils/exporters/opencollection.js
  • packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js
📚 Learning: 2025-12-02T07:24:50.311Z
Learnt from: bijin-bruno
Repo: usebruno/bruno PR: 6263
File: packages/bruno-requests/src/auth/oauth2-helper.ts:249-249
Timestamp: 2025-12-02T07:24:50.311Z
Learning: In OAuth2 Basic Auth headers for Bruno, clientSecret is optional and can be omitted. When constructing the Authorization header in `packages/bruno-requests/src/auth/oauth2-helper.ts`, use `clientSecret || ''` instead of `clientSecret!` to properly handle cases where only clientId is provided, per community requests.

Applied to files:

  • packages/bruno-converters/src/opencollection/common/auth.ts
  • packages/bruno-converters/src/opencollection/opencollection-to-bruno.ts
🧬 Code graph analysis (2)
packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js (1)
packages/bruno-app/src/components/Sidebar/Sections/CollectionsSection/index.js (2)
  • handleImportCollectionLocation (61-72)
  • dispatch (34-34)
packages/bruno-converters/src/opencollection/bruno-to-opencollection.ts (1)
packages/bruno-converters/src/opencollection/types.ts (1)
  • BrunoConfig (169-207)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: Unit Tests
  • GitHub Check: CLI Tests
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: SSL Tests - Linux
🔇 Additional comments (10)
packages/bruno-converters/src/opencollection/common/auth.ts (1)

63-63: LGTM! Default value semantics improved.

The updated defaults for OAuth2 configuration fields are more semantically correct:

  • Boolean fields (pkce, autoRefreshToken, autoFetchToken) now default to false instead of null
  • additionalParameters defaults to an empty object instead of null

This aligns with the expanded configuration surface and ensures robust handling of new config fields.

Also applies to: 70-72

packages/bruno-app/src/components/WorkspaceHome/WorkspaceOverview/index.js (1)

60-71: LGTM! Enhanced import flow with error handling.

The function signature change maintains backward compatibility with the default parameter. Success and error handling with toast notifications provide good user feedback.

packages/bruno-app/src/utils/importers/bruno-collection.js (2)

4-8: LGTM! Metadata cleanup before processing.

The helper function cleanly strips export metadata (exportedAt, exportedUsing) before processing. The mutation pattern is consistent with the subsequent processing functions in the pipeline.


12-13: LGTM! Proper sequencing of import processing.

Stripping export metadata before hydration ensures imported collections are processed consistently regardless of their export source.

packages/bruno-converters/src/opencollection/bruno-to-opencollection.ts (1)

148-175: LGTM! Proper nesting of Bruno-specific extensions.

The refactoring from flat extensions.ignore to nested extensions.bruno structure is well-implemented:

  • Conditional population prevents empty objects in output
  • Presets are correctly extracted when present
  • Only assigns extensions when content exists

This aligns with the new BrunoConfig type additions and provides better namespace isolation.

packages/bruno-converters/src/opencollection/opencollection-to-bruno.ts (2)

10-20: LGTM! Proper extraction of nested Bruno extensions.

The extraction logic correctly handles the nested extensions.bruno structure with defensive checks:

  • Type annotation aligns with the export-side structure
  • Array validation for ignore list
  • Maintains sensible defaults

29-37: LGTM! Symmetric presets handling.

The presets extraction mirrors the export logic in bruno-to-opencollection.ts, ensuring bidirectional consistency in the conversion flow.

packages/bruno-app/src/utils/exporters/opencollection.js (2)

6-6: LGTM! Version parameter added to export signature.

The function signature update to accept an optional version parameter enables version-aware exports throughout the application.


9-16: LGTM! Export metadata properly nested.

The metadata additions are well-structured:

  • Defensive initialization of nested extensions.bruno
  • ISO timestamp for exportedAt
  • Conditional version formatting for exportedUsing

This aligns with the nested extension structure used in the converter modules.

packages/bruno-converters/src/opencollection/types.ts (1)

174-177: LGTM! Clean type extension for presets.

The optional presets field with nested requestType and requestUrl properties provides the type foundation for preset-based request configuration across the OpenCollection/Bruno conversion flow.


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.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 30, 2025
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