mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-20 16:07:11 +08:00
fix(ci): align local image contract v51
This commit is contained in:
@@ -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}")"
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user