-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Distinguish LFS object errors to ignore missing objects during migration #31702
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wolfogre
added
type/bug
topic/lfs
backport/v1.22
This PR should be backported to Gitea 1.22
labels
Jul 25, 2024
GiteaBot
added
the
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
label
Jul 25, 2024
pull-request-size
bot
added
the
size/M
Denotes a PR that changes 30-99 lines, ignoring generated files.
label
Jul 25, 2024
This was referenced Jul 25, 2024
delvh
reviewed
Jul 25, 2024
delvh
approved these changes
Jul 26, 2024
GiteaBot
added
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
and removed
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
labels
Jul 26, 2024
lunny
approved these changes
Jul 27, 2024
GiteaBot
added
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
and removed
lgtm/need 1
This PR needs approval from one additional maintainer to be merged.
labels
Jul 27, 2024
delvh
added
the
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
label
Jul 28, 2024
wolfogre
added
status/blocked
This PR cannot be merged yet, i.e. because it depends on another unmerged PR
and removed
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
labels
Jul 28, 2024
Please hold on. I need to hear @6543's opinions. |
I'll block it for another two days and merge it if there's no against. |
wolfogre
added
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
and removed
status/blocked
This PR cannot be merged yet, i.e. because it depends on another unmerged PR
labels
Jul 31, 2024
GiteaBot
pushed a commit
to GiteaBot/gitea
that referenced
this pull request
Jul 31, 2024
…ion (go-gitea#31702) Fix go-gitea#31137. Replace go-gitea#31623 go-gitea#31697. When migrating LFS objects, if there's any object that failed (like some objects are losted, which is not really critical), Gitea will stop migrating LFS immediately but treat the migration as successful. This PR checks the error according to the [LFS api doc](https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#successful-responses). > LFS object error codes should match HTTP status codes where possible: > > - 404 - The object does not exist on the server. > - 409 - The specified hash algorithm disagrees with the server's acceptable options. > - 410 - The object was removed by the owner. > - 422 - Validation error. If the error is `404`, it's safe to ignore it and continue migration. Otherwise, stop the migration and mark it as failed to ensure data integrity of LFS objects. And maybe we should also ignore others errors (maybe `410`? I'm not sure what's the difference between "does not exist" and "removed by the owner".), we can add it later when some users report that they have failed to migrate LFS because of an error which should be ignored.
GiteaBot
added
backport/done
All backports for this PR have been created
and removed
reviewed/wait-merge
This pull request is part of the merge queue. It will be merged soon.
labels
Jul 31, 2024
Actually I would never expect some maintainers to respond |
lunny
pushed a commit
that referenced
this pull request
Jul 31, 2024
…ion (#31702) (#31745) Backport #31702 by @wolfogre Fix #31137. Replace #31623 #31697. When migrating LFS objects, if there's any object that failed (like some objects are losted, which is not really critical), Gitea will stop migrating LFS immediately but treat the migration as successful. This PR checks the error according to the [LFS api doc](https://github.com/git-lfs/git-lfs/blob/main/docs/api/batch.md#successful-responses). > LFS object error codes should match HTTP status codes where possible: > > - 404 - The object does not exist on the server. > - 409 - The specified hash algorithm disagrees with the server's acceptable options. > - 410 - The object was removed by the owner. > - 422 - Validation error. If the error is `404`, it's safe to ignore it and continue migration. Otherwise, stop the migration and mark it as failed to ensure data integrity of LFS objects. And maybe we should also ignore others errors (maybe `410`? I'm not sure what's the difference between "does not exist" and "removed by the owner".), we can add it later when some users report that they have failed to migrate LFS because of an error which should be ignored. Co-authored-by: Jason Song <[email protected]>
sorry I'm currently mostly offline on a camp for the next 2 weeks |
but looking at the diff in a glance it looks way better :) |
zjjhot
added a commit
to zjjhot/gitea
that referenced
this pull request
Aug 2, 2024
* giteaofficial/main: Clear up old Actions logs (go-gitea#31735) Fix createElementFromAttrs bug (go-gitea#31751) bump vue-bar-graph (go-gitea#31705) Use UTC as default timezone when schedule Actions cron tasks (go-gitea#31742) Add permission description for API to add repo collaborator (go-gitea#31744) Clarify Actions resources ownership (go-gitea#31724) Exclude protected branches from recently pushed (go-gitea#31748) [skip ci] Updated translations via Crowdin Distinguish LFS object errors to ignore missing objects during migration (go-gitea#31702)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
backport/done
All backports for this PR have been created
backport/v1.22
This PR should be backported to Gitea 1.22
lgtm/done
This PR has enough approvals to get merged. There are no important open reservations anymore.
modifies/go
Pull requests that update Go code
size/M
Denotes a PR that changes 30-99 lines, ignoring generated files.
topic/lfs
type/bug
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #31137.
Replace #31623 #31697.
When migrating LFS objects, if there's any object that failed (like some objects are losted, which is not really critical), Gitea will stop migrating LFS immediately but treat the migration as successful.
This PR checks the error according to the LFS api doc.
If the error is
404
, it's safe to ignore it and continue migration. Otherwise, stop the migration and mark it as failed to ensure data integrity of LFS objects.And maybe we should also ignore others errors (maybe
410
? I'm not sure what's the difference between "does not exist" and "removed by the owner".), we can add it later when some users report that they have failed to migrate LFS because of an error which should be ignored.