Skip to content

Commit 820218c

Browse files
authored
Fix incorrectly set legacy build id options (#859)
1 parent e360398 commit 820218c

File tree

5 files changed

+19
-20
lines changed

5 files changed

+19
-20
lines changed

temporalio/bridge/src/worker.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub enum WorkerVersioningStrategy {
108108

109109
#[derive(FromPyObject)]
110110
pub struct WorkerVersioningNone {
111-
pub build_id: String,
111+
pub build_id_no_versioning: String,
112112
}
113113

114114
/// Recreates [temporal_sdk_core_api::worker::WorkerDeploymentOptions]
@@ -122,7 +122,7 @@ pub struct WorkerDeploymentOptions {
122122

123123
#[derive(FromPyObject)]
124124
pub struct LegacyBuildIdBased {
125-
pub build_id: String,
125+
pub build_id_with_versioning: String,
126126
}
127127

128128
/// Recreates [temporal_sdk_core_api::worker::WorkerDeploymentVersion]
@@ -803,7 +803,7 @@ fn convert_versioning_strategy(
803803
match strategy {
804804
WorkerVersioningStrategy::None(vn) => {
805805
temporal_sdk_core_api::worker::WorkerVersioningStrategy::None {
806-
build_id: vn.build_id,
806+
build_id: vn.build_id_no_versioning,
807807
}
808808
}
809809
WorkerVersioningStrategy::DeploymentBased(options) => {
@@ -825,7 +825,7 @@ fn convert_versioning_strategy(
825825
}
826826
WorkerVersioningStrategy::LegacyBuildIdBased(lb) => {
827827
temporal_sdk_core_api::worker::WorkerVersioningStrategy::LegacyBuildIdBased {
828-
build_id: lb.build_id,
828+
build_id: lb.build_id_with_versioning,
829829
}
830830
}
831831
}

temporalio/bridge/worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,14 @@ class WorkerDeploymentOptions:
106106
class WorkerVersioningStrategyNone:
107107
"""Python representation of the Rust struct for configuring a worker versioning strategy None."""
108108

109-
build_id: str
109+
build_id_no_versioning: str
110110

111111

112112
@dataclass
113113
class WorkerVersioningStrategyLegacyBuildIdBased:
114114
"""Python representation of the Rust struct for configuring a worker versioning strategy legacy Build ID-based."""
115115

116-
build_id: str
116+
build_id_with_versioning: str
117117

118118

119119
WorkerVersioningStrategy: TypeAlias = Union[

temporalio/worker/_replayer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ def on_eviction_hook(
251251
max_task_queue_activities_per_second=None,
252252
graceful_shutdown_period_millis=0,
253253
versioning_strategy=temporalio.bridge.worker.WorkerVersioningStrategyNone(
254-
build_id=self._config["build_id"] or load_default_build_id(),
254+
build_id_no_versioning=self._config["build_id"]
255+
or load_default_build_id(),
255256
),
256257
workflow_task_poller_behavior=temporalio.bridge.worker.PollerBehaviorSimpleMaximum(
257258
1

temporalio/worker/_worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,13 @@ def __init__(
448448
build_id = build_id or load_default_build_id()
449449
versioning_strategy = (
450450
temporalio.bridge.worker.WorkerVersioningStrategyLegacyBuildIdBased(
451-
build_id=build_id
451+
build_id_with_versioning=build_id
452452
)
453453
)
454454
else:
455455
build_id = build_id or load_default_build_id()
456456
versioning_strategy = temporalio.bridge.worker.WorkerVersioningStrategyNone(
457-
build_id=build_id
457+
build_id_no_versioning=build_id
458458
)
459459

460460
if max_concurrent_workflow_task_polls:

tests/conftest.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ async def env(env_type: str) -> AsyncGenerator[WorkflowEnvironment, None]:
110110
"--dynamic-config-value",
111111
"frontend.enableExecuteMultiOperation=true",
112112
"--dynamic-config-value",
113-
"frontend.enableVersioningWorkflowAPIs=true",
113+
"frontend.workerVersioningWorkflowAPIs=true",
114114
"--dynamic-config-value",
115-
"frontend.enableVersioningDataAPIs=true",
115+
"frontend.workerVersioningDataAPIs=true",
116116
"--dynamic-config-value",
117117
"system.enableDeploymentVersions=true",
118118
],
@@ -140,18 +140,16 @@ async def worker(
140140
await worker.close()
141141

142142

143-
# There is an issue on 3.9 tests in GitHub actions where even though all tests
143+
# There is an issue in tests sometimes in GitHub actions where even though all tests
144144
# pass, an unclear outer area is killing the process with a bad exit code. This
145145
# hook forcefully kills the process as success when the exit code from pytest
146146
# is a success.
147-
if sys.version_info < (3, 10):
148-
149-
@pytest.hookimpl(hookwrapper=True, trylast=True)
150-
def pytest_cmdline_main(config):
151-
result = yield
152-
if result.get_result() == 0:
153-
os._exit(0)
154-
return result.get_result()
147+
@pytest.hookimpl(hookwrapper=True, trylast=True)
148+
def pytest_cmdline_main(config):
149+
result = yield
150+
if result.get_result() == 0:
151+
os._exit(0)
152+
return result.get_result()
155153

156154

157155
CONTINUE_AS_NEW_SUGGEST_HISTORY_COUNT = 50

0 commit comments

Comments
 (0)