Commit 5487b3d3 authored by Adam Snyder's avatar Adam Snyder Committed by Greg Messner
Browse files

Support New "Job Hook" Hook Renaming (#131)

* fix #130 support new hook name
* rename BuildEvent consts to be more descriptive
parent 0c2c64c1
...@@ -10,7 +10,10 @@ import org.gitlab4j.api.models.User; ...@@ -10,7 +10,10 @@ import org.gitlab4j.api.models.User;
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
public class BuildEvent implements Event { public class BuildEvent implements Event {
public static final String X_GITLAB_EVENT = "Build Hook"; /** X-Gitlab-Event header value pre GitLab v9.3.0 */
public static final String BUILD_HOOK_X_GITLAB_EVENT = "Build Hook";
/** X-Gitlab-Event header value post GitLab v9.3.0 */
public static final String JOB_HOOK_X_GITLAB_EVENT = "Job Hook";
public static final String OBJECT_KIND = "build"; public static final String OBJECT_KIND = "build";
private String ref; private String ref;
......
...@@ -61,7 +61,8 @@ public class WebHookManager extends HookManager { ...@@ -61,7 +61,8 @@ public class WebHookManager extends HookManager {
LOG.info("handleEvent: X-Gitlab-Event=" + eventName); LOG.info("handleEvent: X-Gitlab-Event=" + eventName);
switch (eventName) { switch (eventName) {
case BuildEvent.X_GITLAB_EVENT: case BuildEvent.BUILD_HOOK_X_GITLAB_EVENT:
case BuildEvent.JOB_HOOK_X_GITLAB_EVENT:
case IssueEvent.X_GITLAB_EVENT: case IssueEvent.X_GITLAB_EVENT:
case MergeRequestEvent.X_GITLAB_EVENT: case MergeRequestEvent.X_GITLAB_EVENT:
case NoteEvent.X_GITLAB_EVENT: case NoteEvent.X_GITLAB_EVENT:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment