feat(services): add optional service proxies - #70
Merged
Conversation
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.
Review on ArchCode
Problem and author intent
Aster advertises stable named ports for worktree services, and existing CLI consumers depend on those mappings. Inserting an external debugging or logging proxy currently requires changing the advertised port or maintaining an out-of-band launch flow.
This change lets a service declare an optional proxy target.
aster services up <group> --proxymoves the underlying service to a separate upstream port, starts the proxy on the original advertised port, and preserves existing service discovery.What changed
[dev.services.<name>.proxy]with a stream target, namedupstream_port, and proxy-specific environment.aster services up <group> --proxy; proxy configuration is inert without the flag.services ports,{ports.<name>}, manifests, and browser URLs on the original advertised port.{port},ASTER_SERVICE_PORT, and self-referentialport_envvalues to the upstream port in proxy mode.<service>-proxylifecycle, daemon-mode consistency checks, service reporting, and log lookup.ASTER_PROXY_*environment variables.Scope
Backend and CLI only. No frontend changes.
Risk assessment
Medium. This changes service planning and daemon launch protocol, but only when a service configures a proxy and the caller passes
--proxy. Existing launches retain their prior path. The feature is covered across real process and network boundaries plus the complete Aster test suite.User impact
Users can optionally insert targets such as
platform-proxy-loggerin front of a service without changing the port reported by Aster or breaking commands that discover worktree ports. Existing service configurations and commands behave unchanged.Testing
cargo fmt --all -- --checkcargo clippy --locked --all-targets --all-features -- -D warningsRUSTDOCFLAGS="-D warnings" cargo doc --locked --no-deps --all-featurescargo test --locked --all-targets --all-features— all tests passedcargo auditwas unavailable in the local environment.Canonical end-to-end proof:
tests/dev_services.rs,optional_service_proxy_preserves_the_advertised_port_end_to_end. It starts a real Python HTTP service and a separate real TCP proxy, sends a client request through the advertised socket, verifies forwarding to the dynamically leased upstream socket, checks environment and published port state, reads proxy logs through the CLI, shuts down both processes, then relaunches without--proxyand verifies direct reuse of the original port.Daemon proof:
tests/dev_services.rs,daemon_rejects_reattach_with_a_different_proxy_mode. It launches a real daemon-managed proxied bundle, verifies generated service and port state, rejects a conflicting direct-mode reattach, and accepts a same-mode reattach.Follow-ups and known issues
aster.tomlconfiguration.