Allow Push Mirrors to optionally keep divergent refs
https://gitlab.com/gitlab-org/gitaly/-/merge_requests/1828 adds a `keep_divergent_refs` field to UpdateRemoteMirrorRequest in Gitaly that, when enabled, will not delete refs on the mirror that don't exist on the source. This addresses problem number 1 from https://gitlab.com/gitlab-org/gitlab/issues/198270: > Push mirroring will delete anything in the destination that isn't in the source. This means we can't create the auto-deploy branch solely on Security, as Canonical's push mirror will attempt to delete it. If the branch is protected the mirroring will be blocked entirely; if it's unprotected it gets deleted. Now that the Gitaly server half of the feature is merged, we can address the feature in GitLab. 1. [x] Add a boolean column to `remote_mirrors` table called `keep_divergent_refs`. It should default to `false` but it can also not have a default value to speed up the migration. This requires a changelog, per our docs. => https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25639 1. [x] Behind a project-specific feature flag, surface a checkbox in the UI for adding a push mirror that will set this column to `true`. => https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26405 1. [x] Behind the same feature flag, allow this setting to be modified by the [remote mirrors API](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/22433). => https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26407 1. [x] Send this flag along with the [`UpdateRemoteMirrorRequest`](https://gitlab.com/gitlab-org/gitlab/blob/f1dd8af7a821e1eb31a52f8fa21f31b6d7767171/lib/gitlab/gitaly_client/remote_service.rb#L70-98). => https://gitlab.com/gitlab-org/gitlab/-/merge_requests/26406 1. [x] Verify behavior and remove feature flags. => https://gitlab.com/gitlab-org/gitlab/issues/208828 1. [x] i18n => https://gitlab.com/gitlab-org/gitlab/issues/208828 1. [x] Update API docs and spec schemas for new field.
issue