Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waitingroom event bugfix #1648

Merged
merged 8 commits into from May 27, 2022

Conversation

broswen
Copy link
Contributor

@broswen broswen commented May 26, 2022

@github-actions
Copy link
Contributor

Oops! It looks like no changelog entry is attached to this PR. Please include a release note as described in https://github.com/cloudflare/terraform-provider-cloudflare/blob/master/docs/changelog-process.md.

Example:

```release-note:TYPE
Release note
```

If you do not require a release note to be included, please add the workflow/skip-changelog-entry label.

if err != nil {
return cloudflare.WaitingRoomEvent{}, err
}
}

return cloudflare.WaitingRoomEvent{
ID: d.Id(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is going to error in the Create where it is referenced as d.SetId() isn't called until after the API calls are made and this value doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I'll just extract from the ResourceData and set it manually.

@jacobbednarz
Copy link
Member

is there a test case we should be adding for this as well?

@broswen
Copy link
Contributor Author

broswen commented May 27, 2022

is there a test case we should be adding for this as well?

Before this change, we would see prequeue_start_time set to the default time.Time value (epoch start). Now it should not be set (null).
Is there a terraform test function we can use to compare a state drift? Before the change we would see that prequeue_start_time would be set even though the terraform config doesn't have it set.
I would think that resource.TestCheckNoResourceAttr(name, "prequeue_start_time"), should have caught this but I'm not sure why it didn't.

@broswen
Copy link
Contributor Author

broswen commented May 27, 2022

The latest commit should get that TestCheck working. Since it wasn't using a pointer before it was comparing to the zero value and would not set if it was a zero value (epoch start).

@jacobbednarz
Copy link
Member

acceptance tests are passing

TF_ACC=1 go test $(go list ./...) -v -run "^TestAccCloudflareWaitingRoomEvent_" -count 1 -parallel 1 -timeout 120m -parallel 1
?   	github.com/cloudflare/terraform-provider-cloudflare	[no test files]
=== RUN   TestAccCloudflareWaitingRoomEvent_Create
=== PAUSE TestAccCloudflareWaitingRoomEvent_Create
=== CONT  TestAccCloudflareWaitingRoomEvent_Create
--- PASS: TestAccCloudflareWaitingRoomEvent_Create (16.79s)
PASS
ok  	github.com/cloudflare/terraform-provider-cloudflare/internal/provider	17.360s
?   	github.com/cloudflare/terraform-provider-cloudflare/tools/cmd/changelog-check	[no test files]
?   	github.com/cloudflare/terraform-provider-cloudflare/tools/cmd/maintainer-only-file-check	[no test files]
?   	github.com/cloudflare/terraform-provider-cloudflare/tools/cmd/tf-log-check	[no test files]
?   	github.com/cloudflare/terraform-provider-cloudflare/version	[no test files]

@jacobbednarz jacobbednarz merged commit 33a9244 into cloudflare:master May 27, 2022
@github-actions github-actions bot added this to the v3.16.0 milestone May 27, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2022

This functionality has been released in v3.16.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

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.

None yet

2 participants