Implementing License Manager TF resource - configuration#17401
Implementing License Manager TF resource - configuration#17401pabloem wants to merge 14 commits into
Conversation
|
Googlers: For automatic test runs see go/terraform-auto-test-runs. @c2thorn, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit ecc411b: Diff reportYour PR generated the following diffs in downstream repositories:
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_license_manager_configuration" "primary" {
active = # value needed
configuration_id = # value needed
labels = # value needed
licensecount = # value needed
location = # value needed
product = # value needed
}
Missing service labelsThe following new resources do not have corresponding service labels:
If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels. Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 16 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the build log Step 2: Recording Mode
Caution Issues requiring attention before PR completion 🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details. Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer. View the build log or the debug logs folder for detailed results. |
|
@c2thorn This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
|
API was not enabled, restarting |
|
/gcbrun |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes for commit ecc411b: Diff reportYour PR generated the following diffs in downstream repositories:
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_license_manager_configuration" "primary" {
active = # value needed
configuration_id = # value needed
labels = # value needed
licensecount = # value needed
location = # value needed
product = # value needed
}
Missing service labelsThe following new resources do not have corresponding service labels:
If you believe this detection to be incorrect please raise the concern with your reviewer. Googlers: This error is safe to ignore once you've completed go/fix-missing-service-labels. Test reportAnalytics
Affected Service Packages
Step 1: Replaying Mode Action takenFound 19 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
View the build log Step 2: Recording Mode
Caution Issues requiring attention before PR completion 🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details. Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer. View the build log or the debug logs folder for detailed results. |
|
unable to see the error / log for our tests ... fwiw I was able to run it locally and it worked fine. |
| type: String | ||
| required: true | ||
| immutable: true | ||
| ignore_read: true |
There was a problem hiding this comment.
why are some of these fields ignore_read? Does the API not return values for them?
There was a problem hiding this comment.
we manipulate the fields in the go.tmpl files, so that's why they're marked as ignore_read. Isn't that the intention? The tests are working fine 🤔
| location = "us-central1" | ||
| configuration_id = "{{index $.Vars "configuration_id"}}" | ||
| product = "{{index $.Vars "product"}}" | ||
| licensecount = {{index $.Vars "licensecount"}} |
There was a problem hiding this comment.
I don't think you need a variable for each field here. They should be considered as id fields, the generator automatically appends a random suffix to them.
For example, we are getting this error:
resource_license_manager_configuration_generated_test.go:67: Step 1/3 error: Error running pre-apply plan: exit status 1
Error: Missing newline after argument
on terraform_plugin_test.tf line 16, in resource "google_licensemanager_configuration" "example-configuration":
16: licensecount = 10an4jxx3moe
An argument definition must end with a newline.
Which i believe is due to the random suffix.
There was a problem hiding this comment.
looking at your example block variable values, I think configuration_id is the only one needing the use of a variable, the rest can be hardcoded in this template.
| immutable: true | ||
| ignore_read: true | ||
| description: Name field (with URL) of the Product offered for SPLA. | ||
| - name: licensecount |
There was a problem hiding this comment.
it's really licensecount instead of licenseCount ?
There was a problem hiding this comment.
we have a complex nested field (currentBillingInfo.userCountBilling.userCount or currentBillingInfo.packCountBilling.packCount) - in this case, we decided to expose licensecount in the tf resource - does that make sense?
| obj["product"] = fmt.Sprintf("projects/%s/locations/%s/products/%s", project, region, product) | ||
|
|
||
| if _, ok := obj["displayName"]; !ok { | ||
| obj["displayName"] = configurationId + "-terraform" |
There was a problem hiding this comment.
Why is display Name not a configurable field?
There was a problem hiding this comment.
we discussed and decided to have a single name field that the user would have control over, so we derive others from that one. Does that make sense?
| obj["product"] = fmt.Sprintf("projects/%s/locations/%s/products/%s", project, region, product) | ||
|
|
||
| if _, ok := obj["displayName"]; !ok { | ||
| obj["displayName"] = configurationId + "-terraform" |
There was a problem hiding this comment.
we discussed and decided to have a single name field that the user would have control over, so we derive others from that one. Does that make sense?
| location = "us-central1" | ||
| configuration_id = "{{index $.Vars "configuration_id"}}" | ||
| product = "{{index $.Vars "product"}}" | ||
| licensecount = {{index $.Vars "licensecount"}} |
| type: String | ||
| required: true | ||
| immutable: true | ||
| ignore_read: true |
There was a problem hiding this comment.
we manipulate the fields in the go.tmpl files, so that's why they're marked as ignore_read. Isn't that the intention? The tests are working fine 🤔
| immutable: true | ||
| ignore_read: true | ||
| description: Name field (with URL) of the Product offered for SPLA. | ||
| - name: licensecount |
There was a problem hiding this comment.
we have a complex nested field (currentBillingInfo.userCountBilling.userCount or currentBillingInfo.packCountBilling.packCount) - in this case, we decided to expose licensecount in the tf resource - does that make sense?
Support for:
Result from custom test:
Note: Teamcity failure seems unrelated to my change (I fixed the licensemanager key appearing and now it;s only 'client') - see below @c2thorn