FN-5785: fix branch group PR typecheck errors

Export BranchGroupPrState from @fusion/core, narrow task.branchContext
before group lookup, and populate the full PrInfo shape when
reconstructing the group PR from branch_groups metadata.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-31 14:01:50 -07:00
parent e2101ea721
commit c8ae94db6b
2 changed files with 9 additions and 4 deletions

View File

@@ -308,9 +308,10 @@ export async function processPullRequestMergeTask(
// FN-5782 contract: shared group members promote via branch_groups.branchName
// integration branch, while non-shared tasks keep per-task PR behavior.
const isSharedBranchGroupMember = task.branchContext?.assignmentMode === "shared";
const branchGroup = isSharedBranchGroupMember
? store.getBranchGroup(task.branchContext.groupId)
: null;
const branchGroup =
isSharedBranchGroupMember && task.branchContext
? store.getBranchGroup(task.branchContext.groupId)
: null;
if (isSharedBranchGroupMember && branchGroup) {
const members = await store.listTasksByBranchGroup(branchGroup.id);
@@ -330,6 +331,10 @@ export async function processPullRequestMergeTask(
number: branchGroup.prNumber,
url: branchGroup.prUrl ?? "",
status: branchGroup.prState === "merged" ? "merged" : branchGroup.prState === "closed" ? "closed" : "open",
title: buildGroupPullRequestTitle(branchGroup, members),
headBranch: branchGroup.branchName,
baseBranch: projectDefaultBranch,
commentCount: 0,
};
} else {
groupPrInfo = await github.findPrForBranch({ head: branchGroup.branchName, state: "all" });