Skip to content

add support for additional context roots in opencollection#6995

Merged
bijin-bruno merged 3 commits intousebruno:mainfrom
naman-bruno:bugfix/additionalContextRoots
Feb 2, 2026
Merged

add support for additional context roots in opencollection#6995
bijin-bruno merged 3 commits intousebruno:mainfrom
naman-bruno:bugfix/additionalContextRoots

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

Release Notes

  • New Features
    • Collections now support configurable script context roots to declare additional script lookup locations.
    • Script context settings are preserved during collection import and export, ensuring user-provided additional context roots are retained.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

Walkthrough

Added a new optional scripts.additionalContextRoots?: string[] to the BrunoConfig type and updated YAML parse/stringify paths to round-trip this field under oc.extensions.bruno.scripts.additionalContextRoots.

Changes

Cohort / File(s) Summary
Type Definition
packages/bruno-converters/src/opencollection/types.ts
Added optional scripts property to BrunoConfig with additionalContextRoots?: string[].
YAML Parsing
packages/bruno-filestore/src/formats/yml/parseCollection.ts
Read oc.extensions.bruno.scripts.additionalContextRoots (if present) and merge into brunoConfig.scripts.additionalContextRoots, preserving existing brunoConfig.scripts.
YAML Stringify
packages/bruno-filestore/src/formats/yml/stringifyCollection.ts
When brunoConfig.scripts.additionalContextRoots is non-empty, ensure oc.extensions.bruno.scripts.additionalContextRoots is written to the output YAML.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

size/L

Suggested reviewers

  • helloanoop
  • lohit-bruno

Poem

🌱 New roots for scripts unfurl,
YAML sings, types meet the world,
Parse and write in tidy swirl,
Small change, big map unfurled ✨

🚥 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 describes the main change: adding support for additional context roots in the opencollection format across type definitions, parsing, and stringification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

🤖 Fix all issues with AI agents
In `@packages/bruno-filestore/src/formats/yml/parseCollection.ts`:
- Around line 41-48: The current assignment trusts
brunoExtensions.script.additionalContextRoots and may copy non-array values into
brunoConfig.scripts.additionalContextRoots; update the block that reads
brunoExtensions (from oc.extensions?.bruno) to first check
Array.isArray(brunoExtensions?.script?.additionalContextRoots) and then assign a
sanitized array (e.g., filter to only string values) to
brunoConfig.scripts.additionalContextRoots — only set the property when the
value is a valid string[] to avoid corrupting brunoConfig.scripts.

if (!oc.extensions.bruno) {
oc.extensions.bruno = {};
}
(oc.extensions.bruno as any).script = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be scripts instead of script

bijin-bruno
bijin-bruno previously approved these changes Feb 2, 2026
@bijin-bruno bijin-bruno merged commit b9d9a27 into usebruno:main Feb 2, 2026
7 of 8 checks passed
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