feat(FN-3573): harden plugin setup sync and test-isolation handling

- Add plugin setup API coverage for migration and sync edge cases
- Expand plugin route tests and implementation safeguards for setup state handling
- Update legacy API glue to align plugin setup responses with route behavior
- Keep test-isolation runtime ignore handling compatible with live app activity

Fusion-Task-Id: FN-3573
This commit is contained in:
Fusion
2026-05-06 14:16:59 -07:00
committed by gsxdsm
parent 846a9900f5
commit 149e1eabfb
5 changed files with 278 additions and 4 deletions

View File

@@ -18,6 +18,7 @@ import type {
WorkflowStepInput,
WorkflowStepResult,
PluginInstallation,
PluginSetupCheckResult,
PluginUiSlotDefinition,
PluginUiContributionDefinition,
PluginDashboardViewDefinition,
@@ -7763,6 +7764,23 @@ export async function updatePluginSettings(
});
}
export type PluginSetupStatusResponse =
| { hasSetup: false }
| { hasSetup: false; status: Extract<PluginSetupCheckResult, { status: "error" }> }
| ({ hasSetup: true } & PluginSetupCheckResult);
/** Fetch plugin setup status */
export async function fetchPluginSetupStatus(id: string, projectId?: string): Promise<PluginSetupStatusResponse> {
return api<PluginSetupStatusResponse>(withProjectId(`/plugins/${encodeURIComponent(id)}/setup-status`, projectId));
}
/** Trigger plugin setup install hook */
export async function installPluginSetup(id: string, projectId?: string): Promise<{ success: boolean; error?: string }> {
return api<{ success: boolean; error?: string }>(withProjectId(`/plugins/${encodeURIComponent(id)}/setup/install`, projectId), {
method: "POST",
});
}
/** Reload a running plugin with updated code */
export async function reloadPlugin(id: string, projectId?: string): Promise<PluginInstallation> {
return api<PluginInstallation>(withProjectId(`/plugins/${encodeURIComponent(id)}/reload`, projectId), {