Skip to content

Commit

Permalink
[chore] Add some happy path logs to GitLab (trufflesecurity#2765)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcastorina authored Apr 29, 2024
1 parent 99ae8f8 commit 6cf3a25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/sources/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk, tar

// Get all repos if not specified.
if len(repos) == 0 {
ctx.Logger().Info("no repositories configured, enumerating")
ignoreRepo := buildIgnorer(s.ignoreRepos, func(err error, pattern string) {
ctx.Logger().Error(err, "could not compile ignore repo glob", "glob", pattern)
})
Expand Down Expand Up @@ -453,6 +454,7 @@ func (s *Source) getAllProjectRepos(
}
break
}
ctx.Logger().V(3).Info("listed user projects", "count", len(userProjects))
if err := processProjects(userProjects); err != nil {
return err
}
Expand Down Expand Up @@ -488,6 +490,7 @@ func (s *Source) getAllProjectRepos(
}
break
}
ctx.Logger().V(3).Info("listed groups", "count", len(groupList))
groups = append(groups, groupList...)
gitlabGroupsEnumerated.WithLabelValues(s.name).Add(float64(len(groupList)))
listGroupsOptions.Page = res.NextPage
Expand Down Expand Up @@ -517,6 +520,7 @@ func (s *Source) getAllProjectRepos(
}
break
}
ctx.Logger().V(3).Info("listed group projects", "count", len(grpPrjs))
if err := processProjects(grpPrjs); err != nil {
return err
}
Expand All @@ -536,6 +540,7 @@ func (s *Source) getAllProjectRepos(
func (s *Source) scanRepos(ctx context.Context, chunksChan chan *sources.Chunk) error {
// If there is resume information available, limit this scan to only the repos that still need scanning.
reposToScan, progressIndexOffset := sources.FilterReposToResume(s.repos, s.GetProgress().EncodedResumeInfo)
ctx.Logger().V(2).Info("filtered repos to resume", "before", len(s.repos), "after", len(reposToScan))
s.repos = reposToScan
scanErrs := sources.NewScanErrors()

Expand Down

0 comments on commit 6cf3a25

Please sign in to comment.