fix(ci): align local image contract v51

This commit is contained in:
whyour
2026-08-23 20:33:40 +08:00
parent 31a9bcbe83
commit 45f8218247
3 changed files with 28 additions and 1 deletions
+1 -1
View File
@@ -391,7 +391,7 @@ jobs:
- name: Verify non-root identity and architecture
env:
IMAGE: qinglong3-local-application:ci-${{ matrix.image_arch }}
EXPECTED: ${{ matrix.image_arch }} 65532:65532 2,3,4 50 50 50 1
EXPECTED: ${{ matrix.image_arch }} 65532:65532 2,3,4 51 51 51 1
run: |
set -euo pipefail
actual="$(docker image inspect --format '{{.Architecture}} {{.Config.User}} {{index .Config.Labels "io.qinglong.local.application-config"}} {{index .Config.Labels "io.qinglong.local.sqlite-contract-min"}} {{index .Config.Labels "io.qinglong.local.sqlite-contract-max"}} {{index .Config.Labels "io.qinglong.local.sqlite-write-contract"}} {{index .Config.Labels "io.qinglong.local.compose-selection"}}' "${IMAGE}")"
+1
View File
@@ -285,6 +285,7 @@ function auditWorkflow(contents, findings) {
'pnpm audit:local-image:ql3',
'docker build',
'--file deploy/containers/ql3-local-application/Dockerfile',
'EXPECTED: ${{ matrix.image_arch }} 65532:65532 2,3,4 51 51 51 1',
'actual="$(docker image inspect --format \'{{.Architecture}} {{.Config.User}} {{index .Config.Labels "io.qinglong.local.application-config"}} {{index .Config.Labels "io.qinglong.local.sqlite-contract-min"}} {{index .Config.Labels "io.qinglong.local.sqlite-contract-max"}} {{index .Config.Labels "io.qinglong.local.sqlite-write-contract"}} {{index .Config.Labels "io.qinglong.local.compose-selection"}}\' "${IMAGE}")"',
'io.qinglong.local.application-config',
'io.qinglong.local.sqlite-contract-min',
+26
View File
@@ -255,3 +255,29 @@ test('rejects removal of either Profile from the native image CI gate', () => {
current.close();
}
});
test('rejects a stale SQLite contract expectation in the native image CI gate', () => {
const current = fixture();
try {
const workflowPath = path.join(
current.root,
'.github/workflows/ql3-ci.yml',
);
const workflow = fs
.readFileSync(workflowPath, 'utf8')
.replace(
'EXPECTED: ${{ matrix.image_arch }} 65532:65532 2,3,4 51 51 51 1',
'EXPECTED: ${{ matrix.image_arch }} 65532:65532 2,3,4 50 50 50 1',
);
fs.writeFileSync(workflowPath, workflow);
const report = auditLocalImageContract(current.root);
assert.equal(report.compatible, false);
assert.ok(
report.findings.some(
({ code }) => code === 'LOCAL_IMAGE_CI_CONTRACT_DRIFT',
),
);
} finally {
current.close();
}
});