Skip to content

Commit 74b33cd

Browse files
resolved comments
1 parent af84b60 commit 74b33cd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pkg/sources/gitlab/gitlab.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434
const SourceType = sourcespb.SourceType_SOURCE_TYPE_GITLAB
3535

3636
// Base URL for GitLab Cloud (hosted at gitlab.com)
37-
const gitlabCloudBaseUrl = "https://gitlab.com/"
37+
const gitlabCloudBaseURL = "https://gitlab.com/"
3838

3939
type Source struct {
4040
name string
@@ -638,7 +638,7 @@ func (s *Source) getAllProjectRepos(
638638
Owned: gitlab.Ptr(false),
639639
}
640640

641-
if s.url != gitlabCloudBaseUrl {
641+
if s.url != gitlabCloudBaseURL {
642642
listGroupsOptions.AllAvailable = gitlab.Ptr(true)
643643
}
644644

@@ -730,7 +730,7 @@ func (s *Source) getAllProjectReposV2(
730730
}
731731

732732
// for gitlab.com instance, include only projects where the user is a member.
733-
if s.url == gitlabCloudBaseUrl {
733+
if s.url == gitlabCloudBaseURL {
734734
projectQueryOptions.Membership = gitlab.Ptr(true)
735735
}
736736

@@ -847,7 +847,7 @@ func (s *Source) getAllProjectReposInGroups(
847847
}
848848

849849
// For non gitlab.com instances, you might want to adjust access levels
850-
if s.url != gitlabCloudBaseUrl {
850+
if s.url != gitlabCloudBaseURL {
851851
projectOpts.MinAccessLevel = gitlab.Ptr(gitlab.GuestPermissions)
852852
}
853853

@@ -1125,14 +1125,14 @@ func (s *Source) ChunkUnit(ctx context.Context, unit sources.SourceUnit, reporte
11251125
}
11261126
}
11271127

1128-
normalizedRepoUrl, err := giturl.NormalizeGitlabRepo(repoURL)
1128+
normalizedRepoURL, err := giturl.NormalizeGitlabRepo(repoURL)
11291129
if err != nil {
11301130
ctx.Logger().Error(err, "failed to normalize GitLab Repo", "repo", repoURL)
11311131
return err
11321132
}
11331133
// ensure project details are cached
11341134
// this is required to populate metadata during chunking
1135-
s.ensureProjectInCache(ctx, normalizedRepoUrl)
1135+
s.ensureProjectInCache(ctx, normalizedRepoURL)
11361136

11371137
return s.git.ScanRepo(ctx, repo, path, s.scanOptions, reporter)
11381138
}
@@ -1241,7 +1241,7 @@ func normalizeRepos(repos []string) ([]string, []error) {
12411241
// Otherwise, it ensures we are using https as our protocol, if none was provided.
12421242
func normalizeGitlabEndpoint(gitlabEndpoint string) (string, error) {
12431243
if gitlabEndpoint == "" {
1244-
return gitlabCloudBaseUrl, nil
1244+
return gitlabCloudBaseURL, nil
12451245
}
12461246

12471247
gitlabURL, err := url.Parse(gitlabEndpoint)
@@ -1259,7 +1259,7 @@ func normalizeGitlabEndpoint(gitlabEndpoint string) (string, error) {
12591259

12601260
// If the host is gitlab.com, this is the cloud version, which has only one valid endpoint.
12611261
if gitlabURL.Host == "gitlab.com" {
1262-
return gitlabCloudBaseUrl, nil
1262+
return gitlabCloudBaseURL, nil
12631263
}
12641264

12651265
// Beyond here, on-prem gitlab is being used, so we have to mostly leave things as-is.

0 commit comments

Comments
 (0)