-
Notifications
You must be signed in to change notification settings - Fork 486
Add support for release and deployment events in webhooks #704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for release and deployment events in webhooks #704
Conversation
jabby
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
Thanks for your contribution. Can you add some tests in TestGitLabApiEvents? And take care of the following comments.
By the way I fixed #606 so you may have to rebase your work. Sorry for the inconvenience.
| .withParam("pipeline_events", hook.getPipelineEvents(), false) | ||
| .withParam("wiki_events", hook.getWikiPageEvents(), false) | ||
| .withParam("enable_ssl_verification", hook.getEnableSslVerification(), false) | ||
| .withParam("url", hook.getUrl(), true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the formatting change here?
| public static final String OBJECT_KIND = "deployment"; | ||
|
|
||
| private String status; | ||
| private String statusChanged_at; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the name is correct. Should be statusChangedAt
| public String getStatusChanged_at() { | ||
| return statusChanged_at; | ||
| } | ||
|
|
||
| public void setStatusChanged_at(String statusChanged_at) { | ||
| this.statusChanged_at = statusChanged_at; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to update getter and setter here.
| String message = "Unsupported X-Gitlab-Event, event Name=" + eventName; | ||
| LOGGER.warning(message); | ||
| throw new GitLabApiException(message); | ||
| case IssueEvent.X_GITLAB_EVENT: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the formatting change here?
| String message = "Unsupported event object_kind, object_kind=" + event.getObjectKind(); | ||
| LOGGER.warning(message); | ||
| throw new GitLabApiException(message); | ||
| case BuildEvent.OBJECT_KIND: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the formatting change here?
| String message = "Unsupported event object_kind, object_kind=" + event.getObjectKind(); | ||
| LOGGER.warning(message); | ||
| throw new GitLabApiException(message); | ||
| case BuildEvent.OBJECT_KIND: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the formatting change here?
|
fixes #758 |
|
hi @jabby i handled your requests on my fork
not sure on how to merged this, i can't supplement this pull-request; do i create a new one? |
I noticed the following webhooks were missing for projects:
I need both for my project, so decided to add them here. I have tested them with my own GitLab instance, it works great so far.
There are no integration tests for webhooks currently, so I have not added tests for them.