fix: Normalize schemeless Nova hosts#408
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Nova’s configuration normalization so schemeless host values are automatically treated as valid HTTP origins, enabling consistent downstream NATS URL derivation while leaving already-fully-qualified URLs unchanged.
Changes:
- Normalize schemeless
NovaConfig.hostvalues usingurllib.parse.urlparseand prefixhttp://when appropriate. - Extend config tests to cover generic schemeless hosts and localhost-with-port inputs.
- Add an autouse pytest fixture to isolate
NATS_BROKERacross tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
nova/config.py |
Adds parser-based detection of schemeless hosts and normalizes them to http://…. |
tests/test_config.py |
Adds host normalization test cases and isolates NATS_BROKER via an autouse fixture. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Normalizes schemeless NovaConfig.host values using stdlib URL parsing so that derived NATS websocket URLs behave consistently across different host formats.
Changes:
- Update
NovaConfig._normalize_host_prefixto keep fully-qualified URLs unchanged and prefixhttp://for schemeless hosts that parse as a netloc. - Extend config tests to cover generic schemeless hosts and
localhost, and makeNATS_BROKERisolation automatic via an autouse fixture.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
nova/config.py |
Implements parser-based normalization for schemeless hosts while leaving fully-qualified URLs untouched. |
tests/test_config.py |
Adds/adjusts tests for schemeless host normalization and isolates NATS_BROKER across tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary
Testing