feat(ql3): bind local compose revisions to release catalogs

This commit is contained in:
whyour
2026-08-16 16:02:53 +08:00
parent 2ccdd71851
commit dce72c800f
17 changed files with 973 additions and 130 deletions
@@ -7,6 +7,9 @@ const os = require('node:os');
const path = require('node:path');
const { spawnSync } = require('node:child_process');
const { DatabaseSync } = require('node:sqlite');
const {
writeSyntheticLocalReleaseSelection,
} = require('./lib/ql3-local-release-selection-test-fixture.cjs');
const IMAGE_PATTERN =
/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,254}@sha256:[0-9a-f]{64}$/;
@@ -178,6 +181,12 @@ async function main() {
const deploymentRoot = path.join(temporaryRoot, 'deployment');
const commandPath = path.join(temporaryRoot, 'rollout.json');
const uid = process.getuid();
const releaseSelection = writeSyntheticLocalReleaseSelection({
directory: temporaryRoot,
image: input.image,
allowRootService: uid === 0,
sourceRevision: process.env.GITHUB_SHA,
});
let composeResourcesPresent = false;
try {
@@ -191,7 +200,7 @@ async function main() {
busyTimeoutMs: 100,
service: {
kind: 'compose',
image: input.image,
releaseSelection,
allowRootService: uid === 0,
},
},
@@ -275,7 +284,7 @@ async function main() {
},
request: {
expectedGeneration: 1,
image: input.image,
releaseSelection,
mutationId: '019f8680-143d-4000-8000-000000000205',
changedAtMs: 1_785_254_600_004,
},
@@ -392,7 +401,7 @@ async function main() {
},
request: {
expectedGeneration: 2,
image: input.image,
releaseSelection,
mutationId: '019f8680-143d-4000-8000-000000000208',
changedAtMs: 1_785_254_600_007,
},
@@ -711,7 +720,7 @@ async function main() {
},
request: {
expectedGeneration: evidenceGeneration,
image: input.image,
releaseSelection,
mutationId: transaction.revisionId,
changedAtMs: 1_785_254_600_012 + index * 3,
},