Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions app/graphql/types/runtime_feature_type.rb

This file was deleted.

3 changes: 0 additions & 3 deletions app/graphql/types/runtime_status_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
Expand Down
10 changes: 0 additions & 10 deletions app/models/runtime_feature.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/models/runtime_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 0 additions & 5 deletions app/policies/runtime_feature_policy.rb

This file was deleted.

1 change: 0 additions & 1 deletion app/services/error_code.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand Down
19 changes: 0 additions & 19 deletions app/services/runtimes/grpc/runtime_status_update_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
10 changes: 10 additions & 0 deletions db/migrate/20260501171605_drop_runtime_features.rb
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions db/schema_migrations/20260501171605
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b260e15ca15d5c6d9ac852138f3db268e8090c58ed457b92360e5b7be515e0a8
26 changes: 0 additions & 26 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion docs/graphql/enum/errorcodeenum.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
16 changes: 0 additions & 16 deletions docs/graphql/object/runtimefeature.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/graphql/object/runtimestatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
5 changes: 0 additions & 5 deletions docs/graphql/scalar/runtimefeatureid.md

This file was deleted.

7 changes: 0 additions & 7 deletions spec/factories/runtime_features.rb

This file was deleted.

1 change: 0 additions & 1 deletion spec/factories/runtime_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
last_heartbeat { Time.zone.today }
status_type { :adapter }
identifier { SecureRandom.uuid }
runtime_features { [] }
runtime
end
end
1 change: 0 additions & 1 deletion spec/graphql/types/runtime_status_type_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
id
status
configurations
runtimeFeatures
lastHeartbeat
type
identifier
Expand Down
13 changes: 0 additions & 13 deletions spec/models/runtime_feature_spec.rb

This file was deleted.

36 changes: 1 addition & 35 deletions spec/requests/grpc/sagittarius/runtime_status_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down