diff --git a/.repository-projection.json b/.repository-projection.json index 4233bbd..2982713 100644 --- a/.repository-projection.json +++ b/.repository-projection.json @@ -3,11 +3,11 @@ "projection": "examples", "projectionSchemaVersion": 1, "sourceRepository": "dx-corp/mono", - "sourceSha": "84ace1d419d988d2f1a2cbe4dc19c6fd546fe839", + "sourceSha": "4c59ec9a999a589032b671ecb7f8eb91e074866c", "destinationRepository": "dx-corp/examples", - "priorProjectedBase": "7f68cdb221cd60b078ae027e458c8fdfc306f5e5", + "priorProjectedBase": "eca39561a16feb8b1f96cfa9ff6b902b25b57117", "definitionDigest": "ec2a926dbb322ffc1c2329c0b1f56b2b8bc0528c918473ebbcea0ef8234ff2b5", - "toolDigest": "5efbdc1bdf07975f23e7852a5549bceef368a9a4", - "contentDigest": "11d6fe99710cde13e7f5b8abb90ac2c8f39bfc6ee76a6190ed11e57282517370", + "toolDigest": "d0c2f4acb3916b1207c5c9b7b2b8e6e5c772938c", + "contentDigest": "a21d875d331cec2a7ad243f991e2c118b7958f95c3b48d711ab88c13189a1211", "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);