fix(webhook): bind a subscription to a profile with --route-profile, not --profile
The salvaged flag was spelled --profile, which collides with the global -p/--profile that hermes_cli.main scans BEFORE argparse: `hermes webhook subscribe x --profile compta` would switch this CLI process to compta's HERMES_HOME and write the subscription into compta's webhook_subscriptions.json — a file the default gateway's webhook adapter never reads — while the route still lacked the profile key. #109020 special-cased the scanner for the webhook subcommand; naming the flag --route-profile removes the ambiguity without touching _scan_profile_flag: -p picks the gateway whose subscriptions file is written, --route-profile picks which /p/<profile>/ prefix may hit the route. Docs: cli-commands reference row, multi-profile-gateways webhook section, the route `profile` field. Builds on #109020 (fangliquanflq). Fixes #109016.
This commit is contained in:
@@ -35,7 +35,7 @@ def _make_args(**kwargs):
|
||||
"deliver": "log",
|
||||
"deliver_chat_id": "",
|
||||
"secret": "",
|
||||
"profile": None,
|
||||
"route_profile": None,
|
||||
"payload": "",
|
||||
"script": "",
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class TestSubscribe:
|
||||
profile_dir.mkdir(parents=True)
|
||||
|
||||
webhook_command(_make_args(
|
||||
webhook_action="subscribe", name="notifier", profile="compta"
|
||||
webhook_action="subscribe", name="notifier", route_profile="compta"
|
||||
))
|
||||
created = _load_subscriptions()["notifier"]
|
||||
first_secret = created["secret"]
|
||||
@@ -91,7 +91,7 @@ class TestSubscribe:
|
||||
webhook_action="subscribe", name="notifier", secret="original"
|
||||
))
|
||||
webhook_command(_make_args(
|
||||
webhook_action="subscribe", name="notifier", profile="missing"
|
||||
webhook_action="subscribe", name="notifier", route_profile="missing"
|
||||
))
|
||||
|
||||
assert "does not exist" in capsys.readouterr().out
|
||||
|
||||
Reference in New Issue
Block a user