[skara] RFR: 912: PR title correction logic can get stuck

Magnus Ihse Bursie ihse at openjdk.java.net
Thu Mar 11 14:01:23 UTC 2021

On Thu, 11 Mar 2021 13:26:36 GMT, Robin Westberg <rwestberg at openjdk.org> wrote:

>> The PR title correct logic introduced with SKARA-572 can end up trying to correct the title forever. An observed case is where the JBS title ends with a trailing space. When trying to update the PR title to include this trailing space, it will be stripped by GitLab and no update will actually be done. This will then get retried again and again. 
>> The fix is to strip the JBS title before doing any comparisons.
> bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckWorkItem.java line 173:
>> 171:             var issue = project.issue(id);
>> 172:             if (issue.isPresent()) {
>> 173:                 var issueTitle = issue.get().title().strip();
> The title() method is called in a lot of places, perhaps it would be better to perform the stripping closer to the source?

I'm not sure what you mean by that? We did use `issue.get().title()` in lots of places, but I replaces them with `issueTitle `to only have a single strip. That's as close to the source I can see possible.

> bots/pr/src/test/java/org/openjdk/skara/bots/pr/CheckTests.java line 950:
>> 948: 
>> 949:             // The PR title should contain the issue title without trailing space
>> 950:             assertEquals("TEST-1: My second issue ending in space", prCutOff2.title());
> Looks like this test is currently failing, should this be TEST-2?

Yeah, my bad... i commented out the test before while developing to speed up the re-run time. Didn't realize this changed the behavior when bringing it back. Will fix.


PR: https://git.openjdk.java.net/skara/pull/1050

More information about the skara-dev mailing list