Repository navigation
bug: accept urls in --notify-webhooks - #672
Amadeus-22 wants to merge 2 commits into
Conversation
The webhook configuration was split on every colon, so the scheme and port of a URL were cut off the address and the rest was read as a header, which raised IndexError for any real URL. Only the trailing NAME=VALUE parts are headers now, and a header is split on its first '=' so values containing '=' are kept whole. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Split every --notify-* value on commas outside double quotes, and each entry on colons with a csv reader, so a quoted url, header, subject or token can contain ',' and ':'. - Email subjects can contain ':' without quotes, and an email without a subject now aborts with a clear error instead of a ValueError.
|
Thanks for the fix. I pushed a follow-up commit (188b68f) on top of it. Strings that still failed with the previous commit Splitting on
The other notify options had the same comma issue, and What changed
An unquoted comma inside a URL ( |
|
Thanks for taking it further, @jhonabreul. I read 188b68f: splitting outside double quotes resolves the cases I couldn't disambiguate, and keeping the trailing NAME=VALUE rule means unquoted values behave as before. The email subject fix and the explicit error for a missing subject are good additions. Nothing to add from my side. |
jhonabreul
left a comment
There was a problem hiding this comment.
Thank you for your contribution!
Closes #671.
lean cloud live deploy --notify-webhookssplit the value on every colon. With a real URL the scheme (and port) was cut off the address and the remainder was parsed as a header, raisingIndexError: list index out of range. A header value containing=was truncated._parse_webhook_config: only the trailingNAME=VALUEparts are headers, the rest is the address, and each header is split on its first=. Values that worked before parse the same way.test_cloud_live_deploy_with_notificationsgets three URL cases (no headers, port plus query string, header value with=). They fail on master and pass with the fix; the expected values are now written out instead of being re-parsed with the same logic as the command.pytest tests/commands/cloud/live/test_cloud_live_commands.pypasses (68 tests, Python 3.12) andpython static_analysis.pyis clean.🤖 Generated with Claude Code