gitsource: add repoinfo HTMLURL

This commit is contained in:
Simone Gotti 2019-06-11 11:07:12 +02:00
parent 6e8d467c80
commit 47b7c5040f
4 changed files with 5 additions and 1 deletions

View File

@ -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,
}

View File

@ -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,
}

View File

@ -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,
}

View File

@ -70,6 +70,7 @@ type Oauth2Source interface {
type RepoInfo struct {
ID string
Path string
HTMLURL string
SSHCloneURL string
HTTPCloneURL string
}