Skip to content

add removed at to flow type settings#954

Merged
Taucher2003 merged 10 commits intomainfrom
#812-add-removed-at-to-flow-type-settings
May 9, 2026
Merged

add removed at to flow type settings#954
Taucher2003 merged 10 commits intomainfrom
#812-add-removed-at-to-flow-type-settings

Conversation

@raphael-goetz
Copy link
Copy Markdown
Member

Resolves: #812

@raphael-goetz raphael-goetz self-assigned this May 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

GitLab Pipeline Action

General information

Link to pipeline: https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2512792580

Status: Passed
Duration: 6 minutes

Job summaries

rspec: [cloud]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/14292447336/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2512792580/test_report
Finished in 21.82 seconds (files took 14.26 seconds to load)
1380 examples, 0 failures
Line Coverage: 92.48% (4498 / 4864)
[TEST PROF INFO] Time spent in factories: 00:11.893 (39.36% of total time)

rspec: [ee]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/14292447335/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2512792580/test_report
Finished in 23.84 seconds (files took 9.71 seconds to load)
1358 examples, 0 failures
Line Coverage: 92.84% (4398 / 4737)
[TEST PROF INFO] Time spent in factories: 00:12.169 (41.34% of total time)

rspec: [ce]

Coverage report available at https://code0-tech.gitlab.io/-/development/sagittarius/-/jobs/14292447334/artifacts/tmp/coverage/index.html
Test summary available at https://gitlab.com/code0-tech/development/sagittarius/-/pipelines/2512792580/test_report
Finished in 21.78 seconds (files took 10.92 seconds to load)
1308 examples, 0 failures
Line Coverage: 92.35% (4227 / 4577)
[TEST PROF INFO] Time spent in factories: 00:11.543 (40.75% of total time)

docs:preview

Documentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/14292458283/artifacts/out/index.html

rubocop

777 files inspected, no offenses detected

@raphael-goetz raphael-goetz marked this pull request as ready for review May 9, 2026 08:36
Copilot AI review requested due to automatic review settings May 9, 2026 08:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds soft-deletion support (removed_at) to FlowTypeSetting so settings can be retired without immediate deletion (avoiding dangling FlowSetting references), aligning with existing “removed_at” patterns used for other runtime-defined entities.

Changes:

  • Add removed_at column via migration + update DB structure tracking.
  • Update runtime flow type update logic to soft-remove missing settings and restore existing ones; add active/removed scopes and use active settings when updating flows.
  • Expose removedAt via GraphQL and update documentation/tests accordingly.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
spec/requests/grpc/sagittarius/flow_type_service_spec.rb Asserts flow type settings are soft-removed instead of deleted during runtime updates.
spec/models/flow_type_setting_spec.rb Adds coverage for active and removed scopes.
spec/graphql/types/flow_type_setting_spec.rb Verifies GraphQL type includes the new removedAt field.
docs/graphql/object/flowtypesetting.md Documents the new removedAt field.
db/structure.sql Reflects new removed_at column on flow_type_settings.
db/schema_migrations/20260504131123 Adds migration checksum entry.
db/migrate/20260504131123_add_removed_at_to_flow_type_settings.rb Migration adding removed_at to flow_type_settings.
app/services/runtimes/grpc/flow_types/update_service.rb Changes flow type settings update behavior to soft-remove missing settings and upsert by identifier.
app/services/namespaces/projects/flows/update_service.rb Uses only active flow type settings when mapping positional flow inputs.
app/models/flow_type_setting.rb Adds active / removed scopes.
app/graphql/types/flow_type_setting_type.rb Exposes removedAt on the GraphQL object type.
Comments suppressed due to low confidence (1)

app/services/namespaces/projects/flows/update_service.rb:62

  • Flow settings are applied positionally from flow_input.settings, but the mapping to identifiers depends on flow_type_settings.active.order(:id). With soft-deleted settings and identifier-based upserts, id ordering may not match the runtime setting order (especially when inserting new settings), which can assign values to the wrong flow_setting_id. Consider ordering by a persisted position/index that reflects the runtime order.
          db_settings = flow.flow_settings.first(flow_input.settings.length)
          flow_type_settings = flow.flow_type.flow_type_settings.active.order(:id)

          flow_input.settings.each_with_index do |setting, index|
            db_settings[index] ||= flow.flow_settings.build
            db_settings[index].flow_setting_id = flow_type_settings[index]&.identifier
            db_settings[index].object = setting.value

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/services/runtimes/grpc/flow_types/update_service.rb Outdated
Comment thread app/services/runtimes/grpc/flow_types/update_service.rb
Comment thread app/services/runtimes/grpc/flow_types/update_service.rb Outdated
Comment thread app/services/namespaces/projects/flows/update_service.rb Outdated
Comment thread spec/requests/grpc/sagittarius/flow_type_service_spec.rb
raphael-goetz and others added 3 commits May 9, 2026 17:27
Co-authored-by: Niklas van Schrick <mc.taucher2003@gmail.com>
Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
@raphael-goetz raphael-goetz requested a review from Taucher2003 May 9, 2026 18:31
@Taucher2003 Taucher2003 merged commit 7cb1c56 into main May 9, 2026
1 check passed
@Taucher2003 Taucher2003 deleted the #812-add-removed-at-to-flow-type-settings branch May 9, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add removed_at to FlowTypeSetting

3 participants