[ARVADOS] updated: f9382ce9eb339c8595b83823960481b3cbe79584

git at public.curoverse.com git at public.curoverse.com
Wed Apr 8 12:39:46 EDT 2015


Summary of changes:
 services/arv-git-httpd/auth_handler.go |  3 ++-
 services/arv-git-httpd/main.go         |  1 +
 services/arv-git-httpd/server_test.go  | 10 +++++++++-
 3 files changed, 12 insertions(+), 2 deletions(-)

       via  f9382ce9eb339c8595b83823960481b3cbe79584 (commit)
      from  6ab9f3292ddb980192e3af1090147c32af098d95 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit f9382ce9eb339c8595b83823960481b3cbe79584
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Apr 8 12:41:31 2015 -0400

    5416: Improve logging.

diff --git a/services/arv-git-httpd/auth_handler.go b/services/arv-git-httpd/auth_handler.go
index b2e91de..ef16acb 100644
--- a/services/arv-git-httpd/auth_handler.go
+++ b/services/arv-git-httpd/auth_handler.go
@@ -135,7 +135,6 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
 		"/" + repoName + "/.git",
 	}
 	for _, dir := range tryDirs {
-		log.Println("Trying", theConfig.Root + dir)
 		if fileInfo, err := os.Stat(theConfig.Root + dir); err != nil {
 			if !os.IsNotExist(err) {
 				statusCode, statusText = http.StatusInternalServerError, err.Error()
@@ -147,6 +146,8 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
 		}
 	}
 	if rewrittenPath == "" {
+		log.Println("WARNING:", repoUUID,
+			"git directory not found in", theConfig.Root, tryDirs)
 		// We say "content not found" to disambiguate from the
 		// earlier "API says that repo does not exist" error.
 		statusCode, statusText = http.StatusNotFound, "content not found"
diff --git a/services/arv-git-httpd/main.go b/services/arv-git-httpd/main.go
index 0e92393..452390c 100644
--- a/services/arv-git-httpd/main.go
+++ b/services/arv-git-httpd/main.go
@@ -43,6 +43,7 @@ func main() {
 		log.Fatal(err)
 	}
 	log.Println("Listening at", srv.Addr)
+	log.Println("Repository root", theConfig.Root)
 	if err := srv.Wait(); err != nil {
 		log.Fatal(err)
 	}
diff --git a/services/arv-git-httpd/server_test.go b/services/arv-git-httpd/server_test.go
index e7dd8fe..82d71ae 100644
--- a/services/arv-git-httpd/server_test.go
+++ b/services/arv-git-httpd/server_test.go
@@ -60,6 +60,13 @@ func (s *IntegrationSuite) TestNonexistent(c *check.C) {
 	c.Assert(err, check.ErrorMatches, `.* not found.*`)
 }
 
+func (s *IntegrationSuite) TestMissingGitdirReadableRepository(c *check.C) {
+	// Active user token
+	os.Setenv("ARVADOS_API_TOKEN", "3kg6k6lzmp9kj5cpkcoxie963cmvjahbt2fod9zru30k1jqdmi")
+	err := s.runGit(c, "fetch", "active/foo2.git")
+	c.Assert(err, check.ErrorMatches, `.* not found.*`)
+}
+
 func (s *IntegrationSuite) TestNoPermission(c *check.C) {
 	// Anonymous token
 	os.Setenv("ARVADOS_API_TOKEN", "4kg6k6lzmp9kj4cpkcoxie964cmvjahbt4fod9zru44k4jqdmi")
@@ -142,9 +149,10 @@ func (s *IntegrationSuite) runGit(c *check.C, gitCmd, repo string, args ...strin
 	cmd := exec.Command("git", gitargs...)
 	w, err := cmd.StdinPipe()
 	c.Assert(err, check.Equals, nil)
-	go w.Close()
+	w.Close()
 	output, err := cmd.CombinedOutput()
 	c.Log("git ", gitargs, " => ", err)
+	c.Log(string(output))
 	if err != nil && len(output) > 0 {
 		// If messages appeared on stderr, they are more
 		// helpful than the err returned by CombinedOutput().

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list