RFR: 1936: IssueCommand would change pr title in GitLab

Zhao Song zsong at openjdk.org
Thu Jun 8 18:37:48 UTC 2023


On Wed, 7 Jun 2023 22:55:47 GMT, Zhao Song <zsong at openjdk.org> wrote:

> In GitLab, when a user wants to create a PR in draft mode, they need to include the prefix "Draft: " before the title(Checked the GitLab Document, "WIP" is already deprecated and removed). However, if the user wants to use the "/issue" command to add another issue to this PR, the pr bot will not be able to parse the issue within the PR title. Therefore, the bot will modify the PR title to match the new issue the user wants to add, resulting in the removal of the draft state of the PR.

I have updated the solution of this issue. Now, `GitLabMergeRequest#title` would return title without draft prefix and `GitLabMergeRequest#setTitle` would check whether the pr is in draft mode, if so, it will add draft prefix to the title.

Also, these two methods are called many times in the whole project. I checked every call of these two methods and I think there should be no side effects.

Previous, when the user creates a pr in GitLab and set the title to "Draft: 123", the pr bot will not be able to update the title and checking for CSR etc. Now, all the behavior of draft pr in GitLab will be the same as in GitHub. 

Thanks to @kevinrushforth 's advice again!

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

PR Comment: https://git.openjdk.org/skara/pull/1528#issuecomment-1583137691


More information about the skara-dev mailing list