Skip to content

Commit f8c8084

Browse files
committed
Fix early provider resolution aborting commit/push and Option.none nullish coalescing fallback
- Wrap sourceControlProvider call in commit_push_pr action with Effect.catch fallback so provider resolution failure doesn't abort commit and push steps - Replace ?? chain with Option.orElse for updatedAt in Azure DevOps PR normalization so Option.none() from closedDate falls through to creationDate
1 parent 1fb7154 commit f8c8084

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

apps/server/src/git/GitManager.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,10 @@ export const makeGitManager = Effect.fn("makeGitManager")(function* () {
16771677
const currentBranch = branchStep.name ?? initialStatus.branch;
16781678
const commitAction = isCommitAction(input.action) ? input.action : null;
16791679
const changeRequestTerms = wantsPr
1680-
? sourceControlChangeRequestTerms((yield* sourceControlProvider(input.cwd)).kind)
1680+
? yield* sourceControlProvider(input.cwd).pipe(
1681+
Effect.map((provider) => sourceControlChangeRequestTerms(provider.kind)),
1682+
Effect.catch(() => Effect.succeed(sourceControlChangeRequestTerms("unknown"))),
1683+
)
16811684
: null;
16821685

16831686
const commit = commitAction

apps/server/src/sourceControl/azureDevOpsPullRequests.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ function normalizeAzureDevOpsPullRequestRecord(
6262
baseRefName: normalizeRefName(raw.targetRefName),
6363
headRefName: normalizeRefName(raw.sourceRefName),
6464
state: normalizeAzureDevOpsPullRequestState(raw.status),
65-
updatedAt: raw.closedDate ?? raw.creationDate ?? Option.none(),
65+
updatedAt: Option.orElse(
66+
raw.closedDate ?? Option.none(),
67+
() => raw.creationDate ?? Option.none(),
68+
),
6669
};
6770
}
6871

0 commit comments

Comments
 (0)