feat(workflow): add ActionsService proto for action state APIs#6899
feat(workflow): add ActionsService proto for action state APIs#6899
Conversation
Introduce a new flyteidl2/workflow/actions_service.proto that defines an ActionsService consolidating state and queue functionality for actions. Add RPCs to update and retrieve action state (UpdateActionStatus, GetActionState), plus EnqueueAction, AbortQueuedAction, and Watch to support queuing and observation. Define request/response messages for UpdateActionStatus and GetActionState, including validation rules and fields for action identifiers, attempt number, status, and serialized NodeStatus state. This centralizes action state/queue operations into a single service intended to replace parts of the existing StateService and QueueService, simplifies APIs for workers, and provides at-least-once semantics for state watches. Signed-off-by: Sergey Vilgelm <sergey@union.ai>
Add generated gRPC Python client and server classes for the new ActionsService. The stub implements client-side unary and streaming callables for UpdateActionStatus, GetActionState, EnqueueAction, AbortQueuedAction, and Watch, wired to the corresponding protobuf serializers/deserializers. The servicer adds unimplemented handler methods with descriptive docstrings and returns UNIMPLEMENTED status by default. This brings together functionality previously split across StateService and QueueService into a single ActionsService surface, preparing the codebase for server-side implementations and client usage. Signed-off-by: Sergey Vilgelm <sergey@union.ai>
There was a problem hiding this comment.
Pull request overview
Adds a new ActionsService protobuf definition to centralize action state + queue operations, and checks in regenerated client/server stubs across Go (gRPC + Connect + mocks), Python (grpc), and TS (buf/protoc-gen-es), along with associated lint/config updates.
Changes:
- Introduced
flyteidl2/workflow/actions_service.protodefining theActionsServiceRPCs plus request/response messages for status/state APIs. - Generated/updated language bindings and supporting artifacts (Go gRPC + Connect, Python gRPC stubs/types, TS protobuf descriptors, Swagger).
- Updated
buf.yamllint ignores and refreshedgen/rust/Cargo.lockdue to regeneration.
Reviewed changes
Copilot reviewed 18 out of 21 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| gen/ts/flyteidl2/workflow/actions_service_pb.ts | New generated TS descriptors/types for ActionsService. |
| gen/rust/Cargo.lock | Regenerated lockfile with dependency checksum/version updates. |
| gen/python/flyteidl2/workflow/actions_service_pb2_grpc.py | New generated Python gRPC client/server stubs for ActionsService. |
| gen/python/flyteidl2/workflow/actions_service_pb2.pyi | New generated Python type stubs for ActionsService messages. |
| gen/python/flyteidl2/workflow/actions_service_pb2.py | New generated Python protobuf message/module definitions. |
| gen/go/gateway/flyteidl2/workflow/actions_service.swagger.json | New generated swagger artifact for the proto (no REST paths declared). |
| gen/go/flyteidl2/workflow/workflowconnect/mocks/actions_service_handler.go | New generated Connect handler mock for ActionsService. |
| gen/go/flyteidl2/workflow/workflowconnect/mocks/actions_service_client.go | New generated Connect client mock for ActionsService. |
| gen/go/flyteidl2/workflow/workflowconnect/actions_service.connect.go | New generated Connect client/handler for ActionsService. |
| gen/go/flyteidl2/workflow/mocks/unsafe_actions_service_server.go | New generated gRPC “unsafe” server mock helper. |
| gen/go/flyteidl2/workflow/mocks/actions_service_watch_server.go | New generated gRPC Watch server-stream mock. |
| gen/go/flyteidl2/workflow/mocks/actions_service_watch_client.go | New generated gRPC Watch client-stream mock. |
| gen/go/flyteidl2/workflow/mocks/actions_service_server.go | New generated gRPC server mock. |
| gen/go/flyteidl2/workflow/mocks/actions_service_client.go | New generated gRPC client mock. |
| gen/go/flyteidl2/workflow/actions_service_grpc.pb.go | New generated Go gRPC service interfaces/handlers. |
| gen/go/flyteidl2/workflow/actions_service.pb.validate.go | New generated Go validation helpers for the new messages. |
| gen/go/flyteidl2/workflow/actions_service.pb.go | New generated Go protobuf messages + file descriptor for the proto. |
| flyteidl2/workflow/actions_service.proto | New source-of-truth proto defining ActionsService. |
| buf.yaml | Adds lint ignore entries related to request/response uniqueness for the new service and related workflow protos. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add buf.validate rule to require attempt > 0 for action request and response in actions_service.proto. This enforces that action attempts start from 1 and prevents zero-valued attempts from being accepted. - Regenerate Go protobuf bindings (actions_service.pb.go) to reflect the added validation annotations and updated descriptor bytes. Signed-off-by: Sergey Vilgelm <sergey@union.ai>
| // UpdateActionStatus updates the status of an action and saves serialized NodeStatus. | ||
| // This deprecates Put in the current StateService. | ||
| rpc UpdateActionStatus(UpdateActionStatusRequest) returns (UpdateActionStatusResponse) {} | ||
|
|
||
| // GetActionState returns the `NodeStatus` of an action. | ||
| // This deprecates Get in the current StateService. | ||
| rpc GetActionState(GetActionStateRequest) returns (GetActionStateResponse) {} | ||
|
|
||
| // EnqueueAction queues a new action for execution. | ||
| rpc EnqueueAction(flyteidl2.workflow.EnqueueActionRequest) returns (flyteidl2.workflow.EnqueueActionResponse) {} | ||
|
|
||
| // AbortQueuedAction aborts a single action that was previously queued or is currently being processed by a worker. | ||
| // Note that this will cascade aborts to all descendant actions of the specified action. | ||
| rpc AbortQueuedAction(flyteidl2.workflow.AbortQueuedActionRequest) returns (flyteidl2.workflow.AbortQueuedActionResponse) {} | ||
|
|
||
| // Watch watches for updates to the state of actions. | ||
| // This API guarantees at-least-once delivery semantics. | ||
| rpc Watch(flyteidl2.workflow.WatchRequest) returns (stream flyteidl2.workflow.WatchResponse) {} |
There was a problem hiding this comment.
The naming doesn't feel clean. I understand we may be doing this for backward compatibility? but I would rather build something that can reduce the mental overhead of understanding it..
What is Watch watching? actions? does it have anything to do with the "GetActionState"?
Mentally I think the ActionService is CRUD for actions, right? So I expect "Create/Get/Update/Delete" or maybe "Enqueue/Watch/Update/Abort" work too... but let's keep them consistent (EnqueueAction/WatchAction/UpdateAction/AbortAction work too)... The only exception to this that doesn't fit seems to be the "GetActionState" part, is that correct? Let's make it verbose then "GetLatestActionState" or maybe we add a "GetAction" API that has a flag whether to return the state inside or not (or always return the state)
wild-endeavor
left a comment
There was a problem hiding this comment.
+1 from me. let's check in with haytham though
Rename several RPCs and corresponding request/response messages to simplify the ActionsService API and provide clearer, shorter names. - Rename EnqueueAction -> Enqueue for queueing new actions. - Rename Watch -> WatchForUpdates to clarify streaming semantics. - Rename UpdateActionStatus -> Update and its request/response types to UpdateRequest/UpdateResponse. - Rename GetActionState -> GetLatestState and its request/response types to GetLatestStateRequest/GetLatestStateResponse. - Rename AbortQueuedAction -> Abort while keeping the original abort request/response payload types. - Update comments to match the new names and keep deprecation notes. These changes make the service surface more concise and consistent, improving readability and aligning RPC names with their intent. Signed-off-by: Sergey Vilgelm <sergey@union.ai>
Rename ActionsService RPC constants, method descriptors, and client interface methods to align with new RPC names and clearer intent. - Change procedure names: Enqueue, GetLatestState, WatchForUpdates, Update, Abort. - Update protoreflect method descriptor variable names to match the new RPCs. - Replace deprecated/old method names (UpdateActionStatus, GetActionState, EnqueueAction, AbortQueuedAction, Watch) with the new, concise names and update associated comments. This clarifies API semantics and keeps generated code consistent with the updated .proto service definitions. Signed-off-by: Sergey Vilgelm <sergey@union.ai>
ee43eca to
8d09c1c
Compare
What changed
Why