Skip to content

Suppress webhooks when GitLab is in Silent Mode

Luke Duncalfe requested to merge 393639-silent-mode-webhooks into master

What does this MR do and why?

This MR prevents webhooks from executing or being queued when GitLab is in Silent Mode.

There is no Changelog trailer because Silent Mode is an experiment.

How to set up and validate locally

  1. Create a project hook: 2. Choose a project, and go Settings > Webhooks. 3. Click Add new webhook. 4. Enter a `URL of a webhook receiver. You can visit https://webhook.site to generate a unique webhook receiver URL to test with. 5. Under Trigger, select Issues events. 6. Select Add webhook.
  2. Close the issue, you should receive a webhook.
  3. Now set the instance to Silent Mode on the Rails console:
    Gitlab::CurrentSettings.update!(silent_mode_enabled: true)
  4. Wait up to a minute for it to take effect (see #405433).
  5. Reopen the issue, close it again, you should not receive any webhooks.

Remember to disable Silent Mode again afterwards:

Gitlab::CurrentSettings.update!(silent_mode_enabled: false)

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #393639 (closed)

Edited by Luke Duncalfe

Merge request reports