Skip to content

Commit 5f4516b

Browse files
committed
fix(connectors): ado flags listing incomplete when a non-empty repo has no resolvable branch
1 parent b24b223 commit 5f4516b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

apps/sim/connectors/azure-devops/azure-devops.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ interface GitRepository {
220220
isDisabled?: boolean
221221
remoteUrl?: string
222222
webUrl?: string
223+
size?: number
223224
}
224225

225226
interface GitItem {
@@ -850,9 +851,23 @@ async function resolveRepoFiles(
850851
for (const repo of repositories) {
851852
const branch = filters.branch || stripRefsHeads(repo.defaultBranch ?? '')
852853
if (!branch) {
854+
/**
855+
* No branch override and no resolvable default branch. An empty
856+
* repository (size 0) has nothing to list and nothing previously synced,
857+
* so it is skipped without flagging — flagging here would permanently
858+
* suppress deletion reconciliation for any project containing an empty
859+
* repo. A non-empty repository reaching this branch means content exists
860+
* but its default branch ref is missing/unreadable, so the listing is
861+
* flagged incomplete to protect previously synced files from
862+
* reconciliation deletion.
863+
*/
864+
if ((repo.size ?? 0) > 0 && syncContext) {
865+
syncContext.listingCapped = true
866+
}
853867
logger.warn('Skipping Azure DevOps repository with no default branch', {
854868
repoId: repo.id,
855869
repoName: repo.name,
870+
size: repo.size ?? 0,
856871
})
857872
continue
858873
}

0 commit comments

Comments
 (0)