A release counted as protected only a file named exactly Dockerfile, the Node and Python manifests and the .github directory. The local POC builds its images from Dockerfile.api, Dockerfile.worker and Dockerfile.drosync-coordinator, and pins Go and Rust dependencies in go.mod, go.sum and Cargo files: changing any of them was deployed without approval wherever releases are preauthorized, and so were changes to .dockerignore, *.dockerfile, Containerfiles and Gitea or GitLab CI. The rule now lives in the contracts package. Any Dockerfile or Containerfile, the build context's ignore list, Compose files, every dependency manifest and lock file the verifier knows, and the CI locations need a person; the verifier's notion of a dependency manifest is the same list. Ordinary source, tests and documents still go through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { releaseRisk } from '../apps/api/src/domain/policy.js';
|
|
|
|
const risk = (...changedPaths: string[]) => releaseRisk({ changedPaths, evidenceComplete: true, preauthorized: true });
|
|
|
|
describe('release risk of changed paths', () => {
|
|
it('needs a person for every image recipe and dependency manifest, whatever it is called', () => {
|
|
for (const path of [
|
|
'Dockerfile',
|
|
'Dockerfile.api',
|
|
'Dockerfile.drosync-coordinator',
|
|
'deploy/web.dockerfile',
|
|
'Containerfile',
|
|
'.dockerignore',
|
|
'compose.yaml',
|
|
'docker-compose.prod.yml',
|
|
'go.mod',
|
|
'go.sum',
|
|
'tools/drosync/Cargo.lock',
|
|
'yarn.lock',
|
|
'requirements-dev.txt',
|
|
'package.json',
|
|
'wishforge.yaml',
|
|
])
|
|
expect(risk(path), path).toEqual([`Protected change: ${path}`]);
|
|
});
|
|
it('needs a person for credentials, permissions, schema, infrastructure and CI', () => {
|
|
for (const path of [
|
|
'src/auth/session.ts',
|
|
'internal/security/tokens.go',
|
|
'migrations/002-tags.sql',
|
|
'infra/k8s/api.yaml',
|
|
'.github/workflows/deploy.yml',
|
|
'.gitea/workflows/deploy.yml',
|
|
'.gitlab-ci.yml',
|
|
])
|
|
expect(risk(path), path).toEqual([`Protected change: ${path}`]);
|
|
});
|
|
it('lets ordinary source, tests and documents through', () => {
|
|
for (const path of [
|
|
'src/app.tsx',
|
|
'src/components/Compose.tsx',
|
|
'internal/composer/notes.go',
|
|
'tests/frontend/app.test.mjs',
|
|
'docs/Dockerfile-guide.md',
|
|
'README.md',
|
|
])
|
|
expect(risk(path), path).toEqual([]);
|
|
});
|
|
});
|