-
Notifications
You must be signed in to change notification settings - Fork 81
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
[GH-130] Adds a reminder when subscribing to a project that a web hook is needed. #134
Conversation
Thanks for working on this @ericjaystevens. A few things before we start reviewing:
Let us know if you need any help with this! |
@gabrieljackson Thanks for the feedback on this pull request. I have updated the linked ticket URL, squashed my commits, and improved coverage. |
Thanks @ericjaystevens. Reviewers have been added. |
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.
Thanks for your contribution @ericjaystevens ! This should help avoid users wondering "why is't that repo notification working? I just set it up..."
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.
LGTM, @ericjaystevens! This will help some confusion on the end-uses. I look forward to seeing the implementation for a webhook syncing via mattermost slash commands :)
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.
@ericjaystevens Awesome work! No issues with implementation, but I have some comments on style and mocking. Thanks for adding this feature 👍
… used. (#130) Message alerting the user to the need to add a webhook is functioning. Additional refactoring and tests needed. single webhook test with mocking refactored project hook tests added no webhooks test moved mock function to gitlabtest package replaced manual mocks with auto generated refactored plugin command handling and clarified messages added api error test removed mocks that are no longer needed removed test for GetProjectHooks as it seems to implementation-specific go format removed shadow declaration based on vet output broke out subscribeComand method to improve testability tested no subscripions paramaterized testSubscribeCommand tests mocked KVSet tests webhook found moved tests out of plugin_test and into command_test fixed linting issues fixed Error identifier Co-Authored-By: Michael Kochell <mjkochell@gmail.com> fixed Error identifier Co-Authored-By: Michael Kochell <mjkochell@gmail.com> spelling Co-Authored-By: Michael Kochell <mjkochell@gmail.com> generated mock with gomock works for all test except no Substitutions all tests pass changed mock boolean flag name WIP
@mickmister I think I addressed all the issues based on your great feedback. Let me know if you need anything else. |
Codecov Report
@@ Coverage Diff @@
## master #134 +/- ##
==========================================
+ Coverage 36.58% 39.89% +3.30%
==========================================
Files 16 16
Lines 1465 1494 +29
==========================================
+ Hits 536 596 +60
+ Misses 881 838 -43
- Partials 48 60 +12
Continue to review full report at Codecov.
|
Removed all extra lines at the beginning of functions and cleaned up go.sum and go.mod. Let me know if there is anything else I can do. Thanks again for all the feedback to improve this PR. |
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.
LGTM! Thanks @ericjaystevens 👍
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.
@ericjaystevens thanks for this improvement. This is excellent for improving useably and preventing user oversight!
I did find a minor issue with this. It seems like the link you've added for "setup a WebHook" in GitLab may be outdated. it's pointing to <project name>/-/settings/integrations
when I click it, I see a GitLab page reminding me that the config has moved to <project name>/hooks
Aside from the link address...
- Ensured post appears when target project does not have a hook
- Ensured post does not appear when there is already a hook in place
- Ensured functionality works as expected with subgroups
- Briefly regression tested subscription functionality
No other issues found.
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.
@ericjaystevens Thanks for the fix on the webhook link. LGTM!
@DHaussermann Good Catch the URL must have recently changed. Thanks! I just pushed with the updated link. Let me know if you need anything else. I forgot to update the URL's in the tests in my last commit, just pushed those changes up. |
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.
@ericjaystevens thanks for this fix.
Testing noted in the comment above.
Updated Release Testing to cover this case.
No other issues found.
LGTM!
Help should output `/gitlab pipelines run` instead of `/gitlab pipeline run`
Summary
Adds a reminder when using
/github subscribe
that a project hook is needed if one is not already pointing to the MatterMosts server URL.Webhooks in Gitlab can be created in GitLab at the System, project, or group level (paid plans only). The go-gitlab module used in this project does not yet support listing group hooks ( issue created ). System hooks won't be accessible for most developers. So we are just checking for project hooks, and if we are unsure if a webhook exists, providing a link to our documentation on how to set one up.
Ticket Link
Fixes #130