Verify that user can update branch on fork syncing
What does this MR do and why?
The MR consists of 3 smaller parts, but the parts are too small for separate MRs:
- Scope sync-fork feature flag to the fork source. It will allow us to enable the feature flag for all forks of a particular project (like
gitlab-org/gitlab) - Verify whether a branch is protected on fork syncing. It verifies that
projectSyncForkmutation cannot be called if branch is protected. - Display Update Fork button only if user can sync fork. Do not display the Update Fork button if branch is protected.
To test it locally
- Make sure that
synchronize_forkfeature flag is enabled - Create a project and fork the project
- Then create a commit in the original project, so the fork is behind
- Visit the fork
- The Update Fork button must be displayed
- Protect the fork branch, so no-one can merge or push: https://docs.gitlab.com/ee/user/project/protected_branches.html#protected-branches
- The Update Fork button is not displayed
Edited by Igor Drozdov