Skip to content

[Backend] Update webhook: support both wildcard & regex

Related issue: #369104 (closed)

The code changes for this issue are divided into two MRs: Backend and Frontend. Currently this is Backend and should be merged first. The frontend changes when the flag is toggled on are incomplete in this MR !97235 (comment 1133924168) so the flag will not be toggled on until the FE MR merges.

What does this MR do and why?

Support more matching strategies when the webhook matches branches.

  1. Update the creation and update interface of webhook: add new field branch_filter_strategy
  2. Update webhook model: add regular verification logic to branch_filter_strategy
  3. Update ActiveHookFilter.matches? method to support more matching strategies
  4. Add unit tests for new code

Screenshots or screen recordings

Before After

cc @prajnamas @icbd @JeremyWuuuuu

Edited by Luke Duncalfe

Merge request reports