gitlab-plugin icon indicating copy to clipboard operation
gitlab-plugin copied to clipboard

"Draft" is not supported as a WIP indicator in MR title

Open NikolasKomonen opened this issue 4 years ago • 3 comments
trafficstars

Background

When creating an MR, a user could add in "WIP" to their GitLab MR title and the MR would be indicated as "work in progress".

When the "WIP" indicator is removed it sends a Merge Request Hook and then a build would be started.

This function [1] checks that the "WIP" text was removed.

Problem

GitLab added in a new indicator, "Draft", that is intended to replace "WIP". Both indicators are currently supported by GitLab but in [1], "Draft" is not supported.

Since "Draft" is not supported, a new build will not be started when it is removed from the MR title.

Solution

Modify the WIP function [1] to support "Draft" as described in the documentation [2].

I threw together a potential solution in #1195

[1] https://github.com/jenkinsci/gitlab-plugin/blob/gitlab-plugin-1.5.22/src/main/java/com/dabsquared/gitlabjenkins/trigger/handler/merge/MergeRequestHookTriggerHandlerImpl.java#L269 [2] https://docs.gitlab.com/13.12/ee/user/project/merge_requests/drafts.html#mark-merge-requests-as-drafts

NikolasKomonen avatar Nov 17 '21 17:11 NikolasKomonen

I opened an untested MR of something that should work: #1195

NikolasKomonen avatar Nov 17 '21 18:11 NikolasKomonen

Can we merge #1195 ?, Will remove unwanted build from Drafts MRs

omerjacobi avatar Sep 06 '22 17:09 omerjacobi

Can we merge #1195 ?, Will remove unwanted build from Drafts MRs

Unfortunately, we cannot merge #1195. That is a draft pull request. It has not been reviewed. Pull requests that are in Draft state are assumed to not be ready for review.

You could install the build of that pull request in your Jenkins controller and report the results.

You could review the code changes and share insights on what you see.

MarkEWaite avatar Sep 06 '22 18:09 MarkEWaite

Issue has been fixed and released in version 1.7.12: https://github.com/jenkinsci/gitlab-plugin/releases/tag/gitlab-plugin-1.7.12

krisstern avatar Apr 22 '23 15:04 krisstern