Skip to content
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

Support legacy _links LFS batch responses #31513

Merged
merged 2 commits into from
Jun 28, 2024

Conversation

rremer
Copy link
Contributor

@rremer rremer commented Jun 27, 2024

Support legacy _links LFS batch response.

Fixes #31512.

This is backwards-compatible change to the LFS client so that, upon mirroring from an upstream which has a batch api, it can download objects whether the responses contain the _links field or its successor the actions field. When Gitea must fallback to the legacy _links field a logline is emitted at INFO level which looks like this:

...s/lfs/http_client.go:188:performOperation() [I] <LFSPointer ee95d0a27ccdfc7c12516d4f80dcf144a5eaf10d0461d282a7206390635cdbee:160> is using a deprecated batch schema response!

I've only run test-backend with this code, but added a new test to cover this case. Additionally I have a fork with this change deployed which I've confirmed syncs LFS from Gitea<-Artifactory (which has legacy _links) as well as from Gitea<-Gitea (which has the modern actions).

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 27, 2024
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 27, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Jun 27, 2024
@rremer
Copy link
Contributor Author

rremer commented Jun 28, 2024

thanks for the review @wxiaoguang , updated with your suggestions and force pushed

@GiteaBot 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 Jun 28, 2024
@GiteaBot 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 Jun 28, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 28, 2024
@GiteaBot
Copy link
Contributor

@rremer please fix the merge conflicts. 🍵

@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 28, 2024
@lunny lunny enabled auto-merge (squash) June 28, 2024 08:10
@lunny lunny added this to the 1.23.0 milestone Jun 28, 2024
@lunny lunny merged commit df805d6 into go-gitea:main Jun 28, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LFS mirroring support for legacy batch _links responses
4 participants