Skip to content

Execute project hooks and services when deployment starts

What does this MR do?

Issues addressed: #235475 (closed) and #235474 (closed)

This MR implements webhook and chat (slack) integration notifications when a deployment starts. To achieve this a new worker is introduced (Deployments::ExecuteHooksWorker) which would be triggered when the state of the deployment is transitioned to running.

These are the major changes in this MR as suggested in this comment:

  • Create Deployments::ExecuteHooksWorker that gets triggered whenever a deployment is changed to running, success, failed, canceled.
  • Create Deployments::UpdateEnvironmentWorker that replaces Deployments::SuccessWorker
  • Create Deployments::LinkMergeRequestWorker that replaces Deployments::FinishedWorker
  • Rename Deployments::AfterCreateService to Deployments::UpdateEnvironmentService

Screenshots

UI text update in Slack integrations settings

Screenshot_2020-09-08_at_15.59.23

Sample message in slack when a deployment has started

Screenshot_2020-09-06_at_22.50.34

UI text update in Webhook settings

Screenshot_2020-09-09_at_21.43.15

Sample payload from webhook request

Screenshot_2020-09-06_at_22.50.56

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by Sashi

Merge request reports