Repository navigation
fix(core): detect create-before-destroy replacements in drift - #319
Merged
viodid merged 3 commits intoOct 13, 2026
Merged
Conversation
Contribution License Agreement - Valid 🟢All commits contain valid signoff. As a confirmation, remember that you are agreeing to our Contribution License Agreement. |
Lostmanu
marked this pull request as ready for review
October 9, 2026 10:48
Signed-off-by: Manuel Beardo Campo <[email protected]>
Lostmanu
force-pushed
the
fix/create-before-destroy-drift
branch
from
October 9, 2026 11:00
60a028e to
7e14e11
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix correctly addresses the omitted replacement case with comprehensive regression coverage.
0 open findings
What changed in this PR
Fixes #318 by recognizing create-before-destroy replacements during Terraform drift detection.
Changes:
- Handles both Terraform replacement action orders.
- Adds parser and synchronization regression tests.
| File | Description |
|---|---|
core/src/infrastructure/terraform/utils.py |
Recognizes ["create", "delete"] replacements. |
core/tests/infrastructure/terraform/test_utils.py |
Tests both replacement orders and reversal modes. |
core/tests/infrastructure/terraform/test_terraform.py |
Verifies replacements report out-of-sync state. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
2 of 5 tasks
viodid
approved these changes
Oct 13, 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.
Summary
plan_to_driftdrops replacements whose actions are["create", "delete"]. When this is the only change,Terraform.driftreturnsin_sync=Truedespite the pending replacement.Handle this order through the same branch as
["delete", "create"], preserving the existing summary format. Regression tests cover both replacement orders, normal and reversed values, and theTerraform.driftsynchronization result.Fixes #318.
Checklist
Additional context
Targeted validation, from
core/:The new regression tests fail against the unchanged parser and pass with the fix. A local
terraform_dataplan generated by Terraform also reproduces the omitted replacement.The broader Terraform and drift-service test run has the same pre-existing failures on the base commit and this patch. No additional failures were observed in that comparison.