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 @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Fixed issue with filtering on generic git repo indexed from http/https [#742](https://github.com/sourcebot-dev/sourcebot/pull/742)
- Fixed auth error when trying to sync public gitlab.com project with no token [#748](https://github.com/sourcebot-dev/sourcebot/pull/748)
- Fixed "Ranges must be added sorted by `from` position and `startSide`" error when browsing certain files. [#743](https://github.com/sourcebot-dev/sourcebot/pull/743)

## [4.10.10] - 2026-01-16
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/ee/repoPermissionSyncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class RepoPermissionSyncer {

const accountIds = await (async () => {
if (repo.external_codeHostType === 'github') {
const isGitHubCloud = credentials.hostUrl ? new URL(credentials.hostUrl).hostname === GITHUB_CLOUD_HOSTNAME : false;
const isGitHubCloud = credentials.hostUrl ? new URL(credentials.hostUrl).hostname === GITHUB_CLOUD_HOSTNAME : true;
const { octokit } = await createOctokitFromToken({
token: credentials.token,
url: isGitHubCloud ? undefined : credentials.hostUrl,
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const isHttpError = (error: unknown, status: number): boolean => {
}

export const createOctokitFromToken = async ({ token, url }: { token?: string, url?: string }): Promise<{ octokit: Octokit, isAuthenticated: boolean }> => {
const isGitHubCloud = url ? new URL(url).hostname === GITHUB_CLOUD_HOSTNAME : false;
const isGitHubCloud = url ? new URL(url).hostname === GITHUB_CLOUD_HOSTNAME : true;
const octokit = new Octokit({
auth: token,
...(url && !isGitHubCloud ? {
Expand Down
14 changes: 7 additions & 7 deletions packages/backend/src/gitlab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const logger = createLogger('gitlab');
export const GITLAB_CLOUD_HOSTNAME = "gitlab.com";

export const createGitLabFromPersonalAccessToken = async ({ token, url }: { token?: string, url?: string }) => {
const isGitLabCloud = url ? new URL(url).hostname === GITLAB_CLOUD_HOSTNAME : false;
const isGitLabCloud = url ? new URL(url).hostname === GITLAB_CLOUD_HOSTNAME : true;
return new Gitlab({
token,
...(token ? { token } : {}),
...(isGitLabCloud ? {} : {
host: url,
}),
Expand All @@ -23,9 +23,9 @@ export const createGitLabFromPersonalAccessToken = async ({ token, url }: { toke
}

export const createGitLabFromOAuthToken = async ({ oauthToken, url }: { oauthToken?: string, url?: string }) => {
const isGitLabCloud = url ? new URL(url).hostname === GITLAB_CLOUD_HOSTNAME : false;
const isGitLabCloud = url ? new URL(url).hostname === GITLAB_CLOUD_HOSTNAME : true;
return new Gitlab({
oauthToken,
...(oauthToken ? { oauthToken } : {}),
...(isGitLabCloud ? {} : {
host: url,
}),
Expand Down Expand Up @@ -99,7 +99,7 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
const status = e?.cause?.response?.status;
if (status !== undefined) {
const warning = `GitLab API returned ${status}`
logger.warning(warning);
logger.warn(warning);
return {
type: 'warning' as const,
warning
Expand Down Expand Up @@ -139,7 +139,7 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
const status = e?.cause?.response?.status;
if (status !== undefined) {
const warning = `GitLab API returned ${status}`
logger.warning(warning);
logger.warn(warning);
return {
type: 'warning' as const,
warning
Expand Down Expand Up @@ -177,7 +177,7 @@ export const getGitLabReposFromConfig = async (config: GitlabConnectionConfig) =
const status = e?.cause?.response?.status;
if (status !== undefined) {
const warning = `GitLab API returned ${status}`
logger.warning(warning);
logger.warn(warning);
return {
type: 'warning' as const,
warning
Expand Down