Skip to content

Commit 92acc01

Browse files
authored
Merge pull request #1038 from code0-tech/deps/tucana-0-0-75
deps: update Tucana to 0.0.75
2 parents 36744f2 + d7eb079 commit 92acc01

4 files changed

Lines changed: 21 additions & 8 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ gem 'good_job', '~> 4.0'
7979
gem 'rotp'
8080

8181
gem 'grpc', '~> 1.67'
82-
gem 'tucana', '0.0.74'
82+
gem 'tucana', '0.0.75'
8383

8484
gem 'code0-identities', '~> 0.0.3'
8585

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ GEM
390390
open3 (~> 0.2)
391391
tucana (~> 0.0, >= 0.0.72)
392392
tsort (0.2.0)
393-
tucana (0.0.74)
393+
tucana (0.0.75)
394394
grpc (~> 1.64)
395395
tzinfo (2.0.6)
396396
concurrent-ruby (~> 1.0)
@@ -446,7 +446,7 @@ DEPENDENCIES
446446
simplecov-cobertura (~> 3.0)
447447
test-prof (~> 1.0)
448448
triangulum (= 0.22.0)
449-
tucana (= 0.0.74)
449+
tucana (= 0.0.75)
450450
tzinfo-data
451451

452452
RUBY VERSION

app/services/namespaces/projects/flows/persist_execution_result_service.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def build_node_results(result)
5656
started_at: node_result.started_at,
5757
finished_at: node_result.finished_at,
5858
node_function: node_function_for(node_result),
59-
function_definition: function_definition_for(node_result)
59+
function_definition: function_definition_for(node_result, result.flow)
6060
)
6161

6262
assign_result(node_record, node_result)
@@ -79,10 +79,10 @@ def node_function_for(node_result)
7979
NodeFunction.find_by(id: node_result.node_id)
8080
end
8181

82-
def function_definition_for(node_result)
83-
return unless node_result.id == :function_id
82+
def function_definition_for(node_result, flow)
83+
return unless node_result.id == :function_identifier
8484

85-
FunctionDefinition.find_by(id: node_result.function_id)
85+
FunctionDefinition.find_by(runtime: flow.project.primary_runtime, identifier: node_result.function_identifier)
8686
end
8787

8888
def assign_result(record, grpc_record)

spec/services/namespaces/projects/flows/persist_execution_result_service_spec.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168

169169
context 'when a node execution result targets a function definition' do
170170
let(:function_definition) { create(:function_definition) }
171+
171172
let(:grpc_result) do
172173
Tucana::Shared::ExecutionResult.new(
173174
execution_identifier: 'execution-identifier',
@@ -178,7 +179,7 @@
178179
success: Tucana::Shared::Value.from_ruby('result' => true),
179180
node_execution_results: [
180181
Tucana::Shared::NodeExecutionResult.new(
181-
function_id: function_definition.id,
182+
function_identifier: function_definition.identifier,
182183
started_at: started_at,
183184
finished_at: finished_at,
184185
success: Tucana::Shared::Value.from_ruby('function' => 'ok')
@@ -187,6 +188,10 @@
187188
)
188189
end
189190

191+
before do
192+
flow.project.update!(primary_runtime: function_definition.runtime)
193+
end
194+
190195
it 'persists the function definition as the execution target' do
191196
expect(service_response).to be_success
192197

@@ -196,6 +201,14 @@
196201
success: { 'function' => 'ok' }
197202
)
198203
end
204+
205+
it 'ignores matching definitions from other runtimes' do
206+
expect(service_response).to be_success
207+
208+
expect(service_response.payload.node_results.sole).to have_attributes(
209+
function_definition: function_definition
210+
)
211+
end
199212
end
200213

201214
context 'when the result is an error' do

0 commit comments

Comments
 (0)