Sync LFS objects when push mirroring
What does this MR do?
When a remote mirror / push mirror is configured, we push git objects to that remote, but LFS objects are skipped. This makes push mirroring a poor solution for projects using LFS.
This MR syncs all the LFS objects in the local repository to the remote after a successful
We do this directly, via the LFS API, instead of adding
git lfs to Gitaly, because the latter approach would require us to download the LFS objects to the Gitaly server, and perhaps check out a worktree, to get it working - which seems difficult. In particular, Gitaly wouldn't have credentials to retrieve the LFS objects from object storage.
The LFS upload algorithms and endpoints are not very complex, so touching them directly - in effect, reimplementing some of
git lfs - seems reasonable.
Does this MR meet the acceptance criteria?
- Changelog entry
- Feature flag entry
- [-] Documentation (if required)
- Code review guidelines
- Merge request performance guidelines
- Style guides
- Database guides
- Separation of EE specific content
Availability and Testing
- Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- Tested in all supported browsers
- Informed Infrastructure department of a default or new setting change, if applicable per definition of done
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
Label as security and @ mention
- The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- Security reports checked/validated by a reviewer from the AppSec team
Follow-up issues / MRs
- Support the 'verify' LFS action
- Upload LFS objects asynchronously
Part of #16525 (closed)