Webhook firing on previous finished push event
Summary
I added a Webhook to my project after a commit is pushed through API. The Webhook was still fired unexpectedly
Steps to reproduce
- create a project on gitlab.com
- push a initial commit through API
- immediately after response is returned, add a Webhook through (API call)[https://docs.gitlab.com/ee/api/system_hooks.html#add-new-system-hook] while setting
push_eventtotrue - Webhook fires even though no push event happens note: if I, in script (attached), add a sleep between step 3 and step 2 that is longer than a typical hook elapsed time (around 0.1 sec), I do not observe webhook firing.
Example Project
https://gitlab.com/yuanchenlu/a-new-repo-1563542191411/-/settings/integrations
What is the current bug behavior?
webhook firing happens after a commit has been pushed
What is the expected correct behavior?
no webhook delivery
Relevant logs and/or screenshots
https://gitlab.com/yuanchenlu/a-new-repo-1563542191411/hooks/926654/hook_logs/148702889
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
current GitLab.com configuration
Results of GitLab application Check
N/A
Possible fixes
There could be a race condition happening where a webhook may fire on a push event that happened shortly before the webhook was created.
Edited by 🤖 GitLab Bot 🤖