feat: fix the parse#122
Closed
bedus-creation wants to merge 2 commits into
Closed
Conversation
…eld, test all priority scenarios
Replace the broken `resolve_option`+`resolve_url` pair with a single clear
`resolve_host_port()` method that walks three layers in order:
APP_URL → APP_HOST/APP_PORT → CLI --host/--port.
The old `resolve_option` called `env(value)` with an already-resolved value
(e.g. "127.0.0.1" or 8000), which made `os.getenv("127.0.0.1")` return ""
and silently dropped every configured value. The new method reads each layer
with a plain `Config.get()` call and conditionally overrides, so the intent
is readable without any intermediate abstraction.
`FastAPIConfig` gains an `app_url` field (reads APP_URL env var) and its
`host`/`port` fields now default to empty/"" / 0 so they don't shadow APP_URL
when the user hasn't set APP_HOST/APP_PORT.
`tests/fastapi/test_serve_command.py` is added with 17 cases covering every
combination: defaults, APP_URL host+port, bare host without scheme, no-port
fallback, no-host fallback, APP_HOST/APP_PORT overrides, and CLI overrides.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
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.