Deduplicate artifact bytes and deliver files by authenticated hash
This commit is contained in:
@@ -193,7 +193,7 @@ describe('staged beta files', () => {
|
||||
const { destOfKind, configFileOf } = await import('../../src/lib/server/config.js');
|
||||
const relPath = kind === 'script' ? script.target_rel_path : configFileOf(servers[1]);
|
||||
expect(await readFile(join(destOfKind(servers[1], kind), relPath), 'utf8')).toContain(newestBytes.trim());
|
||||
expect(db().prepare('SELECT content_before FROM deployment_files WHERE deployment_id = ? AND server = ?')
|
||||
expect(db().prepare('SELECT (SELECT content FROM file_blobs WHERE sha256=content_before_hash) AS content_before FROM deployment_files WHERE deployment_id = ? AND server = ?')
|
||||
.get(latest.deploymentId, servers[1])).toEqual({ content_before: null });
|
||||
});
|
||||
|
||||
@@ -219,7 +219,7 @@ describe('staged beta files', () => {
|
||||
await activateFiles('campaign', result.deploymentId);
|
||||
expect(await readFile(path, 'utf8')).toContain('set sv_voice "0"');
|
||||
}
|
||||
const history = db().prepare('SELECT content_before FROM deployment_files WHERE deployment_id = ? AND server = ?')
|
||||
const history = db().prepare('SELECT (SELECT content FROM file_blobs WHERE sha256=content_before_hash) AS content_before FROM deployment_files WHERE deployment_id = ? AND server = ?')
|
||||
.get(result.deploymentId, servers[0]) as { content_before: Buffer };
|
||||
expect(history.content_before.toString()).toBe('original configuration');
|
||||
const { rollbackPromoteDeployment } = await import('../../src/lib/server/fleet/rollback.js');
|
||||
|
||||
Reference in New Issue
Block a user