feat(FN-837): add workflow step phase support with pre-merge and post-merge execution
- Add phase field to workflow step definitions (pre-merge vs post-merge) with persistence and API - Execute pre-merge steps in executor before merge; post-merge steps in merger after successful merge - Pre-merge failures block merge and keep task in in-review; post-merge failures are logged only - Expose phase controls and phase-aware results in the dashboard UI - Add changeset for the published @gsxdsm/fusion package
This commit is contained in:
@@ -12,7 +12,6 @@ const NON_TERMINAL_STEP_STATUSES = new Set([
|
||||
|
||||
const NON_TERMINAL_WORKFLOW_STATUSES = new Set<WorkflowStepResult["status"]>([
|
||||
"pending",
|
||||
"failed",
|
||||
]);
|
||||
|
||||
/**
|
||||
@@ -40,10 +39,24 @@ export function getTaskMergeBlocker(
|
||||
return "task has incomplete steps";
|
||||
}
|
||||
|
||||
// Only pre-merge workflow step failures block merge.
|
||||
// Post-merge failures run after merge and do not block it.
|
||||
if (
|
||||
task.workflowStepResults?.some((result) => NON_TERMINAL_WORKFLOW_STATUSES.has(result.status))
|
||||
task.workflowStepResults?.some((result) => {
|
||||
const phase = result.phase || "pre-merge";
|
||||
return phase === "pre-merge" && NON_TERMINAL_WORKFLOW_STATUSES.has(result.status);
|
||||
})
|
||||
) {
|
||||
return "task has incomplete or failed workflow steps";
|
||||
return "task has incomplete or failed pre-merge workflow steps";
|
||||
}
|
||||
|
||||
if (
|
||||
task.workflowStepResults?.some((result) => {
|
||||
const phase = result.phase || "pre-merge";
|
||||
return phase === "pre-merge" && result.status === "failed";
|
||||
})
|
||||
) {
|
||||
return "task has failed pre-merge workflow steps";
|
||||
}
|
||||
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user