fix(services): route a service remote from services.<TAG>.dl.remote

Click picks the subcommand before the dl callback applies the service config, so Services.resolve_command now applies remote and server first. A REST API job routes from its request only.
This commit is contained in:
imSp4rky
2026-10-19 14:19:07 -06:00
parent 4728ac593c
commit 3aaf9c4107
8 changed files with 208 additions and 21 deletions
+9
View File
@@ -131,6 +131,15 @@ def test_hand_built_ctx_client_value_wins():
assert ctx.params["repack"] is False
def test_hand_built_ctx_skips_routing_params(caplog):
"""An API job routes from its request, so the server's service config must not flip it, or warn."""
ctx = hand_built_ctx({})
with caplog.at_level(logging.WARNING, logger=log.name):
apply_service_dl_overrides(ctx, {"remote": True, "server": "box"}, log)
assert ctx.params == {"repack": False}
assert not caplog.records
def test_hand_built_ctx_missing_param_is_skipped():
"""Known dl option absent from a hand-built context must not raise or be injected."""
ctx = hand_built_ctx({})