Fix release version labels across deployment views

This commit is contained in:
2026-10-17 09:45:53 -04:00
parent b5037a70fe
commit ba9bed6a0d
20 changed files with 485 additions and 39 deletions
@@ -12,7 +12,7 @@ export function applyActivationFiles(
): void {
const changes = db()
.prepare(
`SELECT f.*, ${blobSize('f.content_hash')} AS size, v.version FROM staged_file_changes f
`SELECT f.*, ${blobSize('f.content_hash')} AS size, v.version, v.release_version FROM staged_file_changes f
JOIN provisioning_sources s ON s.kind=f.source_kind AND s.source_id=f.source_id AND s.server=f.server
LEFT JOIN script_versions v ON v.id=f.script_version_id
WHERE s.operation_id=? AND f.state='pending' ORDER BY f.id`
@@ -21,6 +21,7 @@ export function applyActivationFiles(
content_hash: string | null;
size: number;
version: number | null;
release_version: string | null;
})[];
for (const change of changes) {
assertPublicFileTarget(change.server, change.kind, change.rel_path);
@@ -36,6 +37,7 @@ export function applyActivationFiles(
path: change.rel_path,
versionId: change.script_version_id,
version: change.version,
releaseVersion: change.release_version,
sha256: change.content_hash,
size: change.size,
...(includeContent
+9 -2
View File
@@ -38,11 +38,17 @@ export function captureMoveRecipe(server: string): LaunchRecipePlan {
? undefined
: (db()
.prepare(
`SELECT v.version,v.kind,s.name
`SELECT v.version,v.release_version,v.kind,s.name
FROM script_versions v JOIN scripts s ON s.id=v.script_id WHERE v.id=?`
)
.get(file.script_version_id) as
{ version: number; kind: string; name: string } | undefined);
| {
version: number;
release_version: string | null;
kind: string;
name: string;
}
| undefined);
const kind = version?.kind === 'baseline' ? 'config' : (version?.kind ?? before?.kind);
if (!['script', 'plugin', 'config'].includes(kind ?? ''))
throw new Error(`The deployed file type is unavailable for ${file.rel_path}.`);
@@ -59,6 +65,7 @@ export function captureMoveRecipe(server: string): LaunchRecipePlan {
path: file.rel_path,
versionId: file.script_version_id,
version: version?.version ?? null,
releaseVersion: version?.release_version ?? null,
sha256: file.sha256,
size: file.size
};
+2 -1
View File
@@ -1149,7 +1149,8 @@ function sameLaunchFiles(first: LaunchRecipePlan, second: LaunchRecipePlan): boo
expectedMap: recipe.expectedMap,
configFile: recipe.configFile,
configSource: recipe.configSource,
files: recipe.files
// Older frozen recipes lack release labels; display metadata does not change a launch.
files: recipe.files.map(({ releaseVersion: _releaseVersion, ...file }) => file)
});
return JSON.stringify(selected(first)) === JSON.stringify(selected(second));
}