stable
Clone or download
This contribution introduces in Tuleap a way to parse batch requests according to the specification [0]. In order to do that, the Git HTTP operations are extended to support the Batch URL POST /objects/batch. The support is for now incomplete and partially incorrect: * nothing is implement besides the request parsing so no batch reponse will be provided * authorization verification is not implemented * responses are supposed to be in the Git responses format, most errors that might be thrown are not. To support that cleanly, some changes need to be introduced in the ways Tuleap handles errors and responses. You can trigger the implemented HTTP route by crafting a valid request on a repository accessible by anonymous users. On success, the parsed batch request will be dumped in the git_syslog. For example, with curl: $ curl -X POST -H 'Accept: application/vnd.git-lfs+json' \ 'https://tuleap.example.com/plugins/git/projectname/reponame.git/info/lfs/objects/batch' \ --data \ '{"operation": "download", "transfers": [ "basic" ], "ref": { "name": "refs/heads/master" }, "objects": [{"oid": "12345678", "size": 123}]}' Git LFS HTTP routes are only accessible when an undocumented feature flag ('git_lfs_dev_enable') is enabled until a minimal support of the Git LFS workflow is implemented. This is part of story #12322: have git-lfs batch and basic transfer API [0] https://github.com/git-lfs/git-lfs/blob/v2.6.0/docs/api/batch.md Change-Id: I9fdeb2ee84532b4244ad6a5f8e020db613cedb93
Modified Files
Name | ||||
---|---|---|---|---|
A | plugins/git/include/Git/HTTP/GitHTTPOperation.php | +29 | −0 | Go to diff View file |
M | plugins/git/include/Git/HTTP/HTTPAccessControl.php | +7 | −12 | Go to diff View file |
M | plugins/git/include/Git/HTTP/HTTPController.php | +2 | −22 | Go to diff View file |
M | plugins/git/include/Git/URL.class.php | +5 | −3 | Go to diff View file |
A | plugins/git/include/LFS/Batch/LFSBatchController.php | +116 | −0 | Go to diff View file |
A | plugins/git/include/LFS/Batch/Request/BatchRequest.php | +165 | −0 | Go to diff View file |
A | plugins/git/include/LFS/Batch/Request/BatchRequestObject.php | +86 | −0 | Go to diff View file |
A | plugins/git/include/LFS/Batch/Request/BatchRequestOperation.php | +58 | −0 | Go to diff View file |
A | plugins/git/include/LFS/Batch/Request/BatchRequestReference.php | +45 | −0 | Go to diff View file |
A | plugins/git/include/LFS/Batch/Request/BatchRequestTransfer.php | +55 | −0 | Go to diff View file |
A | plugins/git/include/LFS/Batch/Request/IncorrectlyFormattedBatchRequestException.php | +25 | −0 | Go to diff View file |
A | plugins/git/include/LFS/LFSFeatureFlagDispatchable.php | +54 | −0 | Go to diff View file |
A | plugins/git/include/LFS/LFSJSONHTTPDispatchable.php | +59 | −0 | Go to diff View file |
M | plugins/git/include/gitPlugin.class.php | +42 | −4 | Go to diff View file |
M | plugins/git/phpunit/HTTP/HTTPAccessControlTest.php | +11 | −11 | Go to diff View file |
A | plugins/git/phpunit/LFS/Batch/Request/BatchRequestOperationTest.php | +44 | −0 | Go to diff View file |
A | plugins/git/phpunit/LFS/Batch/Request/BatchRequestTest.php | +97 | −0 | Go to diff View file |
A | plugins/git/phpunit/LFS/LFSFeatureFlagDispatchableTest.php | +76 | −0 | Go to diff View file |
A | plugins/git/phpunit/LFS/LFSJSONHTTPDispatchableTest.php | +71 | −0 | Go to diff View file |
M | plugins/git/tests/Git/URLTest.php | +2 | −2 | Go to diff View file |
M | tests/phpunit/phpunit.xml | +1 | −0 | Go to diff View file |