Skip to content

Fail remote mirror if LFS sync fails

Stan Hu requested to merge sh-remote-mirror-fail-on-lfs into master

What does this MR do and why?

Previously for a remote mirror update, UpdateRemoteMirrorService would ignore the state of Lfs::PushService#execute, which prevented a project maintainer from knowing that an actual problem existed with the sync.

We now fail the mirror, while allowing the Git push to continue. This is guarded behind the remote_mirror_fail_on_lfs feature flag, and additional logging is added to track when this happens.

Relates to #340482 (closed)

Screenshots or screen recordings

image

How to set up and validate locally

Until !77326 (merged) is merged:

  1. Set up a Azure DevOps account in dev.azure.com (https://andrewlock.net/creating-a-git-repo-with-azure-repos-and-trying-out-git-lfs/).
  2. Create a project.
  3. Set up push mirroring to an Azure mirror.
  4. Enable the feature flag: Feature.enable(:remote_mirror_fail_on_lfs).
  5. Push a LFS file to the repository. Go to Repository -> Mirroring -> Update Now.
  6. Look for the error message.

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Stan Hu

Merge request reports