From 47b7c5040fe63fccd2252e5f0f7282b9ae96cd93 Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Tue, 11 Jun 2019 11:07:12 +0200 Subject: [PATCH] gitsource: add repoinfo HTMLURL --- internal/gitsources/gitea/gitea.go | 1 + internal/gitsources/github/github.go | 1 + internal/gitsources/gitlab/gitlab.go | 3 ++- internal/gitsources/gitsource.go | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/gitsources/gitea/gitea.go b/internal/gitsources/gitea/gitea.go index 8aa987f..9dd9d61 100644 --- a/internal/gitsources/gitea/gitea.go +++ b/internal/gitsources/gitea/gitea.go @@ -392,6 +392,7 @@ func fromGiteaRepo(rr *gitea.Repository) *gitsource.RepoInfo { return &gitsource.RepoInfo{ ID: strconv.FormatInt(rr.ID, 10), Path: path.Join(rr.Owner.UserName, rr.Name), + HTMLURL: rr.HTMLURL, SSHCloneURL: rr.SSHURL, HTTPCloneURL: rr.CloneURL, } diff --git a/internal/gitsources/github/github.go b/internal/gitsources/github/github.go index 8de59d9..7d4621a 100644 --- a/internal/gitsources/github/github.go +++ b/internal/gitsources/github/github.go @@ -387,6 +387,7 @@ func fromGithubRepo(rr *github.Repository) *gitsource.RepoInfo { return &gitsource.RepoInfo{ ID: strconv.FormatInt(*rr.ID, 10), Path: path.Join(*rr.Owner.Login, *rr.Name), + HTMLURL: *rr.HTMLURL, SSHCloneURL: *rr.SSHURL, HTTPCloneURL: *rr.CloneURL, } diff --git a/internal/gitsources/gitlab/gitlab.go b/internal/gitsources/gitlab/gitlab.go index 76b87d5..a0198e8 100644 --- a/internal/gitsources/gitlab/gitlab.go +++ b/internal/gitsources/gitlab/gitlab.go @@ -50,7 +50,7 @@ type Client struct { oauth2Secret string } -// fromCommitStatus converts a gitsource commit status to a gitea commit status +// fromCommitStatus converts a gitsource commit status to a gitlab commit status func fromCommitStatus(status gitsource.CommitStatus) gitlab.BuildStateValue { switch status { case gitsource.CommitStatusPending: @@ -279,6 +279,7 @@ func fromGitlabRepo(rr *gitlab.Project) *gitsource.RepoInfo { return &gitsource.RepoInfo{ ID: strconv.Itoa(rr.ID), Path: rr.PathWithNamespace, + HTMLURL: rr.WebURL, SSHCloneURL: rr.SSHURLToRepo, HTTPCloneURL: rr.HTTPURLToRepo, } diff --git a/internal/gitsources/gitsource.go b/internal/gitsources/gitsource.go index fc2bc6d..7e97b57 100644 --- a/internal/gitsources/gitsource.go +++ b/internal/gitsources/gitsource.go @@ -70,6 +70,7 @@ type Oauth2Source interface { type RepoInfo struct { ID string Path string + HTMLURL string SSHCloneURL string HTTPCloneURL string }