-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix(lfs): ensure that LFS objects are checked out #1392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Any particular reason why you closed this PR @sxlijin? |
Hmm... I thought we had internally come to a different conclusion about this, but double checking our CI setup we didn't: we always run One of the folks on my team had the hypothesis that all the flakiness issues people have reported have to do with persistent/shared state, since we use persistent self-hosted runners. |
Got it. That makes sense based on your description. But I do believe your original comments are correct that only running fetch is never going to update the lfs files in the working copy. My one suggestion for your PR would be to move the git lfs checkout call into an if block where |
Hey there, we do face the same issue, on windows we have to run - uses: actions/checkout@v3
with:
lfs: true
- name: Git LFS Pull
run: git lfs pull to ensure it actually gets pulled |
core.startGroup('Checking out LFS objects') | ||
await git.lfsCheckout() | ||
core.endGroup() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider
core.startGroup('Checking out LFS objects') | |
await git.lfsCheckout() | |
core.endGroup() | |
if (settings.lfs && !settings.sparseCheckout) { | |
core.startGroup('Checking out LFS objects') | |
await git.lfsCheckout() | |
core.endGroup() | |
} |
The current implementation of
lfs: true
does not actually guarantee that LFS objects are checked out:git lfs fetch origin
(which does not update the working copy),git checkout
in combination with the smudge filter to check LFS objects out.However, there are numerous reports of flakiness with this approach (and we've seen this ourselves in our own usage); see #270.
Adding a
git lfs checkout
should make this more robust.Unfortunately I don't have a consistent repro for this issue, beyond the anecdata from our own workflow failures.