diff --git a/CHANGELOG.md b/CHANGELOG.md index a8e6cff6..22a0ed5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed issue with GitLab sub-projects not being included recursively. ([#54](https://github.com/sourcebot-dev/sourcebot/pull/54)) - Fixed slow rendering performance when rendering a large number of results. ([#52](https://github.com/sourcebot-dev/sourcebot/pull/52)) +- Fixed issue with either `star_count` or `fork_count` not being included in the GitLab api response. ([#55](https://github.com/sourcebot-dev/sourcebot/issues/55)) ## [2.1.1] - 2024-10-25 diff --git a/packages/backend/src/gitlab.ts b/packages/backend/src/gitlab.ts index 7730c95b..9918c13d 100644 --- a/packages/backend/src/gitlab.ts +++ b/packages/backend/src/gitlab.ts @@ -84,8 +84,8 @@ export const getGitLabReposFromConfig = async (config: GitLabConfig, ctx: AppCon 'zoekt.web-url-type': 'gitlab', 'zoekt.web-url': project.web_url, 'zoekt.name': repoId, - 'zoekt.gitlab-stars': project.star_count.toString(), - 'zoekt.gitlab-forks': project.forks_count.toString(), + 'zoekt.gitlab-stars': project.star_count?.toString() ?? '0', + 'zoekt.gitlab-forks': project.forks_count?.toString() ?? '0', 'zoekt.archived': marshalBool(project.archived), 'zoekt.fork': marshalBool(isFork), 'zoekt.public': marshalBool(project.visibility === 'public'),