Rename orchestration, splice and routes: a Renamer runs one rename at a time, closing the gate, taking the controller lock and holding the engine, each waiting without a limit and saying what it waits for (summary rename status, rename_waiting); DELETE on the pending request or a closed connection calls it off until the journal begins (409 aborted); then journal, steps and audit, retried in the background on failure (503 completing); splice_renamed rebuilds the affected flows under the held lock keeping stopped, paused and parked work, history limits and device wiring refreshed before activation; AlertManager.rename and EventBus.rename/settle follow the names; flow and dashboard rename routes answer by code and repeat stored results; renamed, dashboard_changed and pipeline_rebuilt after release; fluksio serve reads flow files without building a FlowStore

This commit is contained in:
2026-11-02 22:14:44 +01:00
parent 2d65118d82
commit ba4aae390d
16 changed files with 2174 additions and 22 deletions
+159
View File
@@ -2192,6 +2192,16 @@ export const HealthSummarySchema = {
type: 'string',
title: 'Version',
default: ''
},
rename: {
anyOf: [
{
'$ref': '#/components/schemas/RenameStatus'
},
{
type: 'null'
}
]
}
},
type: 'object',
@@ -4019,6 +4029,122 @@ export const RenameRefusalSchema = {
description: 'Why a rename cannot go ahead, with the ids of what is in the way.'
} as const;
export const RenameRequestSchema = {
properties: {
request_id: {
type: 'string',
maxLength: 64,
minLength: 1,
title: 'Request Id'
},
expected_name: {
type: 'string',
title: 'Expected Name'
},
expected_version: {
type: 'integer',
title: 'Expected Version'
},
new_name: {
type: 'string',
title: 'New Name'
},
fingerprint: {
type: 'string',
title: 'Fingerprint'
}
},
type: 'object',
required: ['request_id', 'expected_name', 'expected_version', 'new_name', 'fingerprint'],
title: 'RenameRequest',
description: `A rename as its plan described it. Refused when the object or the
plan moved since (409 \`\`stale\`\` or \`\`plan_changed\`\`).`
} as const;
export const RenameResultSchema = {
properties: {
op: {
type: 'string',
title: 'Op'
},
kind: {
type: 'string',
enum: ['flow', 'dashboard'],
title: 'Kind'
},
id: {
type: 'string',
title: 'Id'
},
old_name: {
type: 'string',
title: 'Old Name'
},
new_name: {
type: 'string',
title: 'New Name'
},
documents: {
items: {
'$ref': '#/components/schemas/RenamedDocument'
},
type: 'array',
title: 'Documents'
}
},
type: 'object',
required: ['op', 'kind', 'id', 'old_name', 'new_name', 'documents'],
title: 'RenameResult',
description: 'What a finished rename answers, again for a repeated request.'
} as const;
export const RenameStatusSchema = {
properties: {
op: {
type: 'string',
title: 'Op'
},
kind: {
type: 'string',
enum: ['flow', 'dashboard'],
title: 'Kind'
},
id: {
type: 'string',
title: 'Id'
},
old: {
type: 'string',
title: 'Old'
},
new: {
type: 'string',
title: 'New'
},
phase: {
type: 'string',
title: 'Phase'
},
busy: {
items: {
type: 'string'
},
type: 'array',
title: 'Busy',
default: []
},
error: {
type: 'string',
title: 'Error',
default: ''
}
},
type: 'object',
required: ['op', 'kind', 'id', 'old', 'new', 'phase'],
title: 'RenameStatus',
description: 'A rename under way, for whoever is waiting on it or was turned away.'
} as const;
export const RenameWarningSchema = {
properties: {
code: {
@@ -4036,6 +4162,39 @@ export const RenameWarningSchema = {
description: 'Something a rename changes, or leaves, that its caller should know.'
} as const;
export const RenamedDocumentSchema = {
properties: {
kind: {
type: 'string',
enum: ['flow', 'dashboard'],
title: 'Kind'
},
id: {
type: 'string',
title: 'Id'
},
version: {
type: 'integer',
title: 'Version'
},
draft_version: {
anyOf: [
{
type: 'integer'
},
{
type: 'null'
}
],
title: 'Draft Version'
}
},
type: 'object',
required: ['kind', 'id', 'version'],
title: 'RenamedDocument',
description: "A document's versions after a rename. Both variants have the same."
} as const;
export const ResourceLevelSchema = {
properties: {
total: {
File diff suppressed because one or more lines are too long
+70
View File
@@ -722,6 +722,7 @@ export type HealthSummary = {
[key: string]: (number);
};
version?: string;
rename?: (RenameStatus | null);
};
export type HistoryCounts = {
@@ -1258,6 +1259,16 @@ export type RemoteUserBody = {
code: string;
};
/**
* A document's versions after a rename. Both variants have the same.
*/
export type RenamedDocument = {
kind: 'flow' | 'dashboard';
id: string;
version: number;
draft_version?: (number | null);
};
/**
* What renaming a flow's or dashboard's key would change, and whether it
* may. Read-only; the rename request repeats ``version`` and
@@ -1295,6 +1306,44 @@ export type RenameRefusal = {
ids?: Array<(string)>;
};
/**
* A rename as its plan described it. Refused when the object or the
* plan moved since (409 ``stale`` or ``plan_changed``).
*/
export type RenameRequest = {
request_id: string;
expected_name: string;
expected_version: number;
new_name: string;
fingerprint: string;
};
/**
* What a finished rename answers, again for a repeated request.
*/
export type RenameResult = {
op: string;
kind: 'flow' | 'dashboard';
id: string;
old_name: string;
new_name: string;
documents: Array<RenamedDocument>;
};
/**
* A rename under way, for whoever is waiting on it or was turned away.
*/
export type RenameStatus = {
op: string;
kind: 'flow' | 'dashboard';
id: string;
old: string;
new: string;
phase: string;
busy?: Array<(string)>;
error?: string;
};
/**
* Something a rename changes, or leaves, that its caller should know.
*/
@@ -2024,6 +2073,13 @@ export type DashboardsPlanDashboardRenameData = {
export type DashboardsPlanDashboardRenameResponse = (RenamePlan);
export type DashboardsRenameDashboardData = {
dashboardId: string;
requestBody: RenameRequest;
};
export type DashboardsRenameDashboardResponse = (RenameResult);
export type DevicesStartPairingData = {
requestBody?: (PairHello | null);
};
@@ -2189,6 +2245,20 @@ export type FlowsPlanFlowRenameData = {
export type FlowsPlanFlowRenameResponse = (RenamePlan);
export type FlowsRenameFlowData = {
flowId: string;
requestBody: RenameRequest;
};
export type FlowsRenameFlowResponse = (RenameResult);
export type FlowsCancelFlowRenameData = {
flowId: string;
requestId: string;
};
export type FlowsCancelFlowRenameResponse = (Message);
export type FlowsReadNodeSourceData = {
flowId: string;
nodeId: string;