Skip to content

Commit

Permalink
Update core/dependencies and call worker.validate (#541)
Browse files Browse the repository at this point in the history
Fixes #520
Fixes #532
  • Loading branch information
cretz authored Jun 4, 2024
1 parent 365cead commit 2061835
Show file tree
Hide file tree
Showing 68 changed files with 7,991 additions and 1,388 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
poetry add "protobuf<4"
poe gen-protos
poe format
[[ -z $(git status --porcelain temporalio) ]] || (git diff; echo "Protos changed"; exit 1)
[[ -z $(git status --porcelain temporalio) ]] || (git diff temporalio; echo "Protos changed"; exit 1)
poe test -s -o log_cli_level=DEBUG
# Do docs stuff (only on one host)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1477,10 +1477,10 @@ to `1` prior to running tests.
Do not commit `poetry.lock` or `pyproject.toml` changes. To go back from this downgrade, restore `pyproject.toml` and
run `poetry update protobuf grpcio-tools`.

For a less system-intrusive approach, you can:
For a less system-intrusive approach, you can (note this approach [may have a bug](https://github.com/temporalio/sdk-python/issues/543)):
```shell
docker build -f scripts/_proto/Dockerfile .
docker run -v "${PWD}/temporalio/api:/api_new" -v "${PWD}/temporalio/bridge/proto:/bridge_new" <just built image sha>
docker run --rm -v "${PWD}/temporalio/api:/api_new" -v "${PWD}/temporalio/bridge/proto:/bridge_new" <just built image sha>
poe format
```

Expand Down
4 changes: 4 additions & 0 deletions temporalio/api/command/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
RecordMarkerCommandAttributes,
RequestCancelActivityTaskCommandAttributes,
RequestCancelExternalWorkflowExecutionCommandAttributes,
RequestCancelNexusOperationCommandAttributes,
ScheduleActivityTaskCommandAttributes,
ScheduleNexusOperationCommandAttributes,
SignalExternalWorkflowExecutionCommandAttributes,
StartChildWorkflowExecutionCommandAttributes,
StartTimerCommandAttributes,
Expand All @@ -29,7 +31,9 @@
"RecordMarkerCommandAttributes",
"RequestCancelActivityTaskCommandAttributes",
"RequestCancelExternalWorkflowExecutionCommandAttributes",
"RequestCancelNexusOperationCommandAttributes",
"ScheduleActivityTaskCommandAttributes",
"ScheduleNexusOperationCommandAttributes",
"SignalExternalWorkflowExecutionCommandAttributes",
"StartChildWorkflowExecutionCommandAttributes",
"StartTimerCommandAttributes",
Expand Down
119 changes: 85 additions & 34 deletions temporalio/api/command/v1/message_pb2.py

Large diffs are not rendered by default.

188 changes: 165 additions & 23 deletions temporalio/api/command/v1/message_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ScheduleActivityTaskCommandAttributes(google.protobuf.message.Message):
HEARTBEAT_TIMEOUT_FIELD_NUMBER: builtins.int
RETRY_POLICY_FIELD_NUMBER: builtins.int
REQUEST_EAGER_EXECUTION_FIELD_NUMBER: builtins.int
USE_COMPATIBLE_VERSION_FIELD_NUMBER: builtins.int
USE_WORKFLOW_BUILD_ID_FIELD_NUMBER: builtins.int
activity_id: builtins.str
@property
def activity_type(self) -> temporalio.api.common.v1.message_pb2.ActivityType: ...
Expand Down Expand Up @@ -111,10 +111,9 @@ class ScheduleActivityTaskCommandAttributes(google.protobuf.message.Message):
"""Request to start the activity directly bypassing matching service and worker polling
The slot for executing the activity should be reserved when setting this field to true.
"""
use_compatible_version: builtins.bool
"""If this is set, the workflow executing this command wishes to start the activity using
a version compatible with the version that this workflow most recently ran on, if such
behavior is possible.
use_workflow_build_id: builtins.bool
"""If this is set, the activity would be assigned to the Build ID of the workflow. Otherwise,
Assignment rules of the activity's Task Queue will be used to determine the Build ID.
"""
def __init__(
self,
Expand All @@ -130,7 +129,7 @@ class ScheduleActivityTaskCommandAttributes(google.protobuf.message.Message):
heartbeat_timeout: google.protobuf.duration_pb2.Duration | None = ...,
retry_policy: temporalio.api.common.v1.message_pb2.RetryPolicy | None = ...,
request_eager_execution: builtins.bool = ...,
use_compatible_version: builtins.bool = ...,
use_workflow_build_id: builtins.bool = ...,
) -> None: ...
def HasField(
self,
Expand Down Expand Up @@ -180,8 +179,8 @@ class ScheduleActivityTaskCommandAttributes(google.protobuf.message.Message):
b"start_to_close_timeout",
"task_queue",
b"task_queue",
"use_compatible_version",
b"use_compatible_version",
"use_workflow_build_id",
b"use_workflow_build_id",
],
) -> None: ...

Expand Down Expand Up @@ -600,7 +599,7 @@ class ContinueAsNewWorkflowExecutionCommandAttributes(google.protobuf.message.Me
HEADER_FIELD_NUMBER: builtins.int
MEMO_FIELD_NUMBER: builtins.int
SEARCH_ATTRIBUTES_FIELD_NUMBER: builtins.int
USE_COMPATIBLE_VERSION_FIELD_NUMBER: builtins.int
INHERIT_BUILD_ID_FIELD_NUMBER: builtins.int
@property
def workflow_type(self) -> temporalio.api.common.v1.message_pb2.WorkflowType: ...
@property
Expand Down Expand Up @@ -636,9 +635,9 @@ class ContinueAsNewWorkflowExecutionCommandAttributes(google.protobuf.message.Me
def search_attributes(
self,
) -> temporalio.api.common.v1.message_pb2.SearchAttributes: ...
use_compatible_version: builtins.bool
"""If this is set, the workflow executing this command wishes to continue as new using a version
compatible with the version that this workflow most recently ran on.
inherit_build_id: builtins.bool
"""If this is set, the new execution inherits the Build ID of the current execution. Otherwise,
the assignment rules will be used to independently assign a Build ID to the new execution.
"""
def __init__(
self,
Expand All @@ -659,7 +658,7 @@ class ContinueAsNewWorkflowExecutionCommandAttributes(google.protobuf.message.Me
memo: temporalio.api.common.v1.message_pb2.Memo | None = ...,
search_attributes: temporalio.api.common.v1.message_pb2.SearchAttributes
| None = ...,
use_compatible_version: builtins.bool = ...,
inherit_build_id: builtins.bool = ...,
) -> None: ...
def HasField(
self,
Expand Down Expand Up @@ -701,6 +700,8 @@ class ContinueAsNewWorkflowExecutionCommandAttributes(google.protobuf.message.Me
b"failure",
"header",
b"header",
"inherit_build_id",
b"inherit_build_id",
"initiator",
b"initiator",
"input",
Expand All @@ -715,8 +716,6 @@ class ContinueAsNewWorkflowExecutionCommandAttributes(google.protobuf.message.Me
b"search_attributes",
"task_queue",
b"task_queue",
"use_compatible_version",
b"use_compatible_version",
"workflow_run_timeout",
b"workflow_run_timeout",
"workflow_task_timeout",
Expand Down Expand Up @@ -749,7 +748,7 @@ class StartChildWorkflowExecutionCommandAttributes(google.protobuf.message.Messa
HEADER_FIELD_NUMBER: builtins.int
MEMO_FIELD_NUMBER: builtins.int
SEARCH_ATTRIBUTES_FIELD_NUMBER: builtins.int
USE_COMPATIBLE_VERSION_FIELD_NUMBER: builtins.int
INHERIT_BUILD_ID_FIELD_NUMBER: builtins.int
namespace: builtins.str
workflow_id: builtins.str
@property
Expand Down Expand Up @@ -784,10 +783,9 @@ class StartChildWorkflowExecutionCommandAttributes(google.protobuf.message.Messa
def search_attributes(
self,
) -> temporalio.api.common.v1.message_pb2.SearchAttributes: ...
use_compatible_version: builtins.bool
"""If this is set, the workflow executing this command wishes to start the child workflow using
a version compatible with the version that this workflow most recently ran on, if such
behavior is possible.
inherit_build_id: builtins.bool
"""If this is set, the child workflow inherits the Build ID of the parent. Otherwise, the assignment
rules of the child's Task Queue will be used to independently assign a Build ID to it.
"""
def __init__(
self,
Expand All @@ -809,7 +807,7 @@ class StartChildWorkflowExecutionCommandAttributes(google.protobuf.message.Messa
memo: temporalio.api.common.v1.message_pb2.Memo | None = ...,
search_attributes: temporalio.api.common.v1.message_pb2.SearchAttributes
| None = ...,
use_compatible_version: builtins.bool = ...,
inherit_build_id: builtins.bool = ...,
) -> None: ...
def HasField(
self,
Expand Down Expand Up @@ -845,6 +843,8 @@ class StartChildWorkflowExecutionCommandAttributes(google.protobuf.message.Messa
b"cron_schedule",
"header",
b"header",
"inherit_build_id",
b"inherit_build_id",
"input",
b"input",
"memo",
Expand All @@ -859,8 +859,6 @@ class StartChildWorkflowExecutionCommandAttributes(google.protobuf.message.Messa
b"search_attributes",
"task_queue",
b"task_queue",
"use_compatible_version",
b"use_compatible_version",
"workflow_execution_timeout",
b"workflow_execution_timeout",
"workflow_id",
Expand Down Expand Up @@ -897,6 +895,126 @@ class ProtocolMessageCommandAttributes(google.protobuf.message.Message):

global___ProtocolMessageCommandAttributes = ProtocolMessageCommandAttributes

class ScheduleNexusOperationCommandAttributes(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

class NexusHeaderEntry(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

KEY_FIELD_NUMBER: builtins.int
VALUE_FIELD_NUMBER: builtins.int
key: builtins.str
value: builtins.str
def __init__(
self,
*,
key: builtins.str = ...,
value: builtins.str = ...,
) -> None: ...
def ClearField(
self,
field_name: typing_extensions.Literal["key", b"key", "value", b"value"],
) -> None: ...

ENDPOINT_FIELD_NUMBER: builtins.int
SERVICE_FIELD_NUMBER: builtins.int
OPERATION_FIELD_NUMBER: builtins.int
INPUT_FIELD_NUMBER: builtins.int
SCHEDULE_TO_CLOSE_TIMEOUT_FIELD_NUMBER: builtins.int
NEXUS_HEADER_FIELD_NUMBER: builtins.int
endpoint: builtins.str
"""Endpoint name, must exist in the endpoint registry or this command will fail."""
service: builtins.str
"""Service name."""
operation: builtins.str
"""Operation name."""
@property
def input(self) -> temporalio.api.common.v1.message_pb2.Payload:
"""Input for the operation. The server converts this into Nexus request content and the appropriate content headers
internally when sending the StartOperation request. On the handler side, if it is also backed by Temporal, the
content is transformed back to the original Payload sent in this command.
"""
@property
def schedule_to_close_timeout(self) -> google.protobuf.duration_pb2.Duration:
"""Schedule-to-close timeout for this operation.
Indicates how long the caller is willing to wait for operation completion.
Calls are retried internally by the server.
(-- api-linter: core::0140::prepositions=disabled
aip.dev/not-precedent: "to" is used to indicate interval. --)
"""
@property
def nexus_header(
self,
) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]:
"""Header to attach to the Nexus request.
Users are responsible for encrypting sensitive data in this header as it is stored in workflow history and
transmitted to external services as-is.
This is useful for propagating tracing information.
Note these headers are not the same as Temporal headers on internal activities and child workflows, these are
transmitted to Nexus operations that may be external and are not traditional payloads.
"""
def __init__(
self,
*,
endpoint: builtins.str = ...,
service: builtins.str = ...,
operation: builtins.str = ...,
input: temporalio.api.common.v1.message_pb2.Payload | None = ...,
schedule_to_close_timeout: google.protobuf.duration_pb2.Duration | None = ...,
nexus_header: collections.abc.Mapping[builtins.str, builtins.str] | None = ...,
) -> None: ...
def HasField(
self,
field_name: typing_extensions.Literal[
"input", b"input", "schedule_to_close_timeout", b"schedule_to_close_timeout"
],
) -> builtins.bool: ...
def ClearField(
self,
field_name: typing_extensions.Literal[
"endpoint",
b"endpoint",
"input",
b"input",
"nexus_header",
b"nexus_header",
"operation",
b"operation",
"schedule_to_close_timeout",
b"schedule_to_close_timeout",
"service",
b"service",
],
) -> None: ...

global___ScheduleNexusOperationCommandAttributes = (
ScheduleNexusOperationCommandAttributes
)

class RequestCancelNexusOperationCommandAttributes(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

SCHEDULED_EVENT_ID_FIELD_NUMBER: builtins.int
scheduled_event_id: builtins.int
"""The `NEXUS_OPERATION_SCHEDULED` event ID (a unique identifier) for the operation to be canceled.
The operation may ignore cancellation and end up with any completion state.
"""
def __init__(
self,
*,
scheduled_event_id: builtins.int = ...,
) -> None: ...
def ClearField(
self,
field_name: typing_extensions.Literal[
"scheduled_event_id", b"scheduled_event_id"
],
) -> None: ...

global___RequestCancelNexusOperationCommandAttributes = (
RequestCancelNexusOperationCommandAttributes
)

class Command(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

Expand All @@ -916,6 +1034,8 @@ class Command(google.protobuf.message.Message):
UPSERT_WORKFLOW_SEARCH_ATTRIBUTES_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
PROTOCOL_MESSAGE_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
MODIFY_WORKFLOW_PROPERTIES_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
SCHEDULE_NEXUS_OPERATION_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
REQUEST_CANCEL_NEXUS_OPERATION_COMMAND_ATTRIBUTES_FIELD_NUMBER: builtins.int
command_type: temporalio.api.enums.v1.command_type_pb2.CommandType.ValueType
@property
def schedule_activity_task_command_attributes(
Expand Down Expand Up @@ -978,6 +1098,14 @@ class Command(google.protobuf.message.Message):
self,
) -> global___ModifyWorkflowPropertiesCommandAttributes:
"""16 is available for use - it was used as part of a prototype that never made it into a release"""
@property
def schedule_nexus_operation_command_attributes(
self,
) -> global___ScheduleNexusOperationCommandAttributes: ...
@property
def request_cancel_nexus_operation_command_attributes(
self,
) -> global___RequestCancelNexusOperationCommandAttributes: ...
def __init__(
self,
*,
Expand Down Expand Up @@ -1012,6 +1140,10 @@ class Command(google.protobuf.message.Message):
| None = ...,
modify_workflow_properties_command_attributes: global___ModifyWorkflowPropertiesCommandAttributes
| None = ...,
schedule_nexus_operation_command_attributes: global___ScheduleNexusOperationCommandAttributes
| None = ...,
request_cancel_nexus_operation_command_attributes: global___RequestCancelNexusOperationCommandAttributes
| None = ...,
) -> None: ...
def HasField(
self,
Expand All @@ -1038,8 +1170,12 @@ class Command(google.protobuf.message.Message):
b"request_cancel_activity_task_command_attributes",
"request_cancel_external_workflow_execution_command_attributes",
b"request_cancel_external_workflow_execution_command_attributes",
"request_cancel_nexus_operation_command_attributes",
b"request_cancel_nexus_operation_command_attributes",
"schedule_activity_task_command_attributes",
b"schedule_activity_task_command_attributes",
"schedule_nexus_operation_command_attributes",
b"schedule_nexus_operation_command_attributes",
"signal_external_workflow_execution_command_attributes",
b"signal_external_workflow_execution_command_attributes",
"start_child_workflow_execution_command_attributes",
Expand Down Expand Up @@ -1077,8 +1213,12 @@ class Command(google.protobuf.message.Message):
b"request_cancel_activity_task_command_attributes",
"request_cancel_external_workflow_execution_command_attributes",
b"request_cancel_external_workflow_execution_command_attributes",
"request_cancel_nexus_operation_command_attributes",
b"request_cancel_nexus_operation_command_attributes",
"schedule_activity_task_command_attributes",
b"schedule_activity_task_command_attributes",
"schedule_nexus_operation_command_attributes",
b"schedule_nexus_operation_command_attributes",
"signal_external_workflow_execution_command_attributes",
b"signal_external_workflow_execution_command_attributes",
"start_child_workflow_execution_command_attributes",
Expand Down Expand Up @@ -1108,6 +1248,8 @@ class Command(google.protobuf.message.Message):
"upsert_workflow_search_attributes_command_attributes",
"protocol_message_command_attributes",
"modify_workflow_properties_command_attributes",
"schedule_nexus_operation_command_attributes",
"request_cancel_nexus_operation_command_attributes",
]
| None
): ...
Expand Down
2 changes: 2 additions & 0 deletions temporalio/api/common/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .grpc_status_pb2 import GrpcStatus
from .message_pb2 import (
ActivityType,
Callback,
DataBlob,
Header,
Memo,
Expand All @@ -18,6 +19,7 @@

__all__ = [
"ActivityType",
"Callback",
"DataBlob",
"GrpcStatus",
"Header",
Expand Down
Loading

0 comments on commit 2061835

Please sign in to comment.