Pull Mirroring - Warn when pull mirroring if LFS disabled for a project
Overview
At #422486 (comment 1780278532) I was testing Pull Mirroring with LFS objects where the destination project had LFS disabled. The source project had LFS objects and when the pull mirror operation completed on the destination, it was missing LFS objects, which is correct because the option was switched off:
$ git clone http://gdk.test:3000/root/lfs-mirror-test3.git
Cloning into 'lfs-mirror-test3'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 0), reused 7 (delta 0), pack-reused 0
Receiving objects: 100% (7/7), done.
Downloading lfs.text (5 B)
Error downloading object: lfs.text (c9d04c9): Smudge error: Error downloading lfs.text (c9d04c9565fc665c80681fb1d829938026871f66e14f501e08531df66938a789): batch response: Not found.
Errors logged to '/private/tmp/lfs-mirror-test3/.git/lfs/logs/20240220T141644.930326.log'.
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: lfs.text: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
Although this won't be super common, it can occur.
Proposal
Simple solution is to update the bullet points
Current bullet point: Git LFS objects will be synced if LFS is [enabled for the project]. Push mirrors will not sync LFS objects over SSH.
- Add info about pull mirror and LFS creation above current bullet point about push mirrors and LFS
-
- Pull mirrors will only create LFS objects if LFS is [enabled for this project].
-
- Split current bullet point into 2 point points
- Updated:
- Push mirrors will only sync LFS objects if LFS is [enabled for this project].
- Push mirrors will not sync LFS objects over SSH.
- Updated:
End result should read like this:
- Pull mirrors will only create Git LFS objects if LFS is [enabled for this project].
- Push mirrors will only sync Git LFS objects if LFS is [enabled for this project].
- Push mirrors will not sync Git LFS objects over SSH.
Advanced solution: Detect current's project LFS enablement
If LFS is disabled for a project, warn this is the case in the UI when attempting to setup new pull mirrors or for existing pull mirrors.
Updated text:
- LFS is (enabled/disabled) for this project [Change setting]
- Pull mirrors (will/will not) create LFS objects
- Push mirrors (will/will not) sync LFS objects
- Push mirrors will not sync LFS objects over SSH.
cc @mcbabin
Edited by Joe Woodward