From 5305520f1824e384f3e7b792a8712fd72119daa5 Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Wed, 25 Mar 2026 22:52:48 -0700 Subject: [PATCH 1/3] fix(worker): skip non-directory paths in file-based git connection config Fixes #1005 Co-Authored-By: Claude Sonnet 4.6 --- packages/backend/src/repoCompileUtils.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/backend/src/repoCompileUtils.ts b/packages/backend/src/repoCompileUtils.ts index 9307e9b29..eecb9fb27 100644 --- a/packages/backend/src/repoCompileUtils.ts +++ b/packages/backend/src/repoCompileUtils.ts @@ -14,6 +14,7 @@ import { createLogger } from '@sourcebot/shared'; import { BitbucketConnectionConfig, GerritConnectionConfig, GiteaConnectionConfig, GitlabConnectionConfig, GenericGitHostConnectionConfig, AzureDevOpsConnectionConfig } from '@sourcebot/schemas/v3/connection.type'; import { ProjectVisibility } from "azure-devops-node-api/interfaces/CoreInterfaces.js"; import path from 'path'; +import fs from 'fs/promises'; import { glob } from 'glob'; import { getLocalDefaultBranch, getOriginUrl, isPathAValidGitRepoRoot, isUrlAValidGitRepo } from './git.js'; import assert from 'assert'; @@ -611,6 +612,14 @@ export const compileGenericGitHostConfig_file = async ( logger.info(`Found ${repoPaths.length} path(s) matching pattern '${configUrl.pathname}'`); await Promise.all(repoPaths.map((repoPath) => gitOperationLimit(async () => { + const stat = await fs.stat(repoPath).catch(() => null); + if (!stat || !stat.isDirectory()) { + const warning = `Skipping ${repoPath} - path is not a directory.`; + logger.warn(warning); + warnings.push(warning); + return; + } + const isGitRepo = await isPathAValidGitRepoRoot({ path: repoPath, }); From a209f52774f12a372946eecc0eeb1a07e71d2a5c Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Wed, 25 Mar 2026 22:53:07 -0700 Subject: [PATCH 2/3] chore: update CHANGELOG for #1049 Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcc8ec7e4..15e0e605c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed Ask GitHub landing page chat box placement to be centered on the page instead of at the bottom. [#1046](https://github.com/sourcebot-dev/sourcebot/pull/1046) +- Fixed `file://` connections crashing when a glob pattern matches a file instead of a directory. [#1049](https://github.com/sourcebot-dev/sourcebot/pull/1049) ## [4.16.2] - 2026-03-25 From 64d1326f8f9390762952ffa2d9cea6d7b2f8aa52 Mon Sep 17 00:00:00 2001 From: Brendan Kellam Date: Wed, 25 Mar 2026 22:56:01 -0700 Subject: [PATCH 3/3] c --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15e0e605c..498fa9b68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed Ask GitHub landing page chat box placement to be centered on the page instead of at the bottom. [#1046](https://github.com/sourcebot-dev/sourcebot/pull/1046) -- Fixed `file://` connections crashing when a glob pattern matches a file instead of a directory. [#1049](https://github.com/sourcebot-dev/sourcebot/pull/1049) +- Fixed issue where local git connections (`file://`) would fail when matching a file instead of a directory. [#1049](https://github.com/sourcebot-dev/sourcebot/pull/1049) ## [4.16.2] - 2026-03-25