Skip to content

Conversation

@steve-thousand
Copy link
Contributor

@steve-thousand steve-thousand commented Dec 16, 2025

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Adding StateUpgrader for recent 5.13.0 -> 5.14.0 changes. Policy IDs were removed from policies as well as having some lists changed to sets, and while there were no problems handling 5.13.0 state in terraform plan/apply, running a terraform show command would crash on unknown policy "id" attribute.

@steve-thousand steve-thousand changed the title DRAFT Account member v0 migration cloudflare_account_member v0 migration Dec 16, 2025
@steve-thousand steve-thousand force-pushed the account-member-v0-migration branch from d9e9bf4 to 120b53d Compare December 17, 2025 22:09
@mgirouard
Copy link
Contributor

PR looks good -- I see that there's one failing test when I run the full suite for this resource. I don't think it's related to your patch.

mgirouard@sixteen:~/src/terraform-devstack/cloudflare-terraform-next$ TF_MIGRATE_BINARY_PATH=/home/mgirouard/src/terraform-devstack/tf-migrate/tf-migrate TF_ACC=1 go test ./internal/services/account_member -v -count=1               
=== RUN   TestAccountMemberDataSourceModelSchemaParity
=== PAUSE TestAccountMemberDataSourceModelSchemaParity
=== RUN   TestAccountMembersDataSourceModelSchemaParity
=== PAUSE TestAccountMembersDataSourceModelSchemaParity
=== RUN   TestMigrateCloudflareAccountMember_Migration_Basic_MultiVersion
=== RUN   TestMigrateCloudflareAccountMember_Migration_Basic_MultiVersion/from_v4_52_1
--- PASS: TestMigrateCloudflareAccountMember_Migration_Basic_MultiVersion (19.91s)
    --- PASS: TestMigrateCloudflareAccountMember_Migration_Basic_MultiVersion/from_v4_52_1 (19.91s)
=== RUN   TestMigrateCloudflareAccountMember_Migration_WithStatus
    migrations_test.go:132: Step 1/3 error: Error running apply: exit status 1

        Error: error creating Cloudflare account member: Cannot add verified membership for non-existing user (1003)

          with cloudflare_account_member.cftftestvtmfjhnkqd,
          on terraform_plugin_test.tf line 14, in resource "cloudflare_account_member" "cftftestvtmfjhnkqd":
          14: resource "cloudflare_account_member" "cftftestvtmfjhnkqd" {

--- FAIL: TestMigrateCloudflareAccountMember_Migration_WithStatus (5.01s)
=== RUN   TestMigrateAccountMemberFromV5_13
--- PASS: TestMigrateAccountMemberFromV5_13 (23.90s)
=== RUN   TestAccountMemberModelSchemaParity
=== PAUSE TestAccountMemberModelSchemaParity
=== RUN   TestAccCloudflareAccountMember_Basic
--- PASS: TestAccCloudflareAccountMember_Basic (8.62s)
=== RUN   TestAccCloudflareAccountMember_Import
--- PASS: TestAccCloudflareAccountMember_Import (11.97s)
=== RUN   TestAccCloudflareAccountMember_DirectAdd
    resource_test.go:182: API now throws if the user doesn't exist. We will have to see if we can easily create test users for this test.
--- SKIP: TestAccCloudflareAccountMember_DirectAdd (0.00s)
=== RUN   TestAccCloudflareAccountMember_RolesUpdate
--- PASS: TestAccCloudflareAccountMember_RolesUpdate (9.04s)
=== RUN   TestAccCloudflareAccountMember_RolesVsPolicies
--- PASS: TestAccCloudflareAccountMember_RolesVsPolicies (4.87s)
=== RUN   TestAccCloudflareAccountMember_Policies
--- PASS: TestAccCloudflareAccountMember_Policies (11.47s)
=== RUN   TestAccCloudflareAccountMember_PoliciesAddResourceGroup
    resource_test.go:384: Needs a DSR enabled user
--- SKIP: TestAccCloudflareAccountMember_PoliciesAddResourceGroup (0.00s)
=== CONT  TestAccountMemberDataSourceModelSchemaParity
=== CONT  TestAccountMemberModelSchemaParity
=== CONT  TestAccountMembersDataSourceModelSchemaParity
--- PASS: TestAccountMemberModelSchemaParity (0.00s)
--- PASS: TestAccountMemberDataSourceModelSchemaParity (0.00s)
--- PASS: TestAccountMembersDataSourceModelSchemaParity (0.00s)
FAIL
FAIL    github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_member    94.833s
FAIL

@vaishakdinesh
Copy link
Member

PR looks good -- I see that there's one failing test when I run the full suite for this resource. I don't think it's related to your patch.

mgirouard@sixteen:~/src/terraform-devstack/cloudflare-terraform-next$ TF_MIGRATE_BINARY_PATH=/home/mgirouard/src/terraform-devstack/tf-migrate/tf-migrate TF_ACC=1 go test ./internal/services/account_member -v -count=1               
=== RUN   TestAccountMemberDataSourceModelSchemaParity
=== PAUSE TestAccountMemberDataSourceModelSchemaParity
=== RUN   TestAccountMembersDataSourceModelSchemaParity
=== PAUSE TestAccountMembersDataSourceModelSchemaParity
=== RUN   TestMigrateCloudflareAccountMember_Migration_Basic_MultiVersion
=== RUN   TestMigrateCloudflareAccountMember_Migration_Basic_MultiVersion/from_v4_52_1
--- PASS: TestMigrateCloudflareAccountMember_Migration_Basic_MultiVersion (19.91s)
    --- PASS: TestMigrateCloudflareAccountMember_Migration_Basic_MultiVersion/from_v4_52_1 (19.91s)
=== RUN   TestMigrateCloudflareAccountMember_Migration_WithStatus
    migrations_test.go:132: Step 1/3 error: Error running apply: exit status 1

        Error: error creating Cloudflare account member: Cannot add verified membership for non-existing user (1003)

          with cloudflare_account_member.cftftestvtmfjhnkqd,
          on terraform_plugin_test.tf line 14, in resource "cloudflare_account_member" "cftftestvtmfjhnkqd":
          14: resource "cloudflare_account_member" "cftftestvtmfjhnkqd" {

--- FAIL: TestMigrateCloudflareAccountMember_Migration_WithStatus (5.01s)
=== RUN   TestMigrateAccountMemberFromV5_13
--- PASS: TestMigrateAccountMemberFromV5_13 (23.90s)
=== RUN   TestAccountMemberModelSchemaParity
=== PAUSE TestAccountMemberModelSchemaParity
=== RUN   TestAccCloudflareAccountMember_Basic
--- PASS: TestAccCloudflareAccountMember_Basic (8.62s)
=== RUN   TestAccCloudflareAccountMember_Import
--- PASS: TestAccCloudflareAccountMember_Import (11.97s)
=== RUN   TestAccCloudflareAccountMember_DirectAdd
    resource_test.go:182: API now throws if the user doesn't exist. We will have to see if we can easily create test users for this test.
--- SKIP: TestAccCloudflareAccountMember_DirectAdd (0.00s)
=== RUN   TestAccCloudflareAccountMember_RolesUpdate
--- PASS: TestAccCloudflareAccountMember_RolesUpdate (9.04s)
=== RUN   TestAccCloudflareAccountMember_RolesVsPolicies
--- PASS: TestAccCloudflareAccountMember_RolesVsPolicies (4.87s)
=== RUN   TestAccCloudflareAccountMember_Policies
--- PASS: TestAccCloudflareAccountMember_Policies (11.47s)
=== RUN   TestAccCloudflareAccountMember_PoliciesAddResourceGroup
    resource_test.go:384: Needs a DSR enabled user
--- SKIP: TestAccCloudflareAccountMember_PoliciesAddResourceGroup (0.00s)
=== CONT  TestAccountMemberDataSourceModelSchemaParity
=== CONT  TestAccountMemberModelSchemaParity
=== CONT  TestAccountMembersDataSourceModelSchemaParity
--- PASS: TestAccountMemberModelSchemaParity (0.00s)
--- PASS: TestAccountMemberDataSourceModelSchemaParity (0.00s)
--- PASS: TestAccountMembersDataSourceModelSchemaParity (0.00s)
FAIL
FAIL    github.com/cloudflare/terraform-provider-cloudflare/internal/services/account_member    94.833s
FAIL

I'll take a look at this for the next release. So holding till then

@steve-thousand
Copy link
Contributor Author

I spoke to @vaishakdinesh about this earlier. I don't actually know how that test was ever passing because you can't direct invite (set status = "accepted") a non-existing user and the test is creating a random user.

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.

3 participants