Skip to content

fix: Normalize schemeless Nova hosts#408

Merged
functionistic merged 3 commits intomainfrom
fix/config-http-prefix-normalization
Mar 13, 2026
Merged

fix: Normalize schemeless Nova hosts#408
functionistic merged 3 commits intomainfrom
fix/config-http-prefix-normalization

Conversation

@functionistic
Copy link
Collaborator

Summary

  • normalize any schemeless Nova host with a parser-based stdlib check
  • keep fully-qualified URLs unchanged
  • extend config tests for generic schemeless hosts and isolate NATS_BROKER in tests

Testing

  • uv run pytest tests/test_config.py

Copilot AI review requested due to automatic review settings March 13, 2026 12:27
Copy link
Contributor

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 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.host values using urllib.parse.urlparse and prefix http:// when appropriate.
  • Extend config tests to cover generic schemeless hosts and localhost-with-port inputs.
  • Add an autouse pytest fixture to isolate NATS_BROKER across 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.

@functionistic functionistic changed the title Normalize schemeless Nova hosts fix: Normalize schemeless Nova hosts Mar 13, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

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

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_prefix to keep fully-qualified URLs unchanged and prefix http:// for schemeless hosts that parse as a netloc.
  • Extend config tests to cover generic schemeless hosts and localhost, and make NATS_BROKER isolation 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>
@functionistic functionistic merged commit a297ae0 into main Mar 13, 2026
19 checks passed
@functionistic functionistic deleted the fix/config-http-prefix-normalization branch March 13, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants