diff --git a/.repository-projection.json b/.repository-projection.json index 8b343cf..8515436 100644 --- a/.repository-projection.json +++ b/.repository-projection.json @@ -3,11 +3,11 @@ "projection": "api", "projectionSchemaVersion": 1, "sourceRepository": "dx-corp/mono", - "sourceSha": "84ace1d419d988d2f1a2cbe4dc19c6fd546fe839", + "sourceSha": "4c59ec9a999a589032b671ecb7f8eb91e074866c", "destinationRepository": "dx-corp/api", - "priorProjectedBase": "20e867f86608de4f977663dbc640b266023d4f93", + "priorProjectedBase": "451396559811ce0d198a8375dced2346688f1e7c", "definitionDigest": "4c1601bee99ccc8305013324608e9c146999b21427179d25fd342f69aebd37bd", - "toolDigest": "5efbdc1bdf07975f23e7852a5549bceef368a9a4", - "contentDigest": "5ff2db6a98a76fd67306e9bdd79da7e48e5e58e0bd81fda35be189ac51f48cbc", + "toolDigest": "d0c2f4acb3916b1207c5c9b7b2b8e6e5c772938c", + "contentDigest": "248782cf2f5f710131bbbac709ea99bb14a9db6d39b2a67dc48fe5d9b91a0b58", "publicationEligible": true } diff --git a/scripts/distribution-validation.mjs b/scripts/distribution-validation.mjs index 2f967f0..968e671 100644 --- a/scripts/distribution-validation.mjs +++ b/scripts/distribution-validation.mjs @@ -110,15 +110,25 @@ export async function validateProvenance(name, root) { return provenance; } +export function validateEndpointWorkspace(metadata) { + const expected = new Set(["merlin", "merlin-common", "deixic-wsl-plugin"]); + const names = metadata.packages.map(pkg => pkg.name); + requireValue( + metadata.workspace_members.length === expected.size && names.length === expected.size + && new Set(names).size === expected.size && names.every(name => expected.has(name)), + "endpoint Cargo workspace closure changed", + ); +} + async function validateEndpoint(root, files) { for (const required of ["Cargo.toml", "Cargo.lock", "merlin/Cargo.toml", "merlin-common/Cargo.toml", "merlin-ebpf/Cargo.toml", "packaging/linux/test-packaging.sh", "rules/block-demo.yaml", - "packs/sigma-linux.yaml", "macos/Package.swift"]) { + "packs/sigma-linux.yaml", "macos/Package.swift", "collection-manifest.toml", "windows/wsl-plugin/Cargo.toml"]) { requireValue(files.includes(required), `endpoint is missing ${required}`); } for (const path of files) requireValue(!/^(?:server|admin-ui|tools)(?:\/|$)|^Dockerfile$|^macos\/docs\//.test(path), `endpoint contains an internal surface: ${path}`); const metadata = JSON.parse(run("cargo", ["metadata", "--no-deps", "--locked", "--format-version", "1"], root)); - requireValue(metadata.workspace_members.length === 2 && metadata.packages.every(pkg => ["merlin", "merlin-common"].includes(pkg.name)), "endpoint Cargo workspace closure changed"); + validateEndpointWorkspace(metadata); const ebpf = await readFile(join(root, "merlin-ebpf", "Cargo.toml"), "utf8"); requireValue(/merlin-common\s*=\s*\{\s*path\s*=\s*"\.\.\/merlin-common"\s*\}/.test(ebpf), "endpoint eBPF path closure changed"); run("cargo", ["test", "--locked", "-p", "merlin-common"], root);