-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Terraform] [WIP] autogenerate resource_dns_managed_zone #697
[Terraform] [WIP] autogenerate resource_dns_managed_zone #697
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks so much for doing this!
We probably want to keep resource_dns_managed_zone_test, or at the very least remove the basic test and leave the update test, or something like that- since the autogenerated tests don't test update yet. The v1 API actually does have support for update; it's just not documented. I filed a bug internally about that.
Also, adding fields in api.yaml will also update the non-terraform providers. Can you make sure they have descriptions in the PR description so that their generated PRs will have names? Once that's done I'll go ahead and trigger the magician (in the future it should trigger automatically on your PRs, but it doesn't for the first one from an individual).
d67cc61
to
1d75860
Compare
I've pushed updates with the requested changes, can you take a second look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I'll go ahead and modify the PR description so you can see what I was talking about, and then I'll start the magician run.
Ah, since you added a new field you also need to add |
c677e4a
to
339c17b
Compare
Done, removed the references to PATCH but updates now are done with PUT instead. |
4d826ae
to
3d7eb7e
Compare
I see that the generated code is now updating the resource with PUT, wouldn't it be better to do it with PATCH if the API supports it? Also, for some reason the ForceNew for name and dnsName are gone. |
I don't think there's much of a difference. If you think PATCH is better, then you're welcome to add it back with a comment explaining why :) Adding an |
I am a robot that works on MagicModules PRs! I built this PR into one or more PRs on other repositories, and when those are closed, this PR will also be merged and closed. |
- !ruby/object:Api::Type::String | ||
name: 'dnsName' | ||
description: | | ||
The DNS name of this managed zone, for instance "example.com.". | ||
required: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked through the API and this is required for creation.
In the end I also reverted the previous changes so that only the description and labels get updated, through PATCH. PATCH semantics is much cleaner as the request will have only the fields that change, and I confirmed that gcloud is also PATCHing these fields on update. The generated code is also easy to follow. |
And now the generated code passes the acceptance tests:
|
25e54d5
to
7b7bf12
Compare
I am (still) a robot that works on MagicModules PRs! I just wanted to let you know that your changes (as of commit 95e7e1f) have been included in your existing downstream PRs. |
f95de8c
to
03ee82d
Compare
I just tried running the magician again and it looks like the PR has merge conflicts. Mind fixing those and letting me know once you have? |
03ee82d
to
59caaab
Compare
I just rebased, can you check if that fixes the conflicts? |
59caaab
to
8d44f3a
Compare
I am (still) a robot that works on MagicModules PRs! I just wanted to let you know that your changes (as of commit 124d2a2) have been included in your existing downstream PRs. |
LGTM, thanks for doing this! |
Tracked submodules are build/terraform-beta build/terraform build/ansible build/inspec.
This is my first attempt on generating resource_dns_managed_zone using magic-modules.
As the module is generating only against the v1 version of the API for now, which does not support update/patch on the resource, the autogenerated tests are not testing update. I also didn't include support for RecordSets yet, as that will be more complex and I wanted to start simple.
I'm still trying to figure out how testing works, for example, how can my autogenerated tests be against a zone like "tf-acctest-%s.hashicorptest.com.", but not have that domain showing up in the generated docs.
[all]
Add labels and updates to DNS managed zone
[terraform]
Start autogenerating resource_dns_managed_zone
[terraform-beta]
[ansible]
[inspec]