diff --git a/app/graphql/types/runtime_feature_type.rb b/app/graphql/types/runtime_feature_type.rb deleted file mode 100644 index f412dc1a..00000000 --- a/app/graphql/types/runtime_feature_type.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -module Types - class RuntimeFeatureType < Types::BaseObject - description 'Represents a runtime feature' - - authorize :read_runtime - - field :runtime_status, Types::RuntimeStatusType, - null: false, description: 'The runtime status this feature belongs to' - - field :descriptions, [Types::TranslationType], null: true, description: 'Description of the function' - field :names, [Types::TranslationType], null: true, description: 'Name of the function' - - id_field RuntimeFeature - timestamps - end -end diff --git a/app/graphql/types/runtime_status_type.rb b/app/graphql/types/runtime_status_type.rb index 52ab85de..60996717 100644 --- a/app/graphql/types/runtime_status_type.rb +++ b/app/graphql/types/runtime_status_type.rb @@ -16,9 +16,6 @@ class RuntimeStatusType < Types::BaseObject field :last_heartbeat, Types::TimeType, null: true, description: 'The timestamp of the last heartbeat received from the runtime' - field :runtime_features, [Types::RuntimeFeatureType], - null: false, - description: 'The set of features supported by the runtime' field :status, Types::RuntimeStatusStatusEnum, null: false, description: 'The current status of the runtime (e.g. running, stopped)' diff --git a/app/models/runtime_feature.rb b/app/models/runtime_feature.rb deleted file mode 100644 index 08a8a885..00000000 --- a/app/models/runtime_feature.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class RuntimeFeature < ApplicationRecord - include HasTranslation - - belongs_to :runtime_status, inverse_of: :runtime_features - - has_translation :names, purpose: :name - has_translation :descriptions, purpose: :description -end diff --git a/app/models/runtime_status.rb b/app/models/runtime_status.rb index a50b5507..4144c9ff 100644 --- a/app/models/runtime_status.rb +++ b/app/models/runtime_status.rb @@ -3,7 +3,6 @@ class RuntimeStatus < ApplicationRecord belongs_to :runtime, inverse_of: :runtime_statuses has_many :runtime_status_configurations, inverse_of: :runtime_status - has_many :runtime_features, inverse_of: :runtime_status STATUS_TYPES = { not_responding: 0, diff --git a/app/policies/runtime_feature_policy.rb b/app/policies/runtime_feature_policy.rb deleted file mode 100644 index 7b6d13fe..00000000 --- a/app/policies/runtime_feature_policy.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -class RuntimeFeaturePolicy < BasePolicy - delegate { subject.runtime_status } -end diff --git a/app/services/error_code.rb b/app/services/error_code.rb index ca5af764..44ab5bdd 100644 --- a/app/services/error_code.rb +++ b/app/services/error_code.rb @@ -87,7 +87,6 @@ def self.error_codes invalid_node_function: { description: 'The node function is invalid' }, invalid_runtime_status: { description: 'The runtime status is invalid because of active model errors' }, invalid_runtime_status_configuration: { description: 'The runtime status configuration is invalid because of active model errors' }, - invalid_runtime_feature: { description: 'The runtime feature is invalid because of active model errors' }, primary_level_not_found: { description: '', deprecation_reason: 'Outdated concept' }, secondary_level_not_found: { description: '', deprecation_reason: 'Outdated concept' }, diff --git a/app/services/runtimes/grpc/runtime_status_update_service.rb b/app/services/runtimes/grpc/runtime_status_update_service.rb index 164b96ee..e024dcd1 100644 --- a/app/services/runtimes/grpc/runtime_status_update_service.rb +++ b/app/services/runtimes/grpc/runtime_status_update_service.rb @@ -5,7 +5,6 @@ module Grpc class RuntimeStatusUpdateService include Sagittarius::Database::Transactional include Code0::ZeroTrack::Loggable - include Runtimes::Grpc::TranslationUpdateHelper attr_reader :runtime, :status_info @@ -35,24 +34,6 @@ def execute :execution end - db_features = db_status.runtime_features.first(status_info.features.length) - db_status.runtime_features.where.not(id: db_features.map(&:id)).destroy_all - - status_info.features.each_with_index do |feature, index| - db_features[index] ||= db_status.runtime_features.build - - db_features[index].names = update_translations(feature.name, db_features[index].names) - db_features[index].descriptions = update_translations(feature.description, db_features[index].descriptions) - - next if db_features[index].save - - t.rollback_and_return! ServiceResponse.error( - message: 'Failed to save runtime feature', - error_code: :invalid_runtime_feature, - details: db_features[index].errors - ) - end - db_status.status = status_info.status.downcase update_configurations(db_status, status_info, t) if status_info.is_a?(Tucana::Shared::AdapterRuntimeStatus) diff --git a/db/migrate/20260501171605_drop_runtime_features.rb b/db/migrate/20260501171605_drop_runtime_features.rb new file mode 100644 index 00000000..ea67a2b0 --- /dev/null +++ b/db/migrate/20260501171605_drop_runtime_features.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class DropRuntimeFeatures < Code0::ZeroTrack::Database::Migration[1.0] + def change + drop_table :runtime_features do |t| + t.references :runtime_status, null: false, + foreign_key: { to_table: :runtime_statuses, on_delete: :cascade } + end + end +end diff --git a/db/schema_migrations/20260501171605 b/db/schema_migrations/20260501171605 new file mode 100644 index 00000000..82103c3a --- /dev/null +++ b/db/schema_migrations/20260501171605 @@ -0,0 +1 @@ +b260e15ca15d5c6d9ac852138f3db268e8090c58ed457b92360e5b7be515e0a8 \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 19ffd36f..d96c69ee 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -665,22 +665,6 @@ CREATE SEQUENCE reference_values_id_seq ALTER SEQUENCE reference_values_id_seq OWNED BY reference_values.id; -CREATE TABLE runtime_features ( - id bigint NOT NULL, - runtime_status_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL -); - -CREATE SEQUENCE runtime_features_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE runtime_features_id_seq OWNED BY runtime_features.id; - CREATE TABLE runtime_function_definition_data_type_links ( id bigint NOT NULL, runtime_function_definition_id bigint NOT NULL, @@ -953,8 +937,6 @@ ALTER TABLE ONLY reference_paths ALTER COLUMN id SET DEFAULT nextval('reference_ ALTER TABLE ONLY reference_values ALTER COLUMN id SET DEFAULT nextval('reference_values_id_seq'::regclass); -ALTER TABLE ONLY runtime_features ALTER COLUMN id SET DEFAULT nextval('runtime_features_id_seq'::regclass); - ALTER TABLE ONLY runtime_function_definition_data_type_links ALTER COLUMN id SET DEFAULT nextval('runtime_function_definition_data_type_links_id_seq'::regclass); ALTER TABLE ONLY runtime_function_definitions ALTER COLUMN id SET DEFAULT nextval('runtime_function_definitions_id_seq'::regclass); @@ -1086,9 +1068,6 @@ ALTER TABLE ONLY reference_paths ALTER TABLE ONLY reference_values ADD CONSTRAINT reference_values_pkey PRIMARY KEY (id); -ALTER TABLE ONLY runtime_features - ADD CONSTRAINT runtime_features_pkey PRIMARY KEY (id); - ALTER TABLE ONLY runtime_function_definition_data_type_links ADD CONSTRAINT runtime_function_definition_data_type_links_pkey PRIMARY KEY (id); @@ -1258,8 +1237,6 @@ CREATE INDEX index_reference_values_on_node_function_id ON reference_values USIN CREATE INDEX index_reference_values_on_node_parameter_id ON reference_values USING btree (node_parameter_id); -CREATE INDEX index_runtime_features_on_runtime_status_id ON runtime_features USING btree (runtime_status_id); - CREATE INDEX index_runtime_status_configurations_on_runtime_status_id ON runtime_status_configurations USING btree (runtime_status_id); CREATE INDEX index_runtime_statuses_on_runtime_id ON runtime_statuses USING btree (runtime_id); @@ -1310,9 +1287,6 @@ ALTER TABLE ONLY flow_type_data_type_links ALTER TABLE ONLY licenses ADD CONSTRAINT fk_rails_38f693332d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY runtime_features - ADD CONSTRAINT fk_rails_39d4643cc0 FOREIGN KEY (runtime_status_id) REFERENCES runtime_statuses(id) ON DELETE CASCADE; - ALTER TABLE ONLY runtime_statuses ADD CONSTRAINT fk_rails_3af887feb9 FOREIGN KEY (runtime_id) REFERENCES runtimes(id) ON DELETE CASCADE; diff --git a/docs/graphql/enum/errorcodeenum.md b/docs/graphql/enum/errorcodeenum.md index 7f1f8c58..a471a6d5 100644 --- a/docs/graphql/enum/errorcodeenum.md +++ b/docs/graphql/enum/errorcodeenum.md @@ -44,7 +44,6 @@ Represents the available error responses | `INVALID_PASSWORD_REPEAT` | The provided password repeat does not match the password | | `INVALID_REFERENCE_VALUE` | The reference value is invalid | | `INVALID_RUNTIME` | The runtime is invalid because of active model errors | -| `INVALID_RUNTIME_FEATURE` | The runtime feature is invalid because of active model errors | | `INVALID_RUNTIME_FUNCTION_DEFINITION` | The runtime function definition is invalid | | `INVALID_RUNTIME_PARAMETER_DEFINITION` | The runtime parameter definition is invalid | | `INVALID_RUNTIME_STATUS` | The runtime status is invalid because of active model errors | diff --git a/docs/graphql/object/runtimefeature.md b/docs/graphql/object/runtimefeature.md deleted file mode 100644 index d73a98b0..00000000 --- a/docs/graphql/object/runtimefeature.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: RuntimeFeature ---- - -Represents a runtime feature - -## Fields without arguments - -| Name | Type | Description | -|------|------|-------------| -| `createdAt` | [`Time!`](../scalar/time.md) | Time when this RuntimeFeature was created | -| `descriptions` | [`[Translation!]`](../object/translation.md) | Description of the function | -| `id` | [`RuntimeFeatureID!`](../scalar/runtimefeatureid.md) | Global ID of this RuntimeFeature | -| `names` | [`[Translation!]`](../object/translation.md) | Name of the function | -| `runtimeStatus` | [`RuntimeStatus!`](../object/runtimestatus.md) | The runtime status this feature belongs to | -| `updatedAt` | [`Time!`](../scalar/time.md) | Time when this RuntimeFeature was last updated | diff --git a/docs/graphql/object/runtimestatus.md b/docs/graphql/object/runtimestatus.md index 233902b0..73b85783 100644 --- a/docs/graphql/object/runtimestatus.md +++ b/docs/graphql/object/runtimestatus.md @@ -13,7 +13,6 @@ A runtime status information entry | `id` | [`RuntimeStatusID!`](../scalar/runtimestatusid.md) | Global ID of this RuntimeStatus | | `identifier` | [`String!`](../scalar/string.md) | The unique identifier for this runtime status | | `lastHeartbeat` | [`Time`](../scalar/time.md) | The timestamp of the last heartbeat received from the runtime | -| `runtimeFeatures` | [`[RuntimeFeature!]!`](../object/runtimefeature.md) | The set of features supported by the runtime | | `status` | [`RuntimeStatusStatus!`](../enum/runtimestatusstatus.md) | The current status of the runtime (e.g. running, stopped) | | `type` | [`RuntimeStatusType!`](../enum/runtimestatustype.md) | The type of runtime status information (e.g. adapter, execution) | | `updatedAt` | [`Time!`](../scalar/time.md) | Time when this RuntimeStatus was last updated | diff --git a/docs/graphql/scalar/runtimefeatureid.md b/docs/graphql/scalar/runtimefeatureid.md deleted file mode 100644 index 66a417de..00000000 --- a/docs/graphql/scalar/runtimefeatureid.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: RuntimeFeatureID ---- - -A unique identifier for all RuntimeFeature entities of the application diff --git a/spec/factories/runtime_features.rb b/spec/factories/runtime_features.rb deleted file mode 100644 index 865f2cb8..00000000 --- a/spec/factories/runtime_features.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -FactoryBot.define do - factory :runtime_feature do - runtime_status - end -end diff --git a/spec/factories/runtime_status.rb b/spec/factories/runtime_status.rb index 13f04781..c77839b2 100644 --- a/spec/factories/runtime_status.rb +++ b/spec/factories/runtime_status.rb @@ -6,7 +6,6 @@ last_heartbeat { Time.zone.today } status_type { :adapter } identifier { SecureRandom.uuid } - runtime_features { [] } runtime end end diff --git a/spec/graphql/types/runtime_status_type_spec.rb b/spec/graphql/types/runtime_status_type_spec.rb index 3e266332..f5651a8f 100644 --- a/spec/graphql/types/runtime_status_type_spec.rb +++ b/spec/graphql/types/runtime_status_type_spec.rb @@ -8,7 +8,6 @@ id status configurations - runtimeFeatures lastHeartbeat type identifier diff --git a/spec/models/runtime_feature_spec.rb b/spec/models/runtime_feature_spec.rb deleted file mode 100644 index d75bdf80..00000000 --- a/spec/models/runtime_feature_spec.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -require 'rails_helper' - -RSpec.describe RuntimeFeature do - subject { create(:runtime_feature) } - - describe 'associations' do - it { is_expected.to belong_to(:runtime_status).required } - it { is_expected.to have_many(:names).class_name('Translation').inverse_of(:owner) } - it { is_expected.to have_many(:descriptions).class_name('Translation').inverse_of(:owner) } - end -end diff --git a/spec/requests/grpc/sagittarius/runtime_status_service_spec.rb b/spec/requests/grpc/sagittarius/runtime_status_service_spec.rb index eee82f70..8976da37 100644 --- a/spec/requests/grpc/sagittarius/runtime_status_service_spec.rb +++ b/spec/requests/grpc/sagittarius/runtime_status_service_spec.rb @@ -14,22 +14,6 @@ status: Tucana::Shared::AdapterRuntimeStatus::Status::RUNNING, timestamp: Time.now.to_i, identifier: 'adapter_status_1', - features: [ - Tucana::Shared::RuntimeFeature.new( - name: [ - Tucana::Shared::Translation.new( - code: 'de_DE', - content: 'http' - ) - ], - description: [ - Tucana::Shared::Translation.new( - code: 'de_DE', - content: 'HTTP support' - ) - ] - ) - ], configurations: [ Tucana::Shared::AdapterConfiguration.new( endpoint: 'http://localhost:3000' @@ -49,7 +33,6 @@ expect(db_status.identifier).to eq('adapter_status_1') expect(db_status.status_type).to eq('adapter') expect(db_status.status).to eq('running') - expect(db_status.runtime_features.size).to eq(1) expect(db_status.runtime_status_configurations.count).to eq(1) expect(db_status.runtime_status_configurations.first.endpoint).to eq('http://localhost:3000') end @@ -75,23 +58,7 @@ Tucana::Shared::ExecutionRuntimeStatus.new( status: Tucana::Shared::ExecutionRuntimeStatus::Status::RUNNING, timestamp: Time.now.to_i, - identifier: 'execution_status_1', - features: [ - Tucana::Shared::RuntimeFeature.new( - name: [ - Tucana::Shared::Translation.new( - code: 'de_DE', - content: 'http' - ) - ], - description: [ - Tucana::Shared::Translation.new( - code: 'de_DE', - content: 'HTTP support' - ) - ] - ) - ] + identifier: 'execution_status_1' ) end @@ -106,7 +73,6 @@ expect(db_status.identifier).to eq('execution_status_1') expect(db_status.status_type).to eq('execution') expect(db_status.status).to eq('running') - expect(db_status.runtime_features.size).to eq(1) end end end