fix(workflows): migrate per-node inventory/environment overrides#4026
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(workflows): migrate per-node inventory/environment overrides#4026cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Migration 2.19.11 only copied ansible limit values into task_params, silently dropping per-node inventory and environment overrides that existed since v2.18.15. - Extend 2.19.11 PostApply to copy inventory_id and environment_id - Add idempotent 2.19.12 repair for DBs that already ran buggy 2.19.11 - Restore legacy backup inventory/environment fields on import - Add migration tests for inventory/env and partial-migration repair Co-authored-by: Denis Gukov <fiftin@outlook.com>
This was referenced Jul 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug and impact
PR #4024 (workflow params) introduced migration
2.19.11, which moved per-node Ansiblelimitvalues intoproject__task_paramsbut did not migrateinventory_idorenvironment_idfrom legacyproject__workflow_nodecolumns.Impact: On upgrade, any workflow node with per-node inventory or environment overrides (supported since v2.18.15) silently loses those settings. Tasks spawned from affected nodes run with the template defaults instead of the configured overrides — a data-loss bug with direct user-facing breakage.
Trigger scenario:
2.19.11runs;task_params_idstays NULL because the node has nolimit.Backup/restore was also affected: pre-2.19.11 backups stored inventory/environment by name on workflow nodes, but restore no longer mapped those fields into
TaskParams.Root cause
WorkflowNodewas refactored from directInventoryID/EnvironmentID/Limitfields toTaskParams, butmigration_2_19_11PostApply only queried nodes with non-emptylimitand only copied the limit JSON intotask_params.Fix
project__task_params.task_paramsrows).inventory/environmentname fields from pre-2.19.11 backups intoTaskParams.Validation
go test ./db/sql/... -run TestMigration_2_19— pass (limit, inventory/environment, partial-migration repair)go test ./services/project/...— pass