Adding support for Org policy custom constraints
If this PR is for Terraform, I acknowledge that I have:
- [ ] Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
- [X] Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
- [ ] Generated Terraform providers, and ran
make testandmake lintin the generated providers to ensure it passes unit and linter tests. - [ ] Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
- [X] Read the Release Notes Guide before writing my release note below.
Release Note Template for Downstream PRs (will be copied)
added org policy custom constraint resource
Oops! It looks like you're using an unknown release-note type in your changelog entries:
- REPLACEME
Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.
/gcbrun
Hi there, I'm the Modular magician. I've detected the following information about your changes:
Diff report
Your PR generated some diffs in downstreams - here they are.
TF Validator: Diff ( 7 files changed, 495 insertions(+))
Tests analytics
Total tests: 2568
Passed tests 2293
Skipped tests: 267
Affected tests: 8
Action taken
Found 8 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccNetworkServicesGateway_update|TestAccFrameworkProviderBasePath_setBasePath|TestAccFrameworkProviderMeta_setModuleName|TestAccComputeInstanceFromRegionTemplate_basic|TestAccDataSourceDnsManagedZone_basic|TestAccDataSourceDnsRecordSet_basic|TestAccDataSourceDNSKeys_noDnsSec|TestAccDataSourceDNSKeys_basic
Tests passed during RECORDING mode:
TestAccNetworkServicesGateway_update[Debug log]
TestAccFrameworkProviderBasePath_setBasePath[Debug log]
TestAccFrameworkProviderMeta_setModuleName[Debug log]
TestAccComputeInstanceFromRegionTemplate_basic[Debug log]
TestAccDataSourceDnsManagedZone_basic[Debug log]
TestAccDataSourceDnsRecordSet_basic[Debug log]
TestAccDataSourceDNSKeys_noDnsSec[Debug log]
TestAccDataSourceDNSKeys_basic[Debug log]
All tests passed View the build log or the debug log for each test
Overall code looks good to me, and the changes make sense to me as an add-on of the initial Terraform implementation of this resource. Note that this repo should autogenerate and merge the code needed for the validator, so I believe you can close https://github.com/GoogleCloudPlatform/terraform-validator/pull/1491. There is actually a link in one of the comments that shows what will be generated ("TF Validator: Diff ( 7 files changed, 495 insertions(+))").
One part that I wasn't able to review as thoroughly was the CAI -> APIObject code. When you're done with that function, could you possibly provide references to those models so we can verify?
And lastly, here is the validator-test failure (the failing GitHub Check):
--- FAIL: TestReadPlannedAssetsCoverage (0.00s)
--- FAIL: TestReadPlannedAssetsCoverage/example_org_policy_custom_constraint (0.02s)
init_test.go:122: Successfully created file /tmp/terraform1916759436/example_org_policy_custom_constraint.json
init_test.go:122: Successfully created file /tmp/terraform1916759436/example_org_policy_custom_constraint.tfplan.json
read_test.go:148: cannot unmarshal JSON into assets: json: cannot unmarshal array into Go struct field testAsset.ancestry_path of type string
FAIL
FAIL github.com/GoogleCloudPlatform/terraform-validator/test 0.608s
ok github.com/GoogleCloudPlatform/terraform-validator/tfdata 0.166s
ok github.com/GoogleCloudPlatform/terraform-validator/tfgcv 0.181s
ok github.com/GoogleCloudPlatform/terraform-validator/tfplan 0.005s
? github.com/GoogleCloudPlatform/terraform-validator/version [no test files]
FAIL
@GoogleCloudPlatform/terraform-team This PR has been waiting for review for 3 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.
Hey! I'm closing this PR as a part of a cleanup of older inactive PRs, using a threshold of PRs last updated over 3 months ago. This doesn't represent rejection of the change, and feel free to comment for me to reopen it if you plan to pick it back up, or feel free to start a new PR with the same changes in the future.