Open
Conversation
…odel-repository inside base of container
|
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes MongoDB connection issues for local databases by implementing case-insensitive hostname matching and expanding the list of recognized local database hostnames. The fix prevents incorrect TLS handshake attempts when connecting to local non-TLS MongoDB containers, which was occurring when hostnames had different casing or were IPv6 addresses.
Changes:
- Extended local database hostname detection to include IPv4 (127.0.0.1) and IPv6 (::1) localhost addresses, plus additional container hostname aliases
- Implemented case-insensitive hostname matching using
casefold()to handle variations like "MongoDB" vs "mongodb" - Added comprehensive test coverage for the new hostname aliases with mixed-case examples
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/simtools/db/mongo_db.py | Modified _build_uri to use case-insensitive hostname matching with an expanded set of local database hostnames, ensuring local databases use direct connections without TLS |
| tests/unit_tests/db/test_mongo_db.py | Added parametrized test covering new local hostname aliases including mixed-case variants to verify case-insensitive matching works correctly |
| docs/changes/2066.bugfix.md | Added changelog entry documenting the bug fix for MongoDB URI generation |
| .gitignore | Added mongo-data directory to ignore list for local database data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




No description provided.