Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions scripts/gen_protos.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,21 @@
re.compile(r"from protoc_gen_openapiv2\.").sub,
r"from temporalio.api.dependencies.protoc_gen_openapiv2.",
),
partial(
re.compile(r"from nexusannotations\.").sub,
r"from temporalio.api.dependencies.nexusannotations.",
),
partial(
re.compile(r"from temporal\.sdk\.core\.").sub, r"from temporalio.bridge.proto."
),
partial(
re.compile(r"'__module__' : 'temporal\.api\.").sub,
r"'__module__' : 'temporalio.api.",
),
partial(
re.compile(r"'__module__' : 'nexusannotations\.").sub,
r"'__module__' : 'temporalio.api.dependencies.nexusannotations.",
),
]

pyi_fixes = [
Expand All @@ -58,6 +66,10 @@
re.compile(r"protoc_gen_openapiv2\.").sub,
r"temporalio.api.dependencies.protoc_gen_openapiv2.",
),
partial(
re.compile(r"nexusannotations\.").sub,
r"temporalio.api.dependencies.nexusannotations.",
),
partial(re.compile(r"temporal\.sdk\.core\.").sub, r"temporalio.bridge.proto."),
]

Expand Down Expand Up @@ -194,8 +206,10 @@ def generate_protos(output_dir: Path):
# Move openapiv2 dependency protos
deps_out_dir = api_out_dir / "dependencies"
shutil.rmtree(deps_out_dir / "protoc_gen_openapiv2", ignore_errors=True)
shutil.rmtree(deps_out_dir / "nexusannotations", ignore_errors=True)
deps_out_dir.mkdir(exist_ok=True)
(output_dir / "protoc_gen_openapiv2").replace(deps_out_dir / "protoc_gen_openapiv2")
(output_dir / "nexusannotations").replace(deps_out_dir / "nexusannotations")
(deps_out_dir / "__init__.py").touch()
# Move protos
for p in (output_dir / "temporal" / "api").iterdir():
Expand Down
22 changes: 17 additions & 5 deletions scripts/gen_protos_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,28 @@
)
image_id = result.stdout.strip()

subprocess.run(
docker_run_command = [
"docker",
"run",
"--rm",
]

getuid = getattr(os, "getuid", None)
getgid = getattr(os, "getgid", None)
if callable(getuid) and callable(getgid):
docker_run_command.extend(["--user", f"{getuid()}:{getgid()}"])

docker_run_command.extend(
[
"docker",
"run",
"--rm",
"-v",
os.path.join(os.getcwd(), "temporalio", "api") + ":/api_new",
"-v",
os.path.join(os.getcwd(), "temporalio", "bridge", "proto") + ":/bridge_new",
image_id,
],
]
)

subprocess.run(
docker_run_command,
check=True,
)
20 changes: 10 additions & 10 deletions temporalio/api/activity/v1/message_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions temporalio/api/activity/v1/message_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ class ActivityExecutionInfo(google.protobuf.message.Message):
CANCELED_REASON_FIELD_NUMBER: builtins.int
LINKS_FIELD_NUMBER: builtins.int
TOTAL_HEARTBEAT_COUNT_FIELD_NUMBER: builtins.int
SDK_NAME_FIELD_NUMBER: builtins.int
SDK_VERSION_FIELD_NUMBER: builtins.int
activity_id: builtins.str
"""Unique identifier of this activity within its namespace along with run ID (below)."""
run_id: builtins.str
Expand Down Expand Up @@ -327,6 +329,14 @@ class ActivityExecutionInfo(google.protobuf.message.Message):
"""Links to related entities, such as the entity that started this activity."""
total_heartbeat_count: builtins.int
"""Total number of heartbeats recorded across all attempts of this activity, including retries."""
sdk_name: builtins.str
"""The name of the SDK of the worker that most recently picked up an attempt of this activity.
Overwritten on each new attempt. Empty if unknown.
"""
sdk_version: builtins.str
"""The version of the SDK of the worker that most recently picked up an attempt of this activity.
Overwritten on each new attempt. Empty if unknown.
"""
def __init__(
self,
*,
Expand Down Expand Up @@ -370,6 +380,8 @@ class ActivityExecutionInfo(google.protobuf.message.Message):
links: collections.abc.Iterable[temporalio.api.common.v1.message_pb2.Link]
| None = ...,
total_heartbeat_count: builtins.int = ...,
sdk_name: builtins.str = ...,
sdk_version: builtins.str = ...,
) -> None: ...
def HasField(
self,
Expand Down Expand Up @@ -475,6 +487,10 @@ class ActivityExecutionInfo(google.protobuf.message.Message):
b"schedule_to_close_timeout",
"schedule_to_start_timeout",
b"schedule_to_start_timeout",
"sdk_name",
b"sdk_name",
"sdk_version",
b"sdk_version",
"search_attributes",
b"search_attributes",
"start_to_close_timeout",
Expand Down
Loading
Loading