Skip to content

Conversation

@vaishakdinesh
Copy link
Member

@vaishakdinesh vaishakdinesh commented Jan 23, 2026

related provider PR: cloudflare/terraform-provider-cloudflare#6686

What changed:
Moved state transformation logic from tf-migrate to the Terraform provider's built-in StateUpgraders.

Why:

  • Simpler: tf-migrate now just transforms config files (HCL) - provider handles state
  • More reliable: Provider's StateUpgraders run automatically during terraform apply
  • Less code: Deleted ~2,300 lines of state transformation tests and logic

Key changes for 3 resources:

  • dns_record: Removed state transform logic (59 KB → simpler)
  • page_rule: Removed state transform logic
  • load_balancer_pool: TransformState now returns state unchanged (no-op)

Test updates:

  • ✅ Deleted state transform test cases
  • ✅ Removed terraform.tfstate files from integration tests
  • ✅ Config transformation tests still pass

Result: tf-migrate is now focused on config migration only. State migration happens automatically in the provider when users run terraform commands

@vaishakdinesh vaishakdinesh marked this pull request as draft January 23, 2026 05:25
@tamas-jozsa tamas-jozsa changed the title DRAFT: refactor: initial exported func refactor: deprecate state upgraders Jan 29, 2026
@tamas-jozsa tamas-jozsa force-pushed the vaishak/refactor-state-transform branch from 510920a to fe45aee Compare January 29, 2026 17:39
@tamas-jozsa tamas-jozsa force-pushed the vaishak/refactor-state-transform branch 4 times, most recently from ffa812a to daca676 Compare January 29, 2026 21:28
@tamas-jozsa tamas-jozsa marked this pull request as ready for review January 29, 2026 21:31
@tamas-jozsa tamas-jozsa force-pushed the vaishak/refactor-state-transform branch 2 times, most recently from 49f236b to 7b26bbb Compare January 30, 2026 14:06
@tamas-jozsa tamas-jozsa force-pushed the vaishak/refactor-state-transform branch from 7b26bbb to 11b7f38 Compare January 30, 2026 16:58
@tamas-jozsa tamas-jozsa merged commit a550a54 into main Jan 30, 2026
9 checks passed
@tamas-jozsa tamas-jozsa deleted the vaishak/refactor-state-transform branch January 30, 2026 17:07
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.

2 participants