feat: Add migration logic and tests for cloudflare_pages_project#48
Merged
tamas-jozsa merged 1 commit intomainfrom Dec 4, 2025
Merged
Conversation
8c403f5 to
4a9eac6
Compare
4a9eac6 to
bf3a98a
Compare
mgirouard
approved these changes
Dec 3, 2025
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.
feat: Add migration logic and tests for cloudflare_pages_project resource
Summary
Implements v4 to v5 migration support for the
cloudflare_pages_projectresource, including comprehensive configuration and state transformations with full test coverage.Changes
Migration Implementation
Configuration Transformations:
production_deployment_enabledtoproduction_deployments_enabledin source.configcompatibility_flags,usage_model,fail_open, andplacementin deployment_configsState Transformations:
environment_variablesandsecretsinto unifiedenv_varswith type/value structureTest Coverage
Unit Tests (18 test cases):
Integration Tests:
Helper Functions
AttributeValueContainsKeyfunction to check for nested keys in HCL attributesRegistry
Known Limitations
sourceblock with GitHub/GitLab configuration is commented out in integration test files because it requires external authentication and repository access. The migration logic handles source transformations correctly (tested in unit tests), but live integration testing with actual Git repositories is not feasible in automated test environments.Files Modified
internal/resources/pages_project/v4_to_v5.go(644 lines added)internal/resources/pages_project/v4_to_v5_test.go(1287 lines added)internal/transform/hcl/attributes.go(27 lines added)internal/registry/registry.go(2 lines modified)integration/v4_to_v5/integration_test.go(17 lines modified)Testing
All unit tests (18/18) and integration tests (6/6) pass successfully.