Add safe manual instance rebalancing

This commit is contained in:
2026-10-08 12:37:56 -04:00
parent 26de43639f
commit 012cd51a66
45 changed files with 2006 additions and 154 deletions
@@ -163,6 +163,18 @@ describe('provisioning response and return-context boundaries', () => {
expect(provisioningReturn('/collections/launches/launch-a').href).toBe('/collections/launches/launch-a');
});
it('returns rebalance moves to their run while discarding unrelated navigation parameters', () => {
expect(provisioningReturn('/capacity?rebalance=1&rebalanceRun=run-a&redirect=https://evil.test'))
.toEqual({ href: '/capacity?rebalance=1&rebalanceRun=run-a', label: 'Back to rebalance' });
expect(provisioningReturn('/capacity?rebalance=1')).toEqual({ href: '/capacity?rebalance=1', label: 'Back to rebalance' });
expect(provisioningReturn('/capacity?rebalanceRun=run-a').href).toBe('/provisioning');
const detail = fixture();
detail.sources = [{ kind: 'rebalance', source_id: 'run-a', label: 'Rebalance', href: '/capacity?rebalance=1&rebalanceRun=run-a' }];
expect(isProvisioningDetail(detail, detail.deployment.id)).toBe(true);
detail.sources[0].href = '//evil.test';
expect(isProvisioningDetail(detail, detail.deployment.id)).toBe(false);
});
it('rejects incomplete nested snapshots before they replace a working detail', () => {
const detail = fixture();
expect(isProvisioningDetail(detail, detail.deployment.id)).toBe(true);