Skip to content

Commit

Permalink
skip projects with no default branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mycrEEpy committed Jun 13, 2022
1 parent cd10312 commit 44d0361
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/crawler/crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ func (c *Crawler) updateProjectInGraph(ctx context.Context, project gitlab.Proje
return fmt.Errorf("failed to write project to neo4j: %w", err)
}

if len(project.DefaultBranch) == 0 {
c.logger.Debug().
Str("Project", project.PathWithNamespace).
Msg("Project has no DefaultBranch")

return nil
}

gitlabCIFile, err := c.gitlabClient.GetRawFileFromProject(ctx, project.ID, gitlabCIFileName, project.DefaultBranch)
if err != nil {
if errors.Is(err, gitlab.ErrRawFileNotFound) {
Expand Down Expand Up @@ -143,6 +151,7 @@ func (c *Crawler) updateProjectInGraph(ctx context.Context, project gitlab.Proje
Msg("failed to parse include")
}
}

return nil
}
}
Expand Down

0 comments on commit 44d0361

Please sign in to comment.