Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(connection): support for multiple hosts urls #327 #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
kmruiz merged 6 commits into main from gh-327
Sep 4, 2025
Merged

Conversation

Copy link
Collaborator

@kmruiz kmruiz commented Sep 4, 2025
edited
Loading

Proposed changes

Bug: MongoDB URLs passed as environment variables that contain multiple hosts are treated as arrays instead of actual URLS.
Fix: When the environment variable contents start with a mongodb connection protocol (mongodb://, mongodb+srv://) it skips preprocessing the contents and stores it in the config as is.

Fixes:

Checklist

@Copilot Copilot AI review requested due to automatic review settings September 4, 2025 06:52
@kmruiz kmruiz requested a review from a team as a code owner September 4, 2025 06:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where MongoDB connection strings with multiple hosts were incorrectly parsed as arrays instead of being treated as valid URL strings. The fix adds special handling for MongoDB URLs in the environment variable parsing logic.

  • Added MongoDB protocol detection to skip preprocessing of connection strings
  • Added test coverage for multiple-host MongoDB URLs

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/common/config.ts Added MongoDB URL detection to prevent preprocessing of connection strings starting with mongodb:// or mongodb+srv://
tests/unit/common/config.test.ts Added test case to verify multiple-host MongoDB URLs are preserved correctly

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Environment variables are always strings, but we will add this check
in case we receive something that is not process.env.
CLI parsing doesn't have that issue but, in case we refactor
add a test to ensure we don't regress here.
Copy link
Collaborator

@himanshusinghs himanshusinghs left a comment

Choose a reason for hiding this comment

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

Looks perfect 💯

Copy link
Collaborator

@blva blva left a comment

Choose a reason for hiding this comment

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

non-blocking comment

@kmruiz kmruiz merged commit b26cd46 into main Sep 4, 2025
17 checks passed
@kmruiz kmruiz deleted the gh-327 branch September 4, 2025 10:43
Copy link
Collaborator

Pull Request Test Coverage Report for Build 17461171989

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • 6 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.06%) to 81.164%

Files with Coverage Reduction New Missed Lines %
src/common/session.ts 6 76.35%
Totals Coverage Status
Change from base Build 17461049947: -0.06%
Covered Lines: 4660
Relevant Lines: 5654

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

Copilot code review Copilot Copilot left review comments

@himanshusinghs himanshusinghs himanshusinghs approved these changes

@blva blva blva approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /