-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add push SSH LFS protocol support #31448
Closed
Closed
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
GiteaBot
added
the
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
label
Jun 21, 2024
pull-request-size
bot
added
the
size/XS
Denotes a PR that changes 0-9 lines, ignoring generated files.
label
Jun 21, 2024
github-actions
bot
added
modifies/go
Pull requests that update Go code
modifies/cli
PR changes something on the CLI, i.e. gitea doctor or gitea admin
labels
Jun 21, 2024
github-actions
bot
added
modifies/translation
modifies/api
This PR adds API routes or modifies them
modifies/templates
This PR modifies the template files
modifies/docs
modifies/migrations
modifies/internal
modifies/js
modifies/dependencies
labels
Jun 27, 2024
pull-request-size
bot
added
size/XXL
Denotes a PR that changes 1000+ lines, ignoring generated files.
and removed
size/XS
Denotes a PR that changes 0-9 lines, ignoring generated files.
labels
Jun 27, 2024
github-actions
bot
removed
modifies/translation
modifies/api
This PR adds API routes or modifies them
modifies/templates
This PR modifies the template files
modifies/migrations
modifies/internal
modifies/js
labels
Jun 27, 2024
ConcurrentCrab
force-pushed
the
lfs-ssh
branch
4 times, most recently
from
June 28, 2024 03:15
8831e42
to
841169e
Compare
ConcurrentCrab
changed the title
[WIP] Add push SSH LFS protocol support
Add push SSH LFS protocol support
Jun 28, 2024
Pushing and cloning work well now. Removing draft label. To test, run pushes like: |
The code here checks if the repo being requested doesn't exist. If it doesn't, then a write operation might create it. But a read operation doesn't make any sense, and should error out. So simply check the access mode. I assume this was the intent here, but only checked for one "verb" instead, while there exist other read-only verbs as well. And ofc more can be introduced in the future ;) Possibly some write verbs don't make sense as well (presumably those that only add stuff incrementally to existing repos)?
Coalesce access mode detection into one place. Yes, "upload" really has opposite semantics for git commands vs. git-lfs commands. Wow. This commit makes no functional changes.
A download command in the SSH protocol doesn't specify size, so this was necessary.
Big changes are inevitable due to the difference in Gitea's approach to storing LFS files. And upstream hasn't tagged for a while anyway.
Make a few changes to make the transfer backend suit Gitea better. Merge Upload into one method: Makes things simpler since out content store verifies size & hashes itself Change Download return into io.ReadCloser: Removes dependency on filesystem Add size: int64 arguments wherever appropriate In arguments for Upload and Verify, and in return for Download
Also add handler in runServ() The protocol lib supports locking but the backend does not, as neither does Gitea. Support can be added later and the capability advertised.
Changed package from |
Continued in #31516 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
lgtm/need 2
This PR needs two approvals by maintainers to be considered for merging.
modifies/cli
PR changes something on the CLI, i.e. gitea doctor or gitea admin
modifies/dependencies
modifies/docs
modifies/go
Pull requests that update Go code
size/XXL
Denotes a PR that changes 1000+ lines, ignoring generated files.
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.
Fixes #17554
/claim #17554
DONTMERGE, this is very much a minimum-changes-required commit, probably needs cleanup and documentation changes.