Skip to content

fix: import tests#7067

Merged
bijin-bruno merged 2 commits into
usebruno:mainfrom
naman-bruno:fix/import-tests
Feb 6, 2026
Merged

fix: import tests#7067
bijin-bruno merged 2 commits into
usebruno:mainfrom
naman-bruno:fix/import-tests

Conversation

@naman-bruno
Copy link
Copy Markdown
Collaborator

@naman-bruno naman-bruno commented Feb 6, 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

  • Bug Fixes
    • Corrected authentication detection to avoid false positives when request auth is missing or unspecified.
    • Added safeguards to handle missing request sections (headers, variables, scripts) without errors.
    • Improved null-safety for documentation handling to prevent runtime issues with incomplete collection data.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 6, 2026

Walkthrough

This change improves null-safety in collection stringification by fixing auth mode detection logic to treat undefined as false and adding optional chaining throughout request property access patterns to prevent runtime errors when intermediate objects are missing.

Changes

Cohort / File(s) Summary
Null-Safety Improvements
packages/bruno-filestore/src/formats/yml/stringifyCollection.ts
Fixed hasRequestAuth logic to correctly treat undefined/missing auth as false; added optional chaining (?.) for headers, vars, scripts, docs, and auth properties; updated function invocations to safely pass optional request objects.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • usebruno/bruno#7009: Modifies the same yml/stringifyCollection file and handles request post-response variables/actions with adjusted safe property access patterns.

Suggested labels

size/XS

Suggested reviewers

  • helloanoop
  • lohit-bruno
  • bijin-bruno

Poem

Optional chains hum a gentle tune,
Auth modes now judged by clearer rune,
Requests guarded from the void's surprise,
Docs and scripts no longer compromise,
Small fixes, safer runs — a quiet prize.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: import tests' is vague and doesn't clearly convey the actual changes made, which involve defensive null/undefined checks for request-related properties in collection stringification. Consider a more descriptive title that reflects the actual changes, such as 'fix: add null safety checks for request properties in collection stringification' or 'fix: prevent undefined access when stringifying collections without request data'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

@bijin-bruno bijin-bruno merged commit 786326a into usebruno:main Feb 6, 2026
7 of 11 checks passed
bijin-bruno pushed a commit that referenced this pull request Feb 11, 2026
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