"Tag push events" webhook test actually uses "push events data" in the payload
Summary
When testing the tag push events webhook, the test data actually uses the last push events data in the payload.
Steps to reproduce
-
Create a tag push events webhook for a project.
-
Test the webhook using a tag push event. Notice that the
refswill have a branch name instead of a tag andobject_kind/event_nameispush.{ "object_kind": "push", "event_name": "push", "before": "804c45744ac47025e5dec26721c88e1644f784f1", "after": "804c45744ac47025e5dec26721c88e1644f784f1", "ref": "refs/heads/main", ... } -
Create a tag in the project, which should trigger the webhook. Notice that the
refswill have a tag andobject_kind/event_nameistag_push.{ "object_kind": "tag_push", "event_name": "tag_push", "before": "0000000000000000000000000000000000000000", "after": "804c45744ac47025e5dec26721c88e1644f784f1", "ref": "refs/tags/tag-c", ... }
Example Project
N/A
What is the current bug behavior?
Testing the tag events webhook is using push events data in the payload.
What is the expected correct behavior?
Testing the tag events webhook should use tag events data in the payload.
Relevant logs and/or screenshots
N/A
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
Update app/services/test_hooks/project_service.rb#L19-20 so tag push events don't use push events data. It would be good to create a dedicated method for the tag push events data.
