diff options
| author | Pimyn Girgis <pimyn@google.com> | 2025-10-10 12:16:40 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-11-03 13:16:31 +0000 |
| commit | b09f1acd205002ec0ad91578981ea6890ccfad89 (patch) | |
| tree | e589765ba798b82963b9098ab7387829cf25fa48 /dashboard | |
| parent | cade79d2f008b7a3cd725264d45672727eaacab2 (diff) | |
dashboard/app: provide better reply when receiving an incorrect syz test command
Syzbot is now more clear on what constitutes a correct syz test command.
Diffstat (limited to 'dashboard')
| -rw-r--r-- | dashboard/app/jobs_test.go | 5 | ||||
| -rw-r--r-- | dashboard/app/reporting_email.go | 8 |
2 files changed, 10 insertions, 3 deletions
diff --git a/dashboard/app/jobs_test.go b/dashboard/app/jobs_test.go index e24cfd9f5..6b9941e6b 100644 --- a/dashboard/app/jobs_test.go +++ b/dashboard/app/jobs_test.go @@ -66,13 +66,14 @@ func TestJob(t *testing.T) { c.incomingEmail(sender, "#syz test: repo", EmailOptFrom("test@requester.com"), EmailOptSubject("my-subject"), EmailOptCC([]string{mailingList})) msg := c.pollEmailBug() - c.expectEQ(strings.Contains(msg.Body, "want either no args or 2 args"), true) + + c.expectEQ(strings.Contains(msg.Body, replyMalformedSyzTest), true) c.expectEQ(msg.Subject, "Re: my-subject") c.incomingEmail(sender, "#syz test: repo branch commit", EmailOptFrom("test@requester.com"), EmailOptSubject("Re: my-subject"), EmailOptCC([]string{mailingList})) msg = c.pollEmailBug() - c.expectEQ(strings.Contains(msg.Body, "want either no args or 2 args"), true) + c.expectEQ(strings.Contains(msg.Body, replyMalformedSyzTest), true) c.expectEQ(msg.Subject, "Re: my-subject") c.incomingEmail(sender, "#syz test: repo branch", diff --git a/dashboard/app/reporting_email.go b/dashboard/app/reporting_email.go index b2e347288..b699074fb 100644 --- a/dashboard/app/reporting_email.go +++ b/dashboard/app/reporting_email.go @@ -74,6 +74,12 @@ const ( "The email is sent to %[1]v address\n" + "but the HASH does not correspond to any known bug.\n" + "Please double check the address." + replyMalformedSyzTest = "I've failed to parse your command.\n" + + "Did you perhaps forget to provide the branch name, or added an extra ':'?\n" + + "Please use one of the two supported formats:\n" + + "1. #syz test\n" + + "2. #syz test: repo branch-or-commit-hash\n" + + "Note the lack of ':' in option 1." ) var mailingLists map[string]bool @@ -897,7 +903,7 @@ func handleTestCommand(c context.Context, info *bugInfoResult, msg *email.Email, command *email.SingleCommand) string { args := strings.Fields(command.Args) if len(args) != 0 && len(args) != 2 { - return fmt.Sprintf("want either no args or 2 args (repo, branch), got %v", len(args)) + return replyMalformedSyzTest } repo, branch := "", "" if len(args) == 2 { |
