Push rules are not copied when creating a fork
Summary
When creating a fork, Gitlab fails to copy push rules to the forked project.
Steps to reproduce
- Create a project.
- Create push rules (domain match, commit message).
- Push some code which match the new rules.
- Create a fork.
- Push rules are empty on a fork.
Example Project
What is the current bug behavior?
Push rules are not copied.
What is the expected correct behavior?
Push rules should be copied, because the moment user push code with unmatched rules and creates a merge request, it is accepted into upstream project and other forks won't able to update upstream without an error that push rules does not match.
Relevant logs and/or screenshots
N/A
Current Workarounds
In self-managed you could set Global or Group level push rules that would apply to new projects. So all new projects that are created (including from forks) would get the push rules.
On GitLab.com it's generally advised to disable forking outside your group, so assuming that was configured you could also set group level push rules there.
This would not cover forks to personal namespaces (likely not possible to support on GitLab.com because push rules are a paid feature) and doesn't account for situations where projects might have different push rules that don't apply to an entire group.