Allow Push Mirrors to optionally keep divergent refs
gitaly!1828 (merged) 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 #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.
Add a boolean column to
keep_divergent_refs. It should default to
falsebut it can also not have a default value to speed up the migration. This requires a changelog, per our docs. => !25639 (merged)
Behind a project-specific feature flag, surface a checkbox in the UI for adding a push mirror that will set this column to
true. => !26405 (merged)
- Behind the same feature flag, allow this setting to be modified by the remote mirrors API. => !26407 (merged)
Send this flag along with the
UpdateRemoteMirrorRequest. => !26406 (merged)
- Verify behavior and remove feature flags. => #208828 (closed)
- i18n => #208828 (closed)
- Update API docs and spec schemas for new field.