Skip to content

fix: plan a oneof case that names a proto-bound record as that record - #310

Merged
moetemp merged 2 commits into
mainfrom
moe/up/oneof-record-case
Oct 29, 2026
Merged

moetemp merged 2 commits into
mainfrom
moe/up/oneof-record-case

Conversation

@moetemp

@moetemp moetemp commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

This PR plans a protobuf oneof case that names a proto-bound WIT record as that record, as nexgen already does for a record field.

In the stream sample's .NET output, the read item now holds the records, not the proto classes.

It's based on #308.

Why?

Brook's read item, variant stream-item, binds a oneof of three proto-bound records. Before the fix, Python and TypeScript generation panicked on it, and .NET typed each case as the proto class.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

New TypeScript and .NET tests round-trip the read item's cases, and the .NET test leaves out the data case. A unit test covers the full name of a case payload.

@moetemp
moetemp force-pushed the moe/up/oneof-record-case branch from 8069188 to 4c71190 Compare October 27, 2026 18:35
@moetemp
moetemp force-pushed the moe/up/oneof-record-case branch 2 times, most recently from 93197c3 to f2210ce Compare October 28, 2026 16:37
@moetemp moetemp changed the title fix: plan a oneof case that names a proto-bound record as that record fix: plan a oneof case that names a proto-bound record or enum as that type Oct 28, 2026
@moetemp
moetemp changed the base branch from main to moe/up/brook-wits October 28, 2026 22:57
@moetemp
moetemp marked this pull request as ready for review October 28, 2026 23:34
@moetemp
moetemp requested a review from a team as a code owner October 28, 2026 23:35
@moetemp
moetemp force-pushed the moe/up/oneof-record-case branch from f2210ce to 7d98eab Compare October 28, 2026 23:59
@moetemp moetemp changed the title fix: plan a oneof case that names a proto-bound record or enum as that type fix: plan a oneof case that names a proto-bound record as that record Oct 29, 2026
@moetemp
moetemp force-pushed the moe/up/oneof-record-case branch from 7d98eab to a892bd7 Compare October 29, 2026 00:53
@moetemp
moetemp force-pushed the moe/up/brook-wits branch 2 times, most recently from 2dc6f65 to accc4c0 Compare October 29, 2026 06:28
@moetemp
moetemp force-pushed the moe/up/oneof-record-case branch from a892bd7 to 5ae1c19 Compare October 29, 2026 06:28
@moetemp
moetemp force-pushed the moe/up/oneof-record-case branch from 5ae1c19 to 2f6b64b Compare October 29, 2026 07:00
@moetemp
moetemp force-pushed the moe/up/oneof-record-case branch from 2f6b64b to 4391281 Compare October 29, 2026 07:35
@moetemp
moetemp force-pushed the moe/up/oneof-record-case branch from 4391281 to 3ff91ac Compare October 29, 2026 09:29
Base automatically changed from moe/up/brook-wits to main October 29, 2026 16:34
Variant planning kept such a case as the raw proto message. Python and TypeScript then panicked
on a message conversion that wasn't model-shaped, and .NET typed the case as the proto class.
The case plans as the record, as a record field does. A .NET case record names its payload's
model in full, since it hides a model of its own name. Brook's stream service generates for
TypeScript, and its .NET read item holds the records.
nexgen maps every temporal/... proto to a temporalio module. The Stream protos aren't in
temporalio yet, so the service's imports don't resolve, and basedpyright skips it.
@moetemp
moetemp force-pushed the moe/up/oneof-record-case branch from 3ff91ac to 54da5a5 Compare October 29, 2026 17:03
@moetemp
moetemp enabled auto-merge (squash) October 29, 2026 17:07
@moetemp
moetemp disabled auto-merge October 29, 2026 17:12
@moetemp
moetemp enabled auto-merge (squash) October 29, 2026 17:13
@moetemp
moetemp disabled auto-merge October 29, 2026 17:13
@moetemp
moetemp merged commit f4a3fb4 into main Oct 29, 2026
5 checks passed
@moetemp
moetemp deleted the moe/up/oneof-record-case branch October 29, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants