cli: add --api-port to hflow up - #57
Closed
chintondutta wants to merge 1 commit into
Closed
Conversation
RuntimeConfig already supported a custom api_port, but hflow up never exposed it, so docs/RUNTIME.md had to document hand-editing the bundle's .env as the only way to change it. Add the flag (default 8080, matching RuntimeConfig's default) and forward it into RuntimeConfig construction. Also clarifies the "Port 8080 is taken" troubleshooting entry: the flag only takes effect on a bundle's first render, since an existing .env is never rewritten (so user edits and secrets survive re-renders) -- an already-rendered bundle still needs .env edited directly.
|
👋 Hi @chintondutta — thanks for the contribution! To keep starter issues available You already have #52 open, so this one is being closed automatically. |
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.
Fixes #7.
Current behavior
The runtime config already supports a custom API port --
RuntimeConfig.api_port: int = 8080, rendered into the bundle's.envasAPI_PORT-- buthflow upnever passed it, sodocs/RUNTIME.md's "Port 8080 is taken" entry had to document a manual.env-edit workaround.Change
--api-port(typeint, default8080, matchingRuntimeConfig's own default) to theupsubparser, forwarded into theRuntimeConfig(...)construction in_command_up.docs/RUNTIME.mdto point at the flag -- while keeping the existing, still-true caveat: an existing bundle's.envis create-if-absent and never rewritten (so secrets and user edits survive re-renders), so--api-portonly takes effect on a bundle's first render. For an already-rendered bundle,.envstill needs a direct edit.Testing
New test
test_up_honors_api_port(tests/test_runtime_cli.py), following the existingtest_up_renders_starts_and_printspattern (compose subprocess and Airflow health stubbed, no Docker): runshflow up --api-port 9090and asserts the rendered bundle's.envcontainsAPI_PORT=9090and the printed summary useshttp://127.0.0.1:9090.(lychee wasn't on PATH in this sandbox; ran it via the official Docker image instead of installing.)