[go: up one dir, main page]

Skip to content

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.

  1. 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. => !25639 (merged)
  2. 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)
  3. Behind the same feature flag, allow this setting to be modified by the remote mirrors API. => !26407 (merged)
  4. Send this flag along with the UpdateRemoteMirrorRequest. => !26406 (merged)
  5. Verify behavior and remove feature flags. => #208828 (closed)
  6. i18n => #208828 (closed)
  7. Update API docs and spec schemas for new field.
Edited by Robert Speicher