[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.
- Update the creation and update interface of webhook: add new field
branch_filter_strategy
- Update webhook model: add regular verification logic to
branch_filter_strategy
- Update
ActiveHookFilter.matches?
method to support more matching strategies - Add unit tests for new code
Screenshots or screen recordings
Before | After |
---|---|