Skip to content

Steps nest in their pipeline message; the steps list is gone - #95

Merged
dangra merged 3 commits into
masterfrom
nested-steps
Sep 16, 2026
Merged

dangra merged 3 commits into
masterfrom
nested-steps

Conversation

@dangra

@dangra dangra commented Sep 15, 2026

Copy link
Copy Markdown
Owner

A pipeline is a top-level message with the pipeline option; its steps are the messages nested directly in it, in declaration order, which is the topology:

message ProvisionMachine {
  option (durable.v1.pipeline) = {id: "provision-machine" input: "..." output: "..."};

  message SelectHost      { option (durable.v1.step) = {id: "select-host/v1"}; string host_id = 1; }
  message ReserveCapacity { option (durable.v1.step) = {id: "reserve-capacity/v1" unwind: true}; string reservation_id = 1; }
  message CreateMachine   { option (durable.v1.step) = {id: "create-machine/v1"}; string machine_id = 1; }
}
  • Nothing lists a step twice: inserting, reordering, or retiring a step is one edit, and the "declared but not listed / listed but not found / typo in the full name" errors cannot happen.
  • A step belongs to one pipeline by construction; two pipelines in a package may name their steps alike.
  • The step's Go type is protoc-gen-go's nested name, Pipeline_Step (*machinespb.ProvisionMachine_SelectHost, machinespb.ProvisionMachine_SelectHostStep); the handler method stays the short name. Input and output remain referenced top-level messages, since callers hold those types.
  • Generation rejects a step outside a pipeline or nested deeper than directly in one, a non-step message nested in a pipeline, and a pipeline that is not top-level.
  • PipelineOptions.steps is removed.

Examples, README (this includes #94's rewrite), tour, and spec 02 and 05 are in the nested form. Breaking for every proto: move the step messages inside the pipeline and drop the list; regenerate; rename state types to Pipeline_Step.

The wiring snippet had a stray paren from the last edit and the prose
still promised per-step Func adapters. The example now shows the
pipeline interface end to end — select, reserve with its unwind,
create with a permanent failure, reduce — then wiring, the three ways
a Wait ends, restart, and testing.
A pipeline is a top-level message with the pipeline option; its steps
are the messages nested directly in it, in declaration order, which is
the topology. Nothing lists a step twice, a step belongs to one
pipeline by construction, and two pipelines in a package may name their
steps alike. The step's Go type is protoc-gen-go's nested name,
Pipeline_Step; its handler method is the short name. Generation rejects
a step outside a pipeline, a non-step nested in one, or a pipeline
that is not top-level. PipelineOptions loses its steps field.

Examples, README, tour, and spec 02 and 05 rewritten to the nested
form; the flyd stop port follows on its branch.
Copilot AI lite review requested due to automatic review settings September 15, 2026 02:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dangra
dangra merged commit e314a88 into master Sep 16, 2026
7 checks passed
@dangra
dangra deleted the nested-steps branch September 16, 2026 13:32
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