RFR: 1625: Validate input from /summary command

Erik Joelsson erikj at openjdk.org
Fri Oct 21 22:00:23 UTC 2022


On Fri, 21 Oct 2022 21:08:55 GMT, Zhao Song <zsong at openjdk.org> wrote:

> 1.  Added validation to SummaryCommand.
> 2. If exceptions are thrown when the bot is evaluating the current status of the pr, the exceptions will be treated as integration blocker.

bots/pr/src/main/java/org/openjdk/skara/bots/pr/SummaryCommand.java line 57:

> 55:             if (!checkSummary(summary)) {
> 56:                 reply.println("\"" + summary + "\" is invalid, summary should not contain \"<BugId>:\", \"Co-authored-by:\", \"Reviewed-by:\" and \"Backport-of:\".\n" +
> 57:                         "This Summary will be removed.");

When quoting the given invalid summary please quote it in the same way as the accepting message below (multiline if needed, use back ticks). Prefix it with "Invalid summary: ". Then on the next line add the information about what cannot be included in a summary. I don't think we need the "This Summary will be removed." message on top of that.

Example:

Invalid summary:

foobar
12345: foo

A summary line cannot start with any of the following: `<issue-id>:`, `Co-authored-by:`, `Reviewed-by:`, `Backport-of:`. See [JEP 357](https://openjdk.org/jeps/357) for details.

bots/pr/src/test/java/org/openjdk/skara/bots/pr/SummaryTests.java line 425:

> 423:             TestBotRunner.runPeriodicItems(prBot);
> 424:             assertLastCommentContains(pr, "summary should not contain");
> 425: 

Maybe add a test case for `<bugid>:`?

-------------

PR: https://git.openjdk.org/skara/pull/1401


More information about the skara-dev mailing list