From 0e067efc131c94a47b355ee73a36d4ce78e0079d Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Sun, 31 May 2026 20:21:15 +0200 Subject: [PATCH] Fix runtime compatibility check service --- app/models/function_definition.rb | 2 ++ ...check_runtime_compatibility_service_spec.rb | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/models/function_definition.rb b/app/models/function_definition.rb index 1853e0e0..0fc59cac 100644 --- a/app/models/function_definition.rb +++ b/app/models/function_definition.rb @@ -22,6 +22,8 @@ class FunctionDefinition < ApplicationRecord validates :identifier, presence: true, uniqueness: { case_sensitive: false, scope: :runtime_id } validates :design, length: { maximum: 200 } + delegate :parsed_version, to: :runtime_function_definition + def to_grpc Tucana::Shared::FunctionDefinition.new( runtime_name: identifier, diff --git a/spec/services/runtimes/check_runtime_compatibility_service_spec.rb b/spec/services/runtimes/check_runtime_compatibility_service_spec.rb index 16aa8c6e..da245ca3 100644 --- a/spec/services/runtimes/check_runtime_compatibility_service_spec.rb +++ b/spec/services/runtimes/check_runtime_compatibility_service_spec.rb @@ -80,20 +80,34 @@ runtime_flow_type: runtime_flow_type, identifier: 'ft1', version: '2.2.0') - create( + primary_rfd = create( :runtime_function_definition, runtime_name: 'rfd1', runtime: primary_runtime, runtime_module: primary_module, version: '3.0.0' ) - create( + secondary_rfd = create( :runtime_function_definition, runtime_name: 'rfd1', runtime: runtime, runtime_module: secondary_module, version: '3.1.0' ) + create( + :function_definition, + runtime_function_definition: primary_rfd, + identifier: 'fd1', + runtime: primary_runtime, + runtime_module: primary_module + ) + create( + :function_definition, + runtime_function_definition: secondary_rfd, + identifier: 'fd1', + runtime: runtime, + runtime_module: secondary_module + ) end it 'returns success with the runtime as payload' do