Community
Participate
Working Groups
GitSmartHttpTools [1] always return HTTP-200[2] for 403, 404, 500 errors. HTTP Smart protocol[3]: """ If there is no repository at $GIT_URL, or the resource pointed to by a location matching $GIT_URL does not exist, the server MUST NOT respond with 200 OK response. A server SHOULD respond with 404 Not Found, 410 Gone, or any other suitable HTTP status code which does not imply the resource exists as requested. """ If there is a repository at $GIT_URL, but access is not currently permitted, the server MUST respond with the 403 Forbidden HTTP status code. Uploaded a patch that should solve the issue: https://git.eclipse.org/r/c/jgit/jgit/+/192677 [1] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/refs/heads/master/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java#140 [2] https://git.eclipse.org/r/plugins/gitiles/jgit/jgit/+/refs/heads/master/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitSmartHttpTools.java#251 [3] https://git-scm.com/docs/http-protocol#_general_request_processing
Technical spec for the git-smart-http protocol: https://github.com/git/git/blob/master/Documentation/technical/http-protocol.txt
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/192677 was merged to [stable-6.1]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=8984e1f663b5b58f74cd0381043133f0059e004d
The test seem to fails pretty often in gerrit on master branch: https://ci.eclipse.org/jgit/job/stable/job/jgit.gerrit-pipeline.java11/1339/consoleFull https://ci.eclipse.org/jgit/job/stable/job/jgit.gerrit-pipeline.java11/1342/consoleFull 14:56:49 [ERROR] org.eclipse.jgit.http.test.SmartClientSmartServerTest.testInitialClone_Small[org.eclipse.jgit.transport.http.apache.HttpClientConnectionFactory protocol V0] Time elapsed: 0.213 s <<< FAILURE! 14:56:49 org.junit.ComparisonFailure: expected:<[GE]T> but was:<[POS]T> 14:56:49 at org.eclipse.jgit.http.test.SmartClientSmartServerTest.testInitialClone_Small(SmartClientSmartServerTest.java:613) 14:56:49 Please check if that is a test or code propagation (6.1 -> master) issue.
The test failures seems to be unrelated to this change. The failure is caused by the test expecting the first request from getRequests() to be a GET request whereas it in fact is a POST request. The change fixing this issue doesn't change the VERB in any request and the test did not fail at integration into 6.1 and merge to 6.2, master.
The assumption that "Wants not valid" should result in a 400 HTTP response was not correct, since this is an internal git error that may be transient. The requested SHA-1 might exist but just wasn't available at call-time.
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/196849 was merged to [stable-6.1]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=ac127a7932e3dfa5ac09ccc527123fc0223be5ba