From b5e564a6646031012e170fc626ac80a66d9a05ea Mon Sep 17 00:00:00 2001 From: Kasper Fock Date: Thu, 11 Dec 2014 13:27:57 +0100 Subject: [PATCH] Added "commits" to be redirected to build page. This URL is called from gitlab merge request page with a link next to the jenkins build status. Furthermore added a logger warning to notify when a url is not matched. --- src/main/java/com/dabsquared/gitlabjenkins/GitLabWebHook.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/dabsquared/gitlabjenkins/GitLabWebHook.java b/src/main/java/com/dabsquared/gitlabjenkins/GitLabWebHook.java index cd59334..58c1098 100644 --- a/src/main/java/com/dabsquared/gitlabjenkins/GitLabWebHook.java +++ b/src/main/java/com/dabsquared/gitlabjenkins/GitLabWebHook.java @@ -140,9 +140,11 @@ public class GitLabWebHook implements UnprotectedRootAction { e.printStackTrace(); throw HttpResponses.error(500,"Could not generate an image."); } - } else if(firstPath.equals("builds") && !lastPath.equals("status.json")) { + } else if((firstPath.equals("commits") || firstPath.equals("builds")) && !lastPath.equals("status.json")) { AbstractBuild build = this.getBuildBySHA1(project, lastPath, true); redirectToBuildPage(res, build); + } else{ + LOGGER.warning("Dynamic request mot met: First path: '" + firstPath + "' late path: '" + lastPath + "'"); } throw HttpResponses.ok();