From d220f50330bdbda9fe8e1a1ba996b3a99a88b1e8 Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Tue, 13 Jan 2026 19:42:35 +0100 Subject: [PATCH 1/3] Add parent types to recursive DataTypeIdentifier expansion --- app/finders/data_type_identifiers_finder.rb | 11 +++++++---- spec/finders/data_type_identifiers_finder_spec.rb | 13 +++++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/finders/data_type_identifiers_finder.rb b/app/finders/data_type_identifiers_finder.rb index aca15d59..8d25e87b 100644 --- a/app/finders/data_type_identifiers_finder.rb +++ b/app/finders/data_type_identifiers_finder.rb @@ -107,10 +107,11 @@ def add_related_identifiers_recursive_case end def data_type_identifier_by_data_type_condition + dt = DataType.arel_table dti = DataTypeIdentifier.arel_table dtr = DataTypeRule.arel_table - config_id_condition = dti[:id].eq( + basic_rule_condition = dti[:id].eq( Arel::Nodes::NamedFunction.new( 'CAST', [ @@ -122,7 +123,7 @@ def data_type_identifier_by_data_type_condition ) ) - array_condition = Arel::Nodes::NamedFunction.new( + input_types_any_condition = Arel::Nodes::NamedFunction.new( 'ANY', [ Arel::Nodes::NamedFunction.new( @@ -140,10 +141,12 @@ def data_type_identifier_by_data_type_condition ] ) - array_id_condition = dti[:id].eq(array_condition) + input_types_rule_condition = dti[:id].eq(input_types_any_condition) + + parent_type_condition = dt[:parent_type_id].eq(dti[:id]) Arel::Nodes::Grouping.new( - config_id_condition.or(array_id_condition) + basic_rule_condition.or(input_types_rule_condition).or(parent_type_condition) ) end end diff --git a/spec/finders/data_type_identifiers_finder_spec.rb b/spec/finders/data_type_identifiers_finder_spec.rb index f95da5e1..a61d3d87 100644 --- a/spec/finders/data_type_identifiers_finder_spec.rb +++ b/spec/finders/data_type_identifiers_finder_spec.rb @@ -165,6 +165,13 @@ end end + let!(:data_type_identifier_as_parent_type) do + create(:data_type_identifier, data_type: data_type3, runtime: runtime).tap do |dti| + data_type1.parent_type = dti + data_type1.save! + end + end + let!(:data_type_identifier_in_generic_mapper_source) do create(:data_type_identifier, data_type: data_type1, runtime: runtime) end @@ -204,7 +211,8 @@ data_type_identifier_with_generic_mapper.id, data_type_identifier_in_generic_mapper_source.id, data_type_identifier_in_contains_type_rule.id, - data_type_identifier_in_input_types_rule.id + data_type_identifier_in_input_types_rule.id, + data_type_identifier_as_parent_type.id ) end @@ -273,7 +281,8 @@ second_data_type_identifier_in_generic_mapper_source.id, data_type_identifier_in_generic_mapper_source.id, data_type_identifier_in_contains_type_rule.id, - data_type_identifier_in_input_types_rule.id + data_type_identifier_in_input_types_rule.id, + data_type_identifier_as_parent_type.id ) end end From 35e51a49f98d33c9d585ac332adeb9c4cc621ad7 Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Tue, 13 Jan 2026 19:57:53 +0100 Subject: [PATCH 2/3] Fix implementation of function and parameter definition fields --- app/graphql/types/function_definition_type.rb | 4 ++++ app/graphql/types/parameter_definition_type.rb | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/graphql/types/function_definition_type.rb b/app/graphql/types/function_definition_type.rb index ac980ab3..791c35e8 100644 --- a/app/graphql/types/function_definition_type.rb +++ b/app/graphql/types/function_definition_type.rb @@ -46,6 +46,10 @@ def identifier object.runtime_function_definition&.runtime_name end + def generic_keys + object.runtime_function_definition&.generic_keys + end + def data_type_identifiers DataTypeIdentifiersFinder.new({ function_definition: object, expand_recursively: true }).execute end diff --git a/app/graphql/types/parameter_definition_type.rb b/app/graphql/types/parameter_definition_type.rb index 3ab2371a..1812ccaa 100644 --- a/app/graphql/types/parameter_definition_type.rb +++ b/app/graphql/types/parameter_definition_type.rb @@ -8,7 +8,10 @@ class ParameterDefinitionType < Types::BaseObject field :identifier, String, null: false, description: 'Identifier of the parameter' - field :data_type_identifier, Types::DataTypeIdentifierType, null: true, description: 'Data type of the parameter' + field :data_type_identifier, Types::DataTypeIdentifierType, + null: true, + description: 'Data type of the parameter', + method: :data_type field :descriptions, [Types::TranslationType], null: true, description: 'Description of the parameter' field :names, [Types::TranslationType], null: true, description: 'Name of the parameter' @@ -19,5 +22,9 @@ class ParameterDefinitionType < Types::BaseObject id_field ParameterDefinition timestamps + + def identifier + object.runtime_parameter_definition&.runtime_name + end end end From 57df0815b7a3bfcf177e3192aa5aa7d46a0e2cfa Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Tue, 13 Jan 2026 19:58:34 +0100 Subject: [PATCH 3/3] Add missing assignment of generic keys for RuntimeFunctionDefinitions --- .../grpc/runtime_function_definitions/update_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/runtimes/grpc/runtime_function_definitions/update_service.rb b/app/services/runtimes/grpc/runtime_function_definitions/update_service.rb index e44d517f..532c5b02 100644 --- a/app/services/runtimes/grpc/runtime_function_definitions/update_service.rb +++ b/app/services/runtimes/grpc/runtime_function_definitions/update_service.rb @@ -65,6 +65,8 @@ def update_runtime_function_definition(runtime_function_definition, t) db_object.display_messages) db_object.aliases = update_translations(runtime_function_definition.alias, db_object.aliases) + db_object.generic_keys = runtime_function_definition.generic_keys.to_a + db_object.throws_error = runtime_function_definition.throws_error db_object.version = runtime_function_definition.version