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

Revathy/add webhooks resource #1151

Merged

Conversation

revathyrams
Copy link
Contributor

No description provided.

if err != nil {
return fmt.Errorf("error retrieving notification webhooks %s: %s", name, err)
}
id, err := uuid.Parse(notificationWebhooks.Result.ID)
Copy link
Member

Choose a reason for hiding this comment

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

if err != nil {
return fmt.Errorf("error setting notification webhooks %s: %s", name, err)
}
d.Set("id", id.String())
Copy link
Member

Choose a reason for hiding this comment

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

the Create should be suffice for setting the resource ID as we shouldn't need to change it after the fact. this value is often used as an "anchor" for lookups and should remain consistent.

side note: setting the resource ID should use d.SetId() as it is a special attribute.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this now and verified that the tests are passing.

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)

func TestAccCloudflareNotificationPolicyWebhooks(t *testing.T) {
Copy link
Member

Choose a reason for hiding this comment

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

acceptance tests are 🍏

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./...) -v -run "^TestAccCloudflareNotificationPolicyWebhooks" -timeout 120m -parallel 1
?   	github.com/cloudflare/terraform-provider-cloudflare	[no test files]
=== RUN   TestAccCloudflareNotificationPolicyWebhooks
--- PASS: TestAccCloudflareNotificationPolicyWebhooks (9.56s)
PASS
ok  	github.com/cloudflare/terraform-provider-cloudflare/cloudflare	10.261s
?   	github.com/cloudflare/terraform-provider-cloudflare/version	[no test files]

@jacobbednarz
Copy link
Member

couple of questions but nothing major! such speed for your 2nd PR!

@revathyrams revathyrams force-pushed the revathy/add-webhooks-resource branch from 0a1e31b to a3ac307 Compare August 5, 2021 19:11
@jacobbednarz jacobbednarz merged commit 1d7a76c into cloudflare:master Aug 6, 2021
@jacobbednarz
Copy link
Member

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