Unify project/group hooks codebase
Problem to solve
We have separate controllers for project and group webhooks:
- https://gitlab.com/gitlab-org/gitlab/blob/3c3664ba2a8cc7840453c244f29d27f4bc8dd388/app/controllers/projects/hooks_controller.rb#L72
- https://gitlab.com/gitlab-org/gitlab/-/blob/3c3664ba2a8cc7840453c244f29d27f4bc8dd388/ee/app/controllers/groups/hooks_controller.rb#L76
And separate API controllers:
- https://gitlab.com/gitlab-org/gitlab/blob/3c3664ba2a8cc7840453c244f29d27f4bc8dd388/lib/api/project_hooks.rb#L23
- https://gitlab.com/gitlab-org/gitlab/blob/3c3664ba2a8cc7840453c244f29d27f4bc8dd388/ee/lib/api/group_hooks.rb#L12
But they share the same view, which leads to issues like:
When we add some functionality to project level hooks, but forget to add it to group level.
Proposed solution
Unify some parts of parameter lists and specs. This way it would be harder to forget about group level webhooks.
Some downside - it will be harder to contribute FOSS only feature since it will require also contributing to EE.
Edited by Vladimir Shushlin