Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Fixed line numbers being selectable in Safari in the lightweight code highlighter. [#1037](https://github.com/sourcebot-dev/sourcebot/pull/1037)
- Fixed GitLab sync deleting repos when the API returns a non-404 error (e.g. 500) during group/user/project fetch. [#1039](https://github.com/sourcebot-dev/sourcebot/pull/1039)

### Added
- Added optional copy button to the lightweight code highlighter (`isCopyButtonVisible` prop), shown on hover. [#1037](https://github.com/sourcebot-dev/sourcebot/pull/1037)
Expand Down
24 changes: 9 additions & 15 deletions packages/backend/src/gitlab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,15 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
Sentry.captureException(e);
logger.error(`Failed to fetch projects for group ${group}.`, e);

const status = e?.cause?.response?.status;
if (status !== undefined) {
const warning = `GitLab API returned ${status}`
if (e?.cause?.response?.status === 404) {
const warning = `Group ${group} not found or no access`;
logger.warn(warning);
return {
type: 'warning' as const,
warning
}
};
}

logger.error("No API response status returned");
throw e;
}
}));
Expand Down Expand Up @@ -136,17 +134,15 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
Sentry.captureException(e);
logger.error(`Failed to fetch projects for user ${user}.`, e);

const status = e?.cause?.response?.status;
if (status !== undefined) {
const warning = `GitLab API returned ${status}`
if (e?.cause?.response?.status === 404) {
const warning = `User ${user} not found or no access`;
logger.warn(warning);
return {
type: 'warning' as const,
warning
}
};
}

logger.error("No API response status returned");
throw e;
}
}));
Expand Down Expand Up @@ -174,17 +170,15 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
Sentry.captureException(e);
logger.error(`Failed to fetch project ${project}.`, e);

const status = e?.cause?.response?.status;
if (status !== undefined) {
const warning = `GitLab API returned ${status}`
if (e?.cause?.response?.status === 404) {
const warning = `Project ${project} not found or no access`;
logger.warn(warning);
return {
type: 'warning' as const,
warning
}
};
}

logger.error("No API response status returned");
throw e;
}
}));
Expand Down
Loading