Skip to content

test: swap the stream sample for Brook's Stream service WIT - #308

Merged
tconley1428 merged 1 commit into
mainfrom
moe/up/brook-wits
Oct 29, 2026
Merged

tconley1428 merged 1 commit into
mainfrom
moe/up/brook-wits

Conversation

@moetemp

@moetemp moetemp commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

This PR replaces the stream sample with Brook's Stream service WIT, in the largest form that nexgen generates today.

  • Its records bind to the Stream protos of temporalio/api#895 at 44519d8a. No SDK has those protos, so the sample projects hold their bindings, in python/streamprotos/, dotnet/proto/streams/ and typescript/proto/streams.d.ts.
  • nexgen refuses some of Brook's constructs, such as a @nexus.source with a target, field flattening and a resource type parameter. Each one takes its nearest form that generates, and the moetemp/nexgen PR that adds the feature brings back Brook's form. nexgen ignores the directives that it doesn't know yet.
  • The sample is a System Nexus service, as in Brook. Its .NET output takes the Temporalio.Workflows namespace, which workflow-service already has, so it builds in its own Nexgen.DotNetStreamService.csproj. The .NET tests refer to it through an extern alias.
  • The TypeScript sample pins long to 5.3.2, the long that the @temporalio/* packages resolve.
  • Only .NET generates the service. Python and TypeScript panic on the read item, so typescript/tests/stream-service.test.ts goes away here, and fix: plan a oneof case that names a proto-bound record as that record #310 brings it back.

Why?

The stream sample should be Brook's input, so each later PR shows its change on Brook's file.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

cargo build-examples regenerates the samples with a clean tree, and the .NET tests round-trip a Stream. The README's rebuild steps give the checked-in streams.bin and bindings.

@moetemp
moetemp requested a review from a team as a code owner October 27, 2026 08:35
@moetemp
moetemp marked this pull request as draft October 27, 2026 16:33
@moetemp moetemp changed the title Added Brook's Stream service and writer WIT as samples. test: swap the stream samples for Brook's Stream service and writer WIT Oct 27, 2026
@moetemp
moetemp force-pushed the moe/up/brook-wits branch 2 times, most recently from ed43cd1 to d212587 Compare October 28, 2026 16:37
@moetemp
moetemp marked this pull request as ready for review October 28, 2026 23:02
@moetemp moetemp changed the title test: swap the stream samples for Brook's Stream service and writer WIT test: swap the stream sample for Brook's Stream service WIT Oct 29, 2026
@moetemp
moetemp force-pushed the moe/up/brook-wits branch 4 times, most recently from 98c9e47 to ef11a26 Compare October 29, 2026 07:35
The sample takes the part of Brook's WIT that nexgen generates, on the Stream protos of
temporalio/api#895 at 44519d8a. No SDK has those protos, so the sample projects hold their
bindings. The sample is a System Nexus service, so its .NET output builds in its own project. Only
.NET generates the service, since Python and TypeScript panic on the read item's oneof.
@tconley1428
tconley1428 merged commit 80c0bf5 into main Oct 29, 2026
5 checks passed
@tconley1428
tconley1428 deleted the moe/up/brook-wits branch October 29, 2026 16:34
moetemp added a commit that referenced this pull request Oct 29, 2026
…#310)

### 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.

- Only oneof-bound variants get the new plan, and an `option` around the payload stays.
- A .NET case record names its payload's model in full. Else a case named like its record hides the model, and `record Superseded(Superseded Value)` doesn't compile. Brook's next WIT names a case like that.
- The first commit is the fix, and the stream sample's TypeScript output appears with it. The second commit generates the stream service for Python, with basedpyright off for it until #311. `tsc` skips the service until #296.

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 -
- [x] 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.


Co-authored-by: Tim Conley <timothy.conley@temporal.io>
chrsmith added a commit that referenced this pull request Nov 3, 2026
The stream service sample project (added on main in #308) targeted
net8.0, so the sample tests, which now also target net7.0, could not
restore its project reference (NU1201).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tconley1428 pushed a commit that referenced this pull request Nov 3, 2026
* Lower .NET platform requirement to .NET 7, document backwards compatibility

* Target net7.0 in the .NET stream service sample project

The stream service sample project (added on main in #308) targeted
net8.0, so the sample tests, which now also target net7.0, could not
restore its project reference (NU1201).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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