From 088e5d850e52e25d5afba5065183c993ccf92090 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 11 Dec 2014 17:08:18 +1100 Subject: [PATCH] website: redirect issues to github instead of google code Change-Id: I0216bfc33be79f137277180f71a3492c69e39835 --- website/camweb.go | 8 ++++---- website/camweb_test.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/website/camweb.go b/website/camweb.go index 801c224df..1290ebcd9 100644 --- a/website/camweb.go +++ b/website/camweb.go @@ -399,7 +399,7 @@ func main() { log.Fatalf("Serve error: %v", <-errc) } -var issueNum = regexp.MustCompile(`^/(?:issue(?:s)?|bugs)(/\d*)?$`) +var issueNum = regexp.MustCompile(`^/(?:issue|bug)s?(/\d*)?$`) // issueRedirect returns whether the request should be redirected to the // issues tracker, and the url for that redirection if yes, the empty @@ -410,11 +410,11 @@ func issueRedirect(urlPath string) (string, bool) { return "", false } issueNumber := strings.TrimPrefix(m[1], "/") - suffix := "list" + suffix := "" if issueNumber != "" { - suffix = "detail?id=" + issueNumber + suffix = "/" + issueNumber } - return "https://code.google.com/p/camlistore/issues/" + suffix, true + return "https://github.com/camlistore/camlistore/issues" + suffix, true } func gerritRedirect(w http.ResponseWriter, r *http.Request) { diff --git a/website/camweb_test.go b/website/camweb_test.go index 142f83ddb..5bbc1a199 100644 --- a/website/camweb_test.go +++ b/website/camweb_test.go @@ -45,8 +45,8 @@ func TestRedirect(t *testing.T) { } func TestIsIssueRequest(t *testing.T) { - wantNum := "https://code.google.com/p/camlistore/issues/detail?id=34" - wantList := "https://code.google.com/p/camlistore/issues/list" + wantNum := "https://github.com/camlistore/camlistore/issues/34" + wantList := "https://github.com/camlistore/camlistore/issues" tests := []struct { urlPath string redirects bool