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

fix(#1578): allow github access groups to be created without a list of teams #1589

Conversation

cmackenzie1
Copy link
Contributor

@cmackenzie1 cmackenzie1 commented Apr 29, 2022

Previously, the contents of the github block were not serialized to input JSON being sent to the Cloudflare API unless there was at least one team specified, even though the teams field is optional.

This commit changes the behavior of the github block to create include, require and exclude blocks with github organizations without specifying a list of teams.

Testing was done on my personal Cloudflare Zero Trust account. Running terraform apply twice still results in "detected" changes even though they have been applied. I think this is related to issue #1553.

Closes #1578

@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.

@cmackenzie1 cmackenzie1 force-pushed the cole/1578-github-org-access branch from 9fdfc61 to a48a29c Compare April 29, 2022 00:49
@cmackenzie1 cmackenzie1 changed the title #1578: allow github access groups to be created without a list of teams 1578: allow github access groups to be created without a list of teams Apr 29, 2022
@cmackenzie1 cmackenzie1 force-pushed the cole/1578-github-org-access branch from a48a29c to e3c1211 Compare April 29, 2022 00:50
@cmackenzie1 cmackenzie1 changed the title 1578: allow github access groups to be created without a list of teams fix(#1578): allow github access groups to be created without a list of teams Apr 29, 2022
@cmackenzie1
Copy link
Contributor Author

@jacobbednarz I took a stab at resolving #1578, mind you this is only my second time updating a terraform provider so go easy on me 🙏

@jacobbednarz
Copy link
Member

acceptance tests look good here

TF_ACC=1 go test $(go list ./...) -v -run "^TestAccCloudflareAccessGroup" -count 1 -parallel 1 -timeout 120m -parallel 1
?   	github.com/cloudflare/terraform-provider-cloudflare	[no test files]
=== RUN   TestAccCloudflareAccessGroupConfig_Basic
--- PASS: TestAccCloudflareAccessGroupConfig_Basic (44.76s)
=== RUN   TestAccCloudflareAccessGroup_Exclude
--- PASS: TestAccCloudflareAccessGroup_Exclude (19.17s)
=== RUN   TestAccCloudflareAccessGroup_Require
--- PASS: TestAccCloudflareAccessGroup_Require (18.84s)
=== RUN   TestAccCloudflareAccessGroup_FullConfig
--- PASS: TestAccCloudflareAccessGroup_FullConfig (18.87s)
=== RUN   TestAccCloudflareAccessGroupWithIDP
--- PASS: TestAccCloudflareAccessGroupWithIDP (25.27s)
=== RUN   TestAccCloudflareAccessGroup_Updated
--- PASS: TestAccCloudflareAccessGroup_Updated (28.77s)
=== RUN   TestAccCloudflareAccessGroup_CreateAfterManualDestroy
--- PASS: TestAccCloudflareAccessGroup_CreateAfterManualDestroy (23.47s)
PASS
PASS	github.com/cloudflare/terraform-provider-cloudflare/cloudflare	180.013s
?   	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
Copy link
Member

if you add a CHANGELOG entry (notes above from the automation), we can get this merged.

…t a list of teams

Previously, the contents of the `github` block were not serialized to input JSON being sent to the Cloudflare API unless there was at least one team specified, even though the teams field is optional.
This commit changes the behavior of the `github` block to create `include`, `require` and `exclude` blocks with github organizations without specifying a list of teams.

Testing was done on my personal Cloudflare Zero Trust account. Running `terraform apply` twice still results in "detected" changes even though they have been applied. I think this is related to issue cloudflare#1553.
@cmackenzie1 cmackenzie1 force-pushed the cole/1578-github-org-access branch from e3c1211 to 3014f0a Compare April 29, 2022 16:05
@cmackenzie1
Copy link
Contributor Author

Thanks @jacobbednarz, added the changelog!

@jacobbednarz jacobbednarz merged commit f40ffd0 into cloudflare:master May 1, 2022
@github-actions github-actions bot added this to the v3.14.0 milestone May 1, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2022

This functionality has been released in v3.14.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.

cloudflare_access_group doesn't include github in require or include blocks in PUT request
2 participants