stable

Clone or download

Read-only

Git LFS client can be used to upload files

For now, since it is not possible to download them to verify, after a succesful upload you should find the corresponding information in the database (plugin_gitlfs_object and plugin_gitlfs_object_repository tables) and on the filesystem (by default at /var/lib/tuleap/git-lfs/). league/flysystem is used to abstract interactions with the data storage. For now, we only store on the local storage but in the future that would allow us to store the large files to dedicated object store. This contribution comes with some shortcomings to keep it managable in terms of reviews. These shortcomings includes: * size of the object is verified only after being written a first time on the disk. This mean a user might upload a larger file than what has been announced to the batch API. The file is deleted after being uploaded completly if the size does not respect the announced size though. * OID of the saved object is computed by reading the file that has just been written to the disk. This is a waste of IO, the OID should be computed on the fly while writting it. * nginx configuration might prevent you to upload a "too large" large file and can be tweaked to be more adapted to kind of traffic. * objects that are not marked as available can left files used during the processing. Notably this can happen if the client never calls the verify action or if there is a hard failure while the code try to do the clean up. This is part of story #12322: have git-lfs batch and basic transfer API Change-Id: I0d00325b019c64095021dd4c233f4cba3a3c125f

Modified Files

Name
M plugins/gitlfs/composer.json +4 −1 Go to diff View file
A plugins/gitlfs/composer.lock +102 −0 Go to diff View file
M plugins/gitlfs/db/install.sql +14 −1 Go to diff View file
A plugins/gitlfs/db/mysql/updates/2018/201806131045_add_object_tables.php +53 −0 Go to diff View file
M plugins/gitlfs/db/uninstall.sql +3 −1 Go to diff View file
A plugins/gitlfs/include/Object/LFSObjectDAO.php +71 −0 Go to diff View file
A plugins/gitlfs/include/Object/LFSObjectPathAllocator.php +49 −0 Go to diff View file
A plugins/gitlfs/include/Object/LFSObjectRetriever.php +43 −0 Go to diff View file
A plugins/gitlfs/include/Transfer/Basic/LFSBasicTransferException.php +25 −0 Go to diff View file
A plugins/gitlfs/include/Transfer/Basic/LFSBasicTransferObjectIntegrityException.php +31 −0 Go to diff View file
A plugins/gitlfs/include/Transfer/Basic/LFSBasicTransferObjectSaver.php +139 −0 Go to diff View file
A plugins/gitlfs/include/Transfer/Basic/LFSBasicTransferObjectSizeException.php +31 −0 Go to diff View file
M plugins/gitlfs/include/Transfer/Basic/LFSBasicTransferUploadController.php +21 −2 Go to diff View file
A plugins/gitlfs/include/Transfer/LFSTransferVerificationException.php +25 −0 Go to diff View file
A plugins/gitlfs/include/Transfer/LFSTransferVerificationNotUploadedObjectException.php +32 −0 Go to diff View file
A plugins/gitlfs/include/Transfer/LFSTransferVerifier.php +93 −0 Go to diff View file
M plugins/gitlfs/include/Transfer/LFSTransferVerifyController.php +24 −2 Go to diff View file
M plugins/gitlfs/include/gitlfsPlugin.class.php +24 −2 Go to diff View file
A plugins/gitlfs/phpunit/Object/LFSObjectRetrieverTest.php +53 −0 Go to diff View file
A plugins/gitlfs/phpunit/Transfer/Basic/LFSBasicTransferObjectSaverTest.php +177 −0 Go to diff View file
A plugins/gitlfs/phpunit/Transfer/LFSTransferVerifierTest.php +119 −0 Go to diff View file