Repository navigation
Review follow-ups for #76: keep webhook URLs out of argv and output - #79
Conversation
Review follow-ups on #76: webhook flags accept @path and @- so the URL stays out of the process list and shell history; --email rejects empty values; JSON output is built from the known result fields instead of the raw tool result, so an echoed URL never reaches it; the URL-hiding test now uses a result that contains the URL, in text and JSON output. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a2147b-3c2e-76b3-aeaf-0aafbe53d879
norbertdurcansk
left a comment
There was a problem hiding this comment.
Approved, with suggestions. go test ./cmd/query/ and go vet pass at 3903b15, and TestAlertOutputNeverShowsAnEchoedWebhookURL is a real regression test: it fails if JSON output goes back to PrintRawJSON(raw). Building the output from a typed struct instead of filtering the raw result is the right default for any tool result that could carry secrets.
suggestion (PR description): the description says the weekly MCP-to-CLI drift check now compares the cron list with query alert and schedule set help. But only alert.go and alert_test.go change here, and this repo has no drift-check workflow (.github/workflows has only ci, codeql and release). If the check lives in another repo or routine, link that change. Otherwise drop the sentence, so nobody assumes help-text drift is covered when it may not be.
question: before this change, a field missing from the tool result was left out of -o json. Now it prints as "" (or 0 for query_id). Is that the contract you want for scripts that read this output, or should the fields use omitempty?
|
Thanks. PR description: I replaced the sentence. The drift check is a weekly Amp scheduled check, not something in this repo, and the description now says so and links its parity map. omitempty: you're right. I want missing fields left out, as they were when the command printed the raw result. 44e7be9 adds omitempty to every field, and a test checks that a partial result prints only the fields it has. Since the ruleset blocks pushes to this branch, I'll merge this approved PR and open the follow-up against #76. |
|
Follow-up is #80. |
…80) Review follow-ups on #79: JSON output leaves out fields the tool did not return, as it did when printing the raw result; a test pipes the webhook URL through standard input with a trailing newline; the empty --email check names the input that reaches it. Amp-Thread-ID: https://ampcode.com/threads/T-01a2147b-3c2e-76b3-aeaf-0aafbe53d879 Co-authored-by: Amp <amp@ampcode.com>
* Add dune query alert for the MCP's setQueryAlert core#8168 added setQueryAlert to the Dune MCP server. 'dune query alert' calls it: it sets the query's schedule and creates or replaces the alert for one channel (email, Slack, Discord, or a webhook). The result carries no webhook URL, so the command prints it as it is. Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a2147b-3c2e-76b3-aeaf-0aafbe53d879 * Keep webhook URLs out of argv and output in dune query alert (#79) Review follow-ups on #76: webhook flags accept @path and @- so the URL stays out of the process list and shell history; --email rejects empty values; JSON output is built from the known result fields instead of the raw tool result, so an echoed URL never reaches it; the URL-hiding test now uses a result that contains the URL, in text and JSON output. Amp-Thread-ID: https://ampcode.com/threads/T-01a2147b-3c2e-76b3-aeaf-0aafbe53d879 Co-authored-by: Amp <amp@ampcode.com> * Cover webhook @- input and omit missing fields from query alert JSON (#80) Review follow-ups on #79: JSON output leaves out fields the tool did not return, as it did when printing the raw result; a test pipes the webhook URL through standard input with a trailing newline; the empty --email check names the input that reaches it. Amp-Thread-ID: https://ampcode.com/threads/T-01a2147b-3c2e-76b3-aeaf-0aafbe53d879 Co-authored-by: Amp <amp@ampcode.com> --------- Co-authored-by: Amp <amp@ampcode.com>
Follow-ups to @norbertdurcansk's review of #76. They're in a separate PR because the repo ruleset refuses direct pushes to existing branches. This PR targets #76's branch, so merging it puts these changes into #76.
--slack-webhook,--discord-webhookand--webhooktake@pathor@-, like--configdoes, so the URL stays out ofpsand shell history. Trailing whitespace is trimmed. The help text and example use@-.--email ""is rejected before any call, as an empty webhook already was.-o jsonprints only the known result fields (alert_id,query_id,channel,cron_expression,next_execution_time), not the raw tool result. So a URL the tool might echo back later never reaches the output. The schema doesn't promise to leave it out.setQueryAlert's description). Nothing in this repo checks the help for drift. The comparison is a step in a weekly Amp scheduled check, recorded in its parity map under "Notes for the drift check". It is not a CI check.go test ./...andgo vet ./...pass.No visual surface: CLI only.