Skip to content

Commit

Permalink
Merge pull request #378 from CircleCI-Public/build-config-2-1-two
Browse files Browse the repository at this point in the history
Update pipelines URL
  • Loading branch information
marcomorain authored Mar 9, 2020
2 parents e5767b0 + e5e7592 commit d951526
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/open.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

func projectUrl(remote *git.Remote) string {
return fmt.Sprintf("https://app.circleci.com/%s/%s/%s/pipelines",
return fmt.Sprintf("https://app.circleci.com/pipelines/%s/%s/%s",
url.PathEscape(strings.ToLower(string(remote.VcsType))),
url.PathEscape(remote.Organization),
url.PathEscape(remote.Project))
Expand Down
4 changes: 2 additions & 2 deletions cmd/open_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ var _ = Describe("open", func() {
Project: "foo",
Organization: "bar",
VcsType: git.GitHub,
})).To(Equal("https://app.circleci.com/github/bar/foo/pipelines"))
})).To(Equal("https://app.circleci.com/pipelines/github/bar/foo"))
})

It("escapes garbage", func() {
Expect(projectUrl(&git.Remote{
Project: "/one/two",
Organization: "%^&*()[]",
VcsType: git.Bitbucket,
})).To(Equal("https://app.circleci.com/bitbucket/%25%5E&%2A%28%29%5B%5D/%2Fone%2Ftwo/pipelines"))
})).To(Equal("https://app.circleci.com/pipelines/bitbucket/%25%5E&%2A%28%29%5B%5D/%2Fone%2Ftwo"))
})
})

0 comments on commit d951526

Please sign in to comment.