Skip to content

Commit 4f62b9a

Browse files
committed
Fix type errors
1 parent 24841ac commit 4f62b9a

File tree

5 files changed

+10
-23
lines changed

5 files changed

+10
-23
lines changed

temporalio/lib/temporalio/worker/workflow_replayer.rb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class WorkflowReplayer
2424
:data_converter,
2525
:workflow_executor,
2626
:interceptors,
27-
:build_id,
2827
:identity,
2928
:logger,
3029
:illegal_workflow_calls,
@@ -51,9 +50,6 @@ class Options; end # rubocop:disable Lint/EmptyClass
5150
# @param workflow_executor [WorkflowExecutor] Workflow executor that workflow tasks run within. This must be a
5251
# {WorkflowExecutor::ThreadPool} currently.
5352
# @param interceptors [Array<Interceptor::Workflow>] Workflow interceptors.
54-
# @param build_id [String] Unique identifier for the current runtime. This is best set as a unique value
55-
# representing all code and should change only when code does. This can be something like a git commit hash. If
56-
# unset, default is hash of known Ruby code.
5753
# @param identity [String, nil] Override the identity for this replater.
5854
# @param logger [Logger] Logger to use. Defaults to stdout with warn level. Callers setting this logger are
5955
# responsible for closing it.
@@ -87,7 +83,6 @@ def initialize(
8783
data_converter: Converters::DataConverter.default,
8884
workflow_executor: WorkflowExecutor::ThreadPool.default,
8985
interceptors: [],
90-
build_id: Worker.default_build_id,
9186
identity: nil,
9287
logger: Logger.new($stdout, level: Logger::WARN),
9388
illegal_workflow_calls: Worker.default_illegal_workflow_calls,
@@ -105,7 +100,6 @@ def initialize(
105100
data_converter:,
106101
workflow_executor:,
107102
interceptors:,
108-
build_id:,
109103
identity:,
110104
logger:,
111105
illegal_workflow_calls:,
@@ -116,7 +110,9 @@ def initialize(
116110
runtime:
117111
).freeze
118112
# Preload definitions and other settings
119-
@workflow_definitions = Internal::Worker::WorkflowWorker.workflow_definitions(workflows, false)
113+
@workflow_definitions = Internal::Worker::WorkflowWorker.workflow_definitions(
114+
workflows, should_enforce_versioning_behavior: false
115+
)
120116
@nondeterminism_as_workflow_fail, @nondeterminism_as_workflow_fail_for_types =
121117
Internal::Worker::WorkflowWorker.bridge_workflow_failure_exception_type_options(
122118
workflow_failure_exception_types:, workflow_definitions: @workflow_definitions
@@ -207,7 +203,6 @@ def initialize(
207203
tuner: Tuner.create_fixed(
208204
workflow_slots: 2, activity_slots: 1, local_activity_slots: 1
209205
)._to_bridge_options,
210-
build_id: options.build_id,
211206
identity_override: options.identity,
212207
max_cached_workflows: 2,
213208
max_concurrent_workflow_task_polls: 1,
@@ -220,7 +215,6 @@ def initialize(
220215
max_worker_activities_per_second: nil,
221216
max_task_queue_activities_per_second: nil,
222217
graceful_shutdown_period: 0.0,
223-
use_worker_versioning: false,
224218
nondeterminism_as_workflow_fail:,
225219
nondeterminism_as_workflow_fail_for_types:,
226220
deployment_options: nil

temporalio/sig/temporalio/internal/bridge/worker.rbs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module Temporalio
88
attr_accessor namespace: String
99
attr_accessor task_queue: String
1010
attr_accessor tuner: TunerOptions
11-
attr_accessor build_id: String
1211
attr_accessor identity_override: String?
1312
attr_accessor max_cached_workflows: Integer
1413
attr_accessor max_concurrent_workflow_task_polls: Integer
@@ -21,18 +20,16 @@ module Temporalio
2120
attr_accessor max_worker_activities_per_second: Float?
2221
attr_accessor max_task_queue_activities_per_second: Float?
2322
attr_accessor graceful_shutdown_period: Float
24-
attr_accessor use_worker_versioning: bool
2523
attr_accessor nondeterminism_as_workflow_fail: bool
2624
attr_accessor nondeterminism_as_workflow_fail_for_types: Array[String]
2725
attr_accessor deployment_options: DeploymentOptions?
28-
26+
2927
def initialize: (
3028
activity: bool,
3129
workflow: bool,
3230
namespace: String,
3331
task_queue: String,
3432
tuner: TunerOptions,
35-
build_id: String,
3633
identity_override: String?,
3734
max_cached_workflows: Integer,
3835
max_concurrent_workflow_task_polls: Integer,
@@ -45,7 +42,6 @@ module Temporalio
4542
max_worker_activities_per_second: Float?,
4643
max_task_queue_activities_per_second: Float?,
4744
graceful_shutdown_period: Float,
48-
use_worker_versioning: bool,
4945
nondeterminism_as_workflow_fail: bool,
5046
nondeterminism_as_workflow_fail_for_types: Array[String],
5147
deployment_options: DeploymentOptions?
@@ -154,4 +150,4 @@ module Temporalio
154150
end
155151
end
156152
end
157-
end
153+
end

temporalio/sig/temporalio/internal/worker/workflow_worker.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Temporalio
44
class WorkflowWorker
55
def self.workflow_definitions: (
66
Array[singleton(Workflow::Definition) | Workflow::Definition::Info] workflows,
7-
bool should_enforce_versioning_behavior
7+
should_enforce_versioning_behavior: bool
88
) -> Hash[String?, Workflow::Definition::Info]
99

1010
def self.bridge_workflow_failure_exception_type_options: (
@@ -93,4 +93,4 @@ module Temporalio
9393
end
9494
end
9595
end
96-
end
96+
end

temporalio/sig/temporalio/worker/workflow_replayer.rbs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module Temporalio
88
attr_reader data_converter: Converters::DataConverter
99
attr_reader workflow_executor: Worker::WorkflowExecutor
1010
attr_reader interceptors: Array[Interceptor::Workflow]
11-
attr_reader build_id: String
1211
attr_reader identity: String?
1312
attr_reader logger: Logger
1413
attr_reader illegal_workflow_calls: Hash[String, :all | Array[Symbol]]
@@ -17,15 +16,14 @@ module Temporalio
1716
attr_reader unsafe_workflow_io_enabled: bool
1817
attr_reader debug_mode: bool
1918
attr_reader runtime: Runtime
20-
19+
2120
def initialize: (
2221
workflows: Array[singleton(Workflow::Definition) | Workflow::Definition::Info],
2322
namespace: String,
2423
task_queue: String,
2524
data_converter: Converters::DataConverter,
2625
workflow_executor: Worker::WorkflowExecutor,
2726
interceptors: Array[Interceptor::Workflow],
28-
build_id: String,
2927
identity: String?,
3028
logger: Logger,
3129
illegal_workflow_calls: Hash[String, :all | Array[Symbol]],
@@ -46,7 +44,6 @@ module Temporalio
4644
?data_converter: Converters::DataConverter,
4745
?workflow_executor: Worker::WorkflowExecutor,
4846
?interceptors: Array[Interceptor::Workflow],
49-
?build_id: String,
5047
?identity: String?,
5148
?logger: Logger,
5249
?illegal_workflow_calls: Hash[String, :all | Array[Symbol]],
@@ -96,4 +93,4 @@ module Temporalio
9693
end
9794
end
9895
end
99-
end
96+
end

temporalio/test/worker_workflow_versioning_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def test_default_build_id
459459
worker = Temporalio::Worker.new(
460460
client: env.client,
461461
task_queue: "tq-#{SecureRandom.uuid}",
462-
workflows: [NoVersioningAnnotationWorkflow],
462+
workflows: [NoVersioningAnnotationWorkflow]
463463
)
464464
build_id = Temporalio::Worker.default_build_id
465465

0 commit comments

Comments
 (0)