RFR: 912: PR title correction logic can get stuck

Robin Westberg rwestberg at openjdk.java.net
Thu Mar 11 13:28:55 UTC 2021


On Thu, 11 Mar 2021 11:50:30 GMT, Magnus Ihse Bursie <ihse 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/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?

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?

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

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


More information about the skara-dev mailing list