mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-09-04 14:45:41 +00:00
feat: add service-scoped Compose update and restore (#1648)
* feat: add service-scoped Compose update and restore Allow updating or rebuilding one declared Compose service on multi-service stacks without recreating siblings, with recovery snapshots, health-gate observation, and prune holds for rollback images. Full-stack update paths and single-service UX stay unchanged. * fix: sanitize service-scoped update log messages for CodeQL * fix: address service-scoped update audit findings B-01 through B-07 * fix: complete service-scoped update audit metadata and surfaces * test: wrap Updates readiness tests for deploy-feedback context * fix: keep service recovery reachable without Deploy Progress Make failed service-gate recovery discoverable when Deploy Progress is disabled or dismissed, suppress stale image-scan notification side effects, normalize ComposeService line endings, and add focused regression coverage. * fix: resurface ContainersHealth density and expand on multi-service stacks Service grouping hid the summary strip and Compact/Detailed/Expand controls that still applied to multi-container stacks.
This commit is contained in:
@@ -660,6 +660,38 @@ describe('ComposeService - deployStack', () => {
|
||||
expect(mockGetLegacyOrphanContainersByStack).toHaveBeenCalledWith('my-stack');
|
||||
});
|
||||
|
||||
it('blocks a pilot service restore with relative binds before Compose up', async () => {
|
||||
process.env.SENCHO_MODE = 'pilot';
|
||||
const composeDir = path.resolve('/test/compose');
|
||||
mockGetBindMounts.mockResolvedValue([
|
||||
{ source: '/opt/docker/sencho', destination: composeDir },
|
||||
]);
|
||||
const configProc = createMockProcess();
|
||||
mockSpawn.mockReturnValue(configProc);
|
||||
|
||||
const svc = ComposeService.getInstance(1);
|
||||
const result = svc.recreateServiceFromLocal('my-stack', 'db').then(() => null, (error: Error) => error);
|
||||
await waitForSpawn();
|
||||
configProc.stdout.emit('data', Buffer.from(JSON.stringify({
|
||||
name: 'my-stack',
|
||||
services: {
|
||||
db: {
|
||||
image: 'postgres:17',
|
||||
volumes: [{
|
||||
type: 'bind',
|
||||
source: path.join(composeDir, 'my-stack', 'data'),
|
||||
target: '/var/lib/postgresql/data',
|
||||
}],
|
||||
},
|
||||
},
|
||||
})));
|
||||
configProc.emit('close', 0);
|
||||
|
||||
const error = await result;
|
||||
expect(error?.message).toContain('1:1');
|
||||
expect(mockSpawn).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('does not remove compose-managed containers before deploy (#1565)', async () => {
|
||||
setupAutoCloseSpawn();
|
||||
mockListContainers.mockResolvedValue([]);
|
||||
|
||||
Reference in New Issue
Block a user