Skip to content

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