You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/services
Jason Song 09b56fc069
Distinguish LFS object errors to ignore missing objects during migration (#31702)
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.
6 months ago
..
actions Move `registerActionsCleanup` to `initActionsTasks` (#31721) 6 months ago
agit Performance optimization for git push (#30104) 10 months ago
asymkey Fix some pending problems (#29985) 11 months ago
attachment Add support for API blob upload of release attachments (#29507) 11 months ago
auth allow synchronizing user status from OAuth2 login providers (#31572) 7 months ago
automerge Fix automerge will not work because of some events haven't been triggered (#30780) 8 months ago
context Refactor names (#31405) 8 months ago
contexttest Check if reverse proxy is correctly configured (#30890) 9 months ago
convert add skip secondary authorization option for public oauth2 clients (#31454) 7 months ago
cron Move `registerActionsCleanup` to `initActionsTasks` (#31721) 6 months ago
doctor Resolve lint for unused parameter and unnecessary type arguments (#30750) 9 months ago
externalaccount allow synchronizing user status from OAuth2 login providers (#31572) 7 months ago
feed More `db.DefaultContext` refactor (#27265) 1 year ago
forms add skip secondary authorization option for public oauth2 clients (#31454) 7 months ago
gitdiff Update golangci-lint to v1.59.0 (#31221) 8 months ago
indexer Update issue indexer after merging a PR (#30715) 9 months ago
issue Performance improvements for pull request list API (#30490) 8 months ago
lfs Refactor names (#31405) 8 months ago
mailer Add option to change mail from user display name (#31528) 7 months ago
markup Enable more `revive` linter rules (#30608) 9 months ago
migrations Add `lint-go-gopls` (#30729) 8 months ago
mirror Resolve lint for unused parameter and unnecessary type arguments (#30750) 9 months ago
notify Clean up log messages (#30313) 10 months ago
org Update misspell to 0.5.1 and add `misspellings.csv` (#30573) 9 months ago
packages remove util.OptionalBool and related functions (#29513) 11 months ago
pull Add permission check when creating PR (#31033) 6 months ago
release Check if the release is converted from the tag when updating the release (#30984) 9 months ago
repository Distinguish LFS object errors to ignore missing objects during migration (#31702) 6 months ago
secrets Refactor deletion (#28610) 1 year ago
task Fix "force private" logic (#31012) 9 months ago
uinotification Penultimate round of `db.DefaultContext` refactor (#27414) 1 year ago
user Fix bug on avatar (#31008) 9 months ago
webhook Refactor webhook (#31587) 7 months ago
webtheme Initial support for colorblindness-friendly themes (#30625) 9 months ago
wiki Refactor names (#31405) 8 months ago