Merge branch 'fix/ipc-24-25-codegen'
# Conflicts: # archreview/2026-07-12/remediation/00-tracking.md
This commit is contained in:
@@ -88,15 +88,23 @@ scripts assert the pin and resolve tools from `PATH`:
|
||||
| Generator | Pinned version | Guard |
|
||||
|-----------|----------------|-------|
|
||||
| protoc (descriptor set) | 34.1 | version assertion in `scripts/publish-client-proto-inputs.ps1` |
|
||||
| `Grpc.Tools` (C# `Generated/`) | 2.80.0 (contracts csproj) | `scripts/check-codegen.ps1` git-diff of `Generated/` |
|
||||
| `grpcio-tools` (Python) | 1.80.0 (protobuf runtime 6.31.1) | version assertion in `clients/python/generate-proto.ps1` |
|
||||
| protobuf / grpc-java (Java) | `protobufVersion` / `grpcVersion` in `clients/java/build.gradle` | `checkGeneratedClean` gradle task |
|
||||
| `Grpc.Tools` (C# `Generated/`) | 2.80.0 (contracts csproj) | `scripts/check-codegen.ps1` git-diff of `Generated/` (Check 2) |
|
||||
| `protoc-gen-go` (Go) | v1.36.11 | version assertion in `clients/go/generate-proto.ps1`; `check-codegen.ps1` Check 4 |
|
||||
| `protoc-gen-go-grpc` (Go) | 1.6.2 | version assertion in `clients/go/generate-proto.ps1`; `check-codegen.ps1` Check 4 |
|
||||
| `grpcio-tools` (Python) | 1.80.0 (protobuf runtime 6.31.1) | version assertion in `clients/python/generate-proto.ps1`; `check-codegen.ps1` Check 4 |
|
||||
| protobuf / grpc-java (Java) | `protobufVersion` / `grpcVersion` in `clients/java/build.gradle` | CI `git diff --exit-code` over `clients/java/src/main/generated` after `gradle test` (the `checkGeneratedClean` gradle task is the equivalent local check) |
|
||||
|
||||
A newer `grpcio-tools` stamps a `GRPC_GENERATED_VERSION` above the pinned grpcio
|
||||
runtime and breaks Python `pytest`; the Java protobuf plugin rewrites
|
||||
`MxaccessGateway.java` with spurious protobuf-runtime-version churn on every build
|
||||
(revert that one file when no `.proto` changed — see
|
||||
[Gateway Testing](./GatewayTesting.md) "Continuous Integration").
|
||||
runtime and breaks Python `pytest`, so the Python and Go scripts assert their
|
||||
generator pins before regenerating. Under the pinned grpc/protobuf toolchain the
|
||||
Java protobuf plugin regenerates byte-identical output (modulo real `.proto`
|
||||
changes), so CI enforces Java freshness with a direct `git diff --exit-code -- clients/java/src/main/generated`
|
||||
step after `gradle test` (which transitively regenerates via `generateProto`); the
|
||||
`checkGeneratedClean` gradle task is the equivalent check for local/manual use. The
|
||||
old unconditional churn-revert CI step (which masked message-level drift in the
|
||||
single-file Java aggregates) was deleted (IPC-24). Go and Python committed
|
||||
bindings are guarded by `check-codegen.ps1` **Check 4**, which regenerates both
|
||||
and fails on any diff.
|
||||
|
||||
## Output Directories
|
||||
|
||||
|
||||
+5
-1
@@ -114,7 +114,11 @@ dotnet build src/ZB.MOM.WW.MxGateway.Contracts/ZB.MOM.WW.MxGateway.Contracts.csp
|
||||
`scripts/check-codegen.ps1` enforces this in CI (it force-regenerates and fails on any
|
||||
`git diff` against the committed `Generated/`) — that regeneration diff in the `portable`
|
||||
job is the primary guard. The SSH-driven `windows-x86` job's net48 worker build is the
|
||||
secondary guard (a stale `Generated/` also breaks the x86 build with `CS0246`).
|
||||
secondary guard (a stale `Generated/` also breaks the x86 build with `CS0246`). The same
|
||||
script runs four checks in total: the committed client descriptor set (Check 1), the C#
|
||||
`Generated/` (Check 2), the Rust vendored protos (Check 3), and the Go/Python client bindings
|
||||
(Check 4) each regenerate and fail on any diff. See
|
||||
[Client Proto Generation](./ClientProtoGeneration.md) for the pinned generator versions.
|
||||
|
||||
Client generation inputs are published through
|
||||
`clients/proto/proto-inputs.json` and the descriptor set under
|
||||
|
||||
+15
-8
@@ -428,10 +428,13 @@ runtime because the x86 Worker cannot build on Linux:
|
||||
gateway fake-worker tests, and builds/tests the clients that run on Linux: .NET client
|
||||
build, Go (`gofmt` + `go build` + `go test`), Rust (`cargo fmt --check` + `cargo test`
|
||||
+ `cargo clippy -D warnings`), and Python (`pytest`).
|
||||
- **`java`** (Linux, JDK 17) — `gradle test`. The protobuf gradle plugin rewrites
|
||||
`MxaccessGateway.java` with spurious protobuf-runtime-version churn on every build, so
|
||||
when no `.proto` changed the job reverts that one file (`git checkout`) before asserting
|
||||
the generated tree is clean. The dev Mac has no JRE, so Java verification is CI-only.
|
||||
- **`java`** (Linux, JDK 17) — `gradle test`, then `git diff --exit-code` over the generated
|
||||
tree. The grpc/protobuf toolchain is pinned (`clients/java/build.gradle`), so a regeneration
|
||||
is byte-identical to the committed single-file aggregates modulo real `.proto` changes; the
|
||||
git-diff is therefore a true drift gate that now catches message-level proto drift in the Java
|
||||
client (IPC-24 deleted the old unconditional churn-revert step, which masked exactly that
|
||||
class). The dev Mac has a Homebrew JDK 17, so `gradle generateProto` can be run there to refresh
|
||||
the Java aggregates when a `.proto` changes.
|
||||
- **`windows-x86`** (Linux runner, per push/PR) — builds the **x86 / net48 Worker and
|
||||
Worker.Tests**, which are Windows-only and out of scope for the Linux jobs. It runs on a
|
||||
Linux runner that always schedules and SSHes to windev (`10.100.0.48`), where
|
||||
@@ -449,10 +452,14 @@ runtime because the x86 Worker cannot build on Linux:
|
||||
`xUnit1030`). Gated `if: github.event_name == 'schedule'`, so it never gates a push. On
|
||||
failure it opens a Gitea issue via the Actions token, since nobody watches the Actions page.
|
||||
|
||||
The freshness guard `scripts/check-codegen.ps1` fails the build when the committed
|
||||
client descriptor set or the C# `Generated/` no longer matches the current `.proto`
|
||||
sources — the codegen drift class this repo has hit repeatedly (stale client
|
||||
descriptors, net48 `CS0246` on unregenerated protos). The **primary** guard for the
|
||||
The freshness guard `scripts/check-codegen.ps1` runs four checks and fails the build when the
|
||||
committed client descriptor set (Check 1), the C# `Generated/` (Check 2), the Rust vendored
|
||||
protos (Check 3), or the Go/Python client bindings (Check 4, IPC-25) no longer match the current
|
||||
`.proto` sources — the codegen drift class this repo has hit repeatedly (stale client
|
||||
descriptors, net48 `CS0246` on unregenerated protos, silently stale Go/Python worker bindings).
|
||||
Check 4 regenerates the Go and Python bindings with their pinned generators (`protoc-gen-go`
|
||||
v1.36.11 / `protoc-gen-go-grpc` 1.6.2, `grpcio-tools` 1.80.0) and fails on any diff; a missing
|
||||
generator fails the check rather than skipping it. The **primary** guard for the
|
||||
"regenerate and commit `Generated/`" rule is that regeneration diff in the `portable` job;
|
||||
the `windows-x86` net48 compile is the **secondary** guard (a stale `Generated/` also breaks
|
||||
the x86 build with `CS0246`). See [Client Proto Generation](./ClientProtoGeneration.md) and
|
||||
|
||||
Reference in New Issue
Block a user