Skip to content
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

Email notifications with gitlab #399

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

alexwaibel
Copy link
Collaborator

Reopening #388 since GH won't let me reopen there. Code comments from last review there need to be addressed still.

alexwaibel and others added 7 commits March 29, 2020 16:58
* Convert error handler to more modern class declaration.
* Make GitHub and GitService actually throw errors rather than return them
* Fix some broken unit and acceptance tests
…itHub).

- Modify handlePR.js to instantiate a generic GitService instead of GitHub.
- Modify GitHub.js so that a blank (Staticman) version number can resolve to GitHub token authorization (as the version number is not available when instantiating GitHub from handlePR).
- Modify server.js to provide v3 service-specific "webhook" endpoints. Retain usage of the express-github-webhook module for GitHub.
- Update tests and add test cases for GitLab.
- Add new webhook controller.
…error handling, and webhook request authentication.

- Add support in the Staticman JSON configuration for GitLab and GitHub webhook request authentication via "gitlabWebhookSecret" and "githubWebhookSecret" properties.
- In the handlePR controller, pass real values for the "branch" to the GitFactory.
- In the handlePR controller, pass a value for "username" to the GitFactory that identifies the repo owner, not the submitter of the merge/pull request.
- In the handlePR controller, when appropriate, return helpful error messages instead of simply null.
- In the handlePR controller, fix the "staticman_" source branch test.
- In the handlePR controller, clean up the analytics events invocations, as the logic is doing more than just deleting the source branch.
- Improve server.js to silence UnhandledPromiseRejectionWarning messages.
- Update and add unit tests.
- Remove commented-out code.
- Add explicit error handler to allows for overriding the system/express error handler.
@alexwaibel alexwaibel self-assigned this Dec 31, 2020
@alexwaibel alexwaibel changed the title Email notifs with gitlab Email notifications with gitlab Feb 13, 2021
@dadatuputi
Copy link

I migrated to GitLab and the only thing that wasn't working properly is the webhook, which this PR seems to address. Any progress in this?

@hispanic
Copy link

I implemented this in my fork - hispanic#1 Feel free to adapt it into a fork of your own.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants