Execute Approval Gates webhook on MR change
What does this MR do?
- In a merge request who's project contains external approval rules, sends a standard webhook payload to the endpoints on every change of the MR.
- The next step for implementation of the epic is to extend the approval API to allow an external service to approve a particular MR.
How to review
-
Create a project with an Ultimate licence
-
Enable feature flag:
Feature.enable(:ff_compliance_approval_gates)
-
Create a new external approval rule on that project using the REST API. You should set the
external_url
field to a service that you can see. You might want to use RequestBin to do this. -
Open a merge request on the project. Check that the payload has been sent to RequestBin.
-
Edit a merge request. Check again for another payload
-
Push new code to
HEAD
of the source branch of the merge request. Check again.
The payload should include the same data as a merge request webhook, with the addition of a external_approval_rule
key.
Example testing: https://requestbin.com/r/envcciadp9jg/1pnROMTcZYq1SdObUoGLhblPWix
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. -
I have not included a changelog entry because this change is behind a default-off feature flag.
-
-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related to #267517 (closed)