Persist beta, promotion, drift, and rollback payloads until occupancy and restart-capacity checks pass. Preserve rollback snapshots and campaign ordering, and allow held rollback campaigns to resume safely. Fixes #28 Validation: 805 tests passed, Svelte checks clean, production build passed.
11 lines
762 B
TypeScript
11 lines
762 B
TypeScript
/** File/history unit tests simulate the activation leaf. Provisioning tests cover
|
|
* the occupancy, capacity, source, and restart gates before reaching this leaf. */
|
|
export async function activateFiles(kind: 'beta' | 'campaign', id: number | string): Promise<void> {
|
|
const { stagedFileChanges, applyStagedFilesForOperation } = await import('../../src/lib/server/fleet/staged-files.js');
|
|
const { requestRestart } = await import('../../src/lib/server/provisioning/index.js');
|
|
for (const server of new Set(stagedFileChanges(kind, String(id)).filter(row => row.state === 'pending').map(row => row.server))) {
|
|
const operation = requestRestart(server, { kind, id: String(id) });
|
|
applyStagedFilesForOperation(operation.id, server);
|
|
}
|
|
}
|