Skip to content
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
6312a02
Drive-by: get rid of always-true condition
dandavison Sep 16, 2025
5b08112
Support serialization context for all ser/de operations
dandavison Sep 9, 2025
80119de
Partial revert
dandavison Sep 15, 2025
cebff4f
Refactor activation processing
dandavison Sep 16, 2025
03cae37
Do not support None context
dandavison Sep 19, 2025
3bd3bab
Never reinstantiate converters
dandavison Sep 19, 2025
aa60bbe
Stack contexts I
dandavison Sep 19, 2025
814f0da
Reuse and rename helper
dandavison Sep 19, 2025
fa36908
Don't assume user overrides with same constructor signature
dandavison Sep 19, 2025
647d9ab
Simplify
dandavison Sep 19, 2025
4adbb36
Command-aware serialization context during payload visitor traversal
dandavison Sep 22, 2025
00f8d0d
Cleanup
dandavison Sep 23, 2025
cd54929
heartbeat test
dandavison Sep 24, 2025
ebe1681
Cleanup
dandavison Sep 24, 2025
51e3d49
Requirements
dandavison Sep 24, 2025
30520e4
Document serialization context flow for workflows, activities, child …
dandavison Sep 24, 2025
71d6dcc
Add memo, search attributes, and user-accessible data converter docum…
dandavison Sep 24, 2025
59f7ff1
Add async activity completion and heartbeating documentation
dandavison Sep 24, 2025
43be40f
Async activity completion
dandavison Sep 24, 2025
d41cee6
Implement WithSerializationContext on AsyncActivityHandle
dandavison Sep 24, 2025
dab8999
Introduce shared base context class
dandavison Sep 24, 2025
87ca957
Add python column to requirements.md
dandavison Sep 24, 2025
e63afbe
Add Python column links to all requirements.md tables
dandavison Sep 24, 2025
2de5bfd
Do not "stack" payload/failure conversion contexts
dandavison Sep 24, 2025
792c26e
Cleanup
dandavison Sep 24, 2025
75f804c
Remove redundant Stage column and add missing .NET/Java links
dandavison Sep 24, 2025
297b4d0
Fix assertion error when workflow initialization fails
dandavison Sep 24, 2025
fe8c0d4
Cleanup: sort lines
dandavison Sep 24, 2025
fc25a9e
Lazy construction of data converter with context on WorkflowHandle
dandavison Sep 24, 2025
95b7b24
memoize data converter construction in paging iterator
dandavison Sep 24, 2025
e0484b8
AI fix for
dandavison Sep 24, 2025
2597c8b
Revert "AI fix for"
dandavison Sep 24, 2025
6b4081f
Fix payload codec usage
dandavison Sep 24, 2025
6bf9472
Bug fix
dandavison Sep 24, 2025
afbc0fb
Cleanup
dandavison Sep 25, 2025
0be8d6e
Appease mypy
dandavison Sep 25, 2025
6bb4ae2
cleanup
dandavison Sep 25, 2025
1e691ab
Skip nexus tests under Java test server
dandavison Sep 26, 2025
b6f49d5
Install clippy
dandavison Sep 25, 2025
febca8b
Failing test: customized default payload converter
dandavison Sep 25, 2025
ff73228
Fix test: return Self
dandavison Sep 25, 2025
192281d
Break feature
dandavison Sep 25, 2025
5e15549
Revert "Break feature"
dandavison Sep 26, 2025
a0d6127
Use structural typing for the interface
dandavison Sep 26, 2025
1ea65b0
Cleanup
dandavison Sep 26, 2025
49a96b9
Make data converter lazy on update handle
dandavison Sep 26, 2025
f4f8cbd
Use object identity comparison semantics
dandavison Sep 26, 2025
3f1f9c1
Revert "Use structural typing for the interface"
dandavison Sep 26, 2025
622b778
Make DataConverter implement the interface
dandavison Sep 26, 2025
b72f2b7
Cleanup
dandavison Sep 27, 2025
0201fba
Return self in AsyncActivityHandle.with_handle
dandavison Sep 27, 2025
e854537
Use object equality as was intended
dandavison Sep 27, 2025
46328d2
Factor out get_converters_with_context
dandavison Sep 27, 2025
38ac5c9
Fix bug spotted by AI (Cursor Bot)
dandavison Sep 27, 2025
9011d9c
appease pydoctor
dandavison Sep 27, 2025
0ecc96f
Formatting
dandavison Sep 29, 2025
deab876
Improvements from code review
dandavison Sep 29, 2025
6fe8dbe
Make it a dataclass
dandavison Sep 29, 2025
3103cd0
Revert to mapping codec over structure
dandavison Sep 29, 2025
3bb9950
Use existing workflow context payload codec
dandavison Sep 29, 2025
0b90258
Rename converters for explicitness
dandavison Sep 29, 2025
c80452b
Failing test: execute activity and child workflow concurrently to cat…
dandavison Sep 29, 2025
88f797a
Use (command_type, command_seq) dataclass
dandavison Sep 29, 2025
e802435
Compute context, not payload codec
dandavison Sep 29, 2025
d877aa8
Cleanup: use converters from nexus / child workflow handles
dandavison Sep 29, 2025
b9ce8c8
Refactor: don't use default PayloadVisitor to set command context
dandavison Sep 29, 2025
9cd5351
Construct context-aware data converter lazily on WorkflowExecution
dandavison Sep 30, 2025
b904919
Check we have test coverage
dandavison Sep 30, 2025
896a6fc
Avoid constructing workflow-context payload codec twice
dandavison Sep 30, 2025
7fecf51
Appease docstring linter
dandavison Sep 30, 2025
2257c57
Test workflow and activity payload converters have context
dandavison Sep 30, 2025
c1143df
Static method generation
dandavison Sep 30, 2025
b055d23
Revert back to explicitly statically defined methods
dandavison Sep 30, 2025
880b487
Remove no-op methods
dandavison Sep 30, 2025
eb5daff
Code golf
dandavison Sep 30, 2025
b826097
Revert "Code golf"
dandavison Sep 30, 2025
3c37838
Cleanup
dandavison Sep 30, 2025
d8c4f17
Remove temp coverage check
dandavison Sep 30, 2025
09be82e
Add docstrings, cleanup
dandavison Oct 1, 2025
a8e3c67
Reduce unnecessary instantiations
dandavison Oct 1, 2025
c78016e
Ensure _any_converter_takes_context is set and not stale
dandavison Oct 1, 2025
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ jobs:
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
with:
components: "clippy"
- uses: Swatinem/rust-cache@v2
with:
workspaces: temporalio/bridge -> target
Expand Down
3 changes: 2 additions & 1 deletion scripts/gen_payload_visitor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import subprocess
import sys
from pathlib import Path
from typing import Optional, Tuple
from typing import Optional

from google.protobuf.descriptor import Descriptor, FieldDescriptor

Expand Down Expand Up @@ -89,6 +89,7 @@ def generate(self, roots: list[Descriptor]) -> str:

from temporalio.api.common.v1.message_pb2 import Payload


class VisitorFunctions(abc.ABC):
\"\"\"Set of functions which can be called by the visitor.
Allows handling payloads as a sequence.
Expand Down
24 changes: 11 additions & 13 deletions temporalio/bridge/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@

from dataclasses import dataclass
from typing import (
TYPE_CHECKING,
Awaitable,
Callable,
List,
Mapping,
MutableSequence,
Optional,
Sequence,
Expand All @@ -20,7 +18,6 @@
Union,
)

import google.protobuf.internal.containers
from typing_extensions import TypeAlias

import temporalio.api.common.v1
Expand All @@ -35,12 +32,13 @@
import temporalio.bridge.temporal_sdk_bridge
import temporalio.converter
import temporalio.exceptions
from temporalio.api.common.v1.message_pb2 import Payload, Payloads
from temporalio.bridge._visitor import PayloadVisitor, VisitorFunctions
from temporalio.api.common.v1.message_pb2 import Payload
from temporalio.bridge._visitor import VisitorFunctions
from temporalio.bridge.temporal_sdk_bridge import (
CustomSlotSupplier as BridgeCustomSlotSupplier,
)
from temporalio.bridge.temporal_sdk_bridge import PollShutdownError # type: ignore
from temporalio.worker._command_aware_visitor import CommandAwarePayloadVisitor


@dataclass
Expand Down Expand Up @@ -299,22 +297,22 @@ async def visit_payloads(self, payloads: MutableSequence[Payload]) -> None:


async def decode_activation(
act: temporalio.bridge.proto.workflow_activation.WorkflowActivation,
activation: temporalio.bridge.proto.workflow_activation.WorkflowActivation,
codec: temporalio.converter.PayloadCodec,
decode_headers: bool,
) -> None:
"""Decode the given activation with the codec."""
await PayloadVisitor(
"""Decode all payloads in the activation."""
await CommandAwarePayloadVisitor(
skip_search_attributes=True, skip_headers=not decode_headers
).visit(_Visitor(codec.decode), act)
).visit(_Visitor(codec.decode), activation)


async def encode_completion(
comp: temporalio.bridge.proto.workflow_completion.WorkflowActivationCompletion,
completion: temporalio.bridge.proto.workflow_completion.WorkflowActivationCompletion,
codec: temporalio.converter.PayloadCodec,
encode_headers: bool,
) -> None:
"""Recursively encode the given completion with the codec."""
await PayloadVisitor(
"""Encode all payloads in the completion."""
await CommandAwarePayloadVisitor(
skip_search_attributes=True, skip_headers=not encode_headers
).visit(_Visitor(codec.encode), comp)
).visit(_Visitor(codec.encode), completion)
Loading