Skip to content

Commit

Permalink
fix gitlab private vcs (#1632)
Browse files Browse the repository at this point in the history
  • Loading branch information
motatoes authored Jul 23, 2024
1 parent d451330 commit 5ed838a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ee/backend/controllers/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ func handlePullRequestEvent(gitlabProvider utils.GitlabProvider, payload *gitlab

_, config, projectsGraph, err := utils.GetDiggerConfigForBranch(gitlabProvider, projectId, repoFullName, repoOwner, repoName, cloneURL, branch, prNumber, discussionId)
if err != nil {
utils.InitCommentReporter(glService, prNumber, fmt.Sprintf(":x: Could not load digger config, error: %v", err))
log.Printf("getDiggerConfigForPR error: %v", err)
utils.InitCommentReporter(glService, prNumber, fmt.Sprintf(":x: Could not load digger config, error: %v", err))
return fmt.Errorf("error getting digger config")
}

Expand Down Expand Up @@ -338,8 +338,8 @@ func handleIssueCommentEvent(gitlabProvider utils.GitlabProvider, payload *gitla

diggerYmlStr, config, projectsGraph, err := utils.GetDiggerConfigForBranch(gitlabProvider, projectId, repoFullName, repoOwner, repoName, cloneURL, branch, issueNumber, discussionId)
if err != nil {
utils.InitCommentReporter(glService, issueNumber, fmt.Sprintf(":x: Could not load digger config, error: %v", err))
log.Printf("getDiggerConfigForPR error: %v", err)
utils.InitCommentReporter(glService, issueNumber, fmt.Sprintf(":x: Could not load digger config, error: %v", err))
return fmt.Errorf("error getting digger config")
}

Expand Down
2 changes: 1 addition & 1 deletion libs/ci/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func ParseGitLabContext() (*GitLabContext, error) {
func NewGitLabService(token string, gitLabContext *GitLabContext, gitlabBaseUrl string) (*GitLabService, error) {
var client *go_gitlab.Client
var err error
if gitlabBaseUrl == "" {
if gitlabBaseUrl != "" {
client, err = go_gitlab.NewClient(token, go_gitlab.WithBaseURL(gitlabBaseUrl))
} else {
client, err = go_gitlab.NewClient(token)
Expand Down

0 comments on commit 5ed838a

Please sign in to comment.