ci(codegen): Check 3 sweeps both directions — canonical protos missing a vendored copy now fail
This commit is contained in:
@@ -11,8 +11,11 @@
|
||||
# (which breaks the net48 worker build with CS0246 — see docs/Contracts.md).
|
||||
# 3. The Rust crate's vendored protos (clients/rust/protos/*.proto — build inputs that make the
|
||||
# crate buildable outside the repo, CLI-02) are byte-identical to the canonical Contracts
|
||||
# protos. A drift means a .proto was edited without refreshing the vendored copies, which would
|
||||
# publish a stale wire contract to crate consumers while the in-repo build stays correct.
|
||||
# protos, and the two directories hold the same set of files. A drift means a .proto was edited
|
||||
# without refreshing the vendored copies, which would publish a stale wire contract to crate
|
||||
# consumers while the in-repo build stays correct. The sweep runs both directions: a canonical
|
||||
# proto with no vendored copy is just as broken (the published crate cannot build standalone),
|
||||
# and it is invisible in-repo because build.rs prefers the canonical directory when it exists.
|
||||
# 4. The committed Go and Python client bindings match a fresh regeneration (IPC-25). The two
|
||||
# per-client generate-proto.ps1 scripts pin their generators (protoc-gen-go v1.36.11 /
|
||||
# protoc-gen-go-grpc v1.6.2 for Go; grpcio-tools 1.80.0 for Python), so a clean checkout
|
||||
@@ -88,6 +91,16 @@ try {
|
||||
$failures.Add("Rust vendored proto drifted from canonical: clients/rust/protos/$($vendored.Name). Refresh it from src/ZB.MOM.WW.MxGateway.Contracts/Protos/$($vendored.Name).")
|
||||
}
|
||||
}
|
||||
|
||||
# Reverse direction: a canonical proto that was never vendored passes the loop above (it only
|
||||
# walks the vendored dir) but breaks a standalone crate build, because build.rs falls back to
|
||||
# clients/rust/protos/ only outside the repo — in-repo it reads the canonical dir and stays green.
|
||||
foreach ($canonicalProto in Get-ChildItem -Path $canonicalProtoDir -Filter '*.proto' -File) {
|
||||
$vendoredCounterpart = Join-Path $vendoredProtoDir $canonicalProto.Name
|
||||
if (-not (Test-Path $vendoredCounterpart)) {
|
||||
$failures.Add("Canonical proto is not vendored for the Rust crate: $($canonicalProto.Name). Copy src/ZB.MOM.WW.MxGateway.Contracts/Protos/$($canonicalProto.Name) to clients/rust/protos/$($canonicalProto.Name) (and add it to build.rs's input list).")
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
$failures.Add("Rust vendored proto check failed: $($_.Exception.Message)")
|
||||
|
||||
Reference in New Issue
Block a user