JENKINS-28271 - Gitlab Plugin does not build Merge Request when first raised.

This commit is contained in:
Jon Rosenberger 2015-09-01 20:26:50 -05:00
parent 305a75696c
commit d097c2d670
1 changed files with 6 additions and 6 deletions

View File

@ -468,16 +468,16 @@ public class GitLabWebHook implements UnprotectedRootAction {
public void generateMergeRequestBuild(String json, Job project, StaplerRequest req, StaplerResponse rsp) { public void generateMergeRequestBuild(String json, Job project, StaplerRequest req, StaplerResponse rsp) {
GitLabMergeRequest request = GitLabMergeRequest.create(json); GitLabMergeRequest request = GitLabMergeRequest.create(json);
if(request.getObjectAttribute().getState().equals("closed")) { if("closed".equals(request.getObjectAttribute().getState())) {
LOGGER.log(Level.INFO, "Closed Merge Request, no build started"); LOGGER.log(Level.INFO, "Closed Merge Request, no build started");
return; return;
} }
if(request.getObjectAttribute().getState().equals("merged")) { if("merged".equals(request.getObjectAttribute().getState())) {
LOGGER.log(Level.INFO, "Accepted Merge Request, no build started"); LOGGER.log(Level.INFO, "Accepted Merge Request, no build started");
return; return;
} }
if(request.getObjectAttribute().getAction().equals("update")) { if("update".equals(request.getObjectAttribute().getAction())) {
LOGGER.log(Level.INFO, "Existing Merge Request, build will be trigged by buildOpenMergeRequests instead"); LOGGER.log(Level.INFO, "Existing Merge Request, build will be trigged by buildOpenMergeRequests instead");
return; return;
} }
if(request.getObjectAttribute().getLastCommit()!=null) { if(request.getObjectAttribute().getLastCommit()!=null) {