Skip to content

Commit ebf4772

Browse files
author
Ivan Palladino
committed
maintner: removed the cl url generator
Restored the maintner file moving the cl url generator to the gopherbot logic as in the previous version.
1 parent 590a834 commit ebf4772

File tree

3 files changed

+1
-28
lines changed

3 files changed

+1
-28
lines changed

cmd/gopherbot/gopherbot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ func (b *gopherbot) cl2issue(ctx context.Context) error {
915915
// already processed this issue.
916916
return nil
917917
}
918-
prefix := fmt.Sprintf("Change %s", cl.URL().String())
918+
prefix := fmt.Sprintf("Change https://golang.org/cl/%d", cl.Number)
919919
for _, ref := range cl.GitHubIssueRefs {
920920
if id := ref.Repo.ID(); id.Owner != "golang" || id.Repo != "go" {
921921
continue

maintner/gerrit.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -509,16 +509,6 @@ func (cl *GerritCL) CommitAtVersion(version int32) *GitCommit {
509509
return cl.Project.commit[hash]
510510
}
511511

512-
// URL returns the absolute url of the CL.
513-
func (cl *GerritCL) URL() *url.URL {
514-
s := fmt.Sprintf("https://golang.org/cl/%d", cl.Number)
515-
u, err := url.Parse(s)
516-
if err != nil {
517-
return &url.URL{}
518-
}
519-
return u
520-
}
521-
522512
func (cl *GerritCL) updateGithubIssueRefs() {
523513
gp := cl.Project
524514
gerrit := gp.gerrit

maintner/gerrit_test.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -559,20 +559,3 @@ func TestGerritHashtagsLen(t *testing.T) {
559559
}
560560
}
561561
}
562-
563-
func TestGerritURL(t *testing.T) {
564-
tests := []struct {
565-
set int32
566-
want string
567-
}{
568-
{0, "https://golang.org/cl/0"},
569-
{1238812784, "https://golang.org/cl/1238812784"},
570-
}
571-
for _, tt := range tests {
572-
cl := &GerritCL{Number: tt.set}
573-
got := cl.URL().String()
574-
if got != tt.want {
575-
t.Errorf("For set %d, url = %#v; want %v", tt.set, got, tt.want)
576-
}
577-
}
578-
}

0 commit comments

Comments
 (0)