mmv1/docs: move write-only arguments into arguments section#15385
mmv1/docs: move write-only arguments into arguments section#15385BBBmau merged 19 commits intoGoogleCloudPlatform:mainfrom
mmv1/docs: move write-only arguments into arguments section#15385Conversation
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo_version = # value needed
}
}
|
Tests analyticsTotal tests: 1339 Click here to see the affected service packages
🟢 All tests passed! View the build log |
|
@melinath This PR has been waiting for review for 3 weekdays. Please take a look! Use the label |
mmv1/third_party/terraform/website/docs/guides/using_write_only_arguments.html.markdown
Show resolved
Hide resolved
ramonvermeulen
left a comment
There was a problem hiding this comment.
Couple of small typos, for the rest LGTM.
Could you elaborate a bit on this one, what is a write-only attribute within the context of an ephemeral resource? |
|
@GoogleCloudPlatform/terraform-team @melinath This PR has been waiting for review for 1 week. Please take a look! Use the label |
| {{- else }} | ||
| {{- if $.Required }} | ||
| (Required{{ if $.DeprecationMessage }}, Deprecated{{ end }}) | ||
| {{- else if and (or $.WriteOnlyLegacy $.WriteOnly) $.Required }} |
There was a problem hiding this comment.
won't we never reach this line, because if $.Required is true we'll always do the previous line?
I wonder if it's time for us to make a helper method on the Type that returns the list of things that go in parentheses (which we can format without knowing what each individual item means) instead of trying to build the string in the template like this.
Somewhat related: hashicorp/terraform-provider-google#18832 (Not saying that we need to fix that whole issue here or anything, but it could be relevant to consider when looking at potential solutions.)
There was a problem hiding this comment.
latest commit refactors this to include the ,WriteOnly generation nested within if $.Required
I'll look into that as I agree with how we'll want to handle the documentation generation of the type of field (Required, Optional, Write-only, etc.)
There was a problem hiding this comment.
read through your recent review, what i'll do is remove the code that involves the parantheses logic and just leave logic that involves moving it into the arguments section.
I'll follow up with a PR that introduces the helper function that you mention here
| {{- if or $.WriteOnlyLegacy $.WriteOnly }} | ||
| **Note**: This property is write-only and will not be read from the API. | ||
|
|
||
| * ~> **Note:** One of `{{ underscore $.Name }}` or `{{ underscore $.ApiName }}` can only be set. |
There was a problem hiding this comment.
It looks like the idea here is that the terraform name is the write-only field's name, while the underscore $.ApiName will be the "original field's" name. However, that won't be the case if the original field's terraform name doesn't match underscore $.ApiName. We'd always match the original field's terraform name + _wo so how about just trimming off the last three characters here?
The longer fix here would be to document all exactlyOneOf / conflicts constraints automatically - which might actually be feasible if we had a central registry as described in hashicorp/terraform-provider-google#24327 (comment). But that's out of scope for this PR.
mmv1/third_party/terraform/website/docs/guides/using_write_only_arguments.html.markdown
Show resolved
Hide resolved
mmv1/third_party/terraform/website/docs/guides/using_write_only_arguements.html.markdown
Outdated
Show resolved
Hide resolved
|
|
||
| The Google Cloud provider has added the following write-only attributes: | ||
| The Google Cloud provider has added the following write-only arguments: |
There was a problem hiding this comment.
This list is out of date. We probably should delete it / restructure this... but that can happen separately.
There was a problem hiding this comment.
agreed, noticed that we'd want to address how we handle this page from reviewing:
mmv1/third_party/terraform/website/docs/guides/using_write_only_arguements.html.markdown
Outdated
Show resolved
Hide resolved
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo_version = # value needed
}
}
|
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo_version = # value needed
}
}
|
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo_version = # value needed
}
}
|
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo_version = # value needed
}
}
|
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo_version = # value needed
}
}
|
Tests analyticsTotal tests: 1340 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Tests analyticsTotal tests: 1340 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Tests analyticsTotal tests: 1340 Click here to see the affected service packages
🟢 All tests passed! View the build log |
Tests analyticsTotal tests: 1340 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Tests analyticsTotal tests: 1340 Click here to see the affected service packages
🟢 All tests passed! View the build log |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo_version = # value needed
}
}
|
Tests analyticsTotal tests: 1340 Click here to see the affected service packages
🟢 All tests passed! View the build log |
|
@BBBmau, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days. Please address any comments or change requests, or re-request review from a core reviewer if no action is required. This notification can be disabled with the |
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo_version = # value needed
}
}
|
Tests analyticsTotal tests: 1348 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
Tests analyticsTotal tests: 1348 Click here to see the affected service packages
Action takenFound 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
|
🟢 Tests passed during RECORDING mode: 🟢 No issues found for passed tests after REPLAYING rerun. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
Tests analyticsTotal tests: 1348 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
| {{- if or $.WriteOnlyLegacy $.WriteOnly }} | ||
| **Note**: This property is write-only and will not be read from the API. | ||
|
|
||
| * ~> **Note:** One of `{{ underscore $.ApiName }}` or `{{ underscore $.ApiName }}_wo` can only be set. |
There was a problem hiding this comment.
This should be based on name, not ApiName (because the terraform name of the field might be different). I think this is the right logic but could be worth double-checking locally. (This doesn't seem to impact any current fields, but we might as well make sure it's doing the right thing now.)
| * ~> **Note:** One of `{{ underscore $.ApiName }}` or `{{ underscore $.ApiName }}_wo` can only be set. | |
| * ~> **Note:** One of `{{ slice (underscore $.Name) (sub (len underscore $.Name) 3) }}` or `{{ underscore $.Name }}` can only be set. |
There was a problem hiding this comment.
ran this and didn't quite work, this is the updated logic:
* ~> **Note:** One of `{{ slice (underscore $.Name) 0 (sub (len (underscore $.Name)) 3) }}` or `{{ underscore $.Name }}` can only be set.
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo_version = # value needed
}
}
|
Tests analyticsTotal tests: 1348 Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
melinath
left a comment
There was a problem hiding this comment.
One more small formatting fix, sorry for not catching this last time! I think this is the last one though. Feel free to ignore the nit.
| **Note**: This property is write-only and will not be read from the API. | ||
|
|
||
| * ~> **Note:** One of `{{ slice (underscore $.Name) 0 (sub (len (underscore $.Name)) 3) }}` or `{{ underscore $.Name }}` can only be set. |
There was a problem hiding this comment.
nit: It's a little weird to have these two notes right after each other. This isn't a blocker, especially since the second note will be a whole callout block.
mmv1/templates/terraform/property_documentation.html.markdown.tmpl
Outdated
Show resolved
Hide resolved
…tmpl Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
|
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are.
Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_bigquery_data_transfer_config" "primary" {
sensitive_params {
secret_access_key_wo_version = # value needed
}
}
|
Tests analyticsTotal tests: 1349 Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
|
|
🟢 Tests passed during RECORDING mode: 🔴 Tests failed when rerunning REPLAYING mode: Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made. Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer. 🔴 Tests failed during RECORDING mode: 🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR. |
6f0b90f
…ogleCloudPlatform#15385) Co-authored-by: Ramon Vermeulen <ramonvermeulen98@gmail.com> Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
…ogleCloudPlatform#15385) Co-authored-by: Ramon Vermeulen <ramonvermeulen98@gmail.com> Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
…ogleCloudPlatform#15385) Co-authored-by: Ramon Vermeulen <ramonvermeulen98@gmail.com> Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>
…ogleCloudPlatform#15385) Co-authored-by: Ramon Vermeulen <ramonvermeulen98@gmail.com> Co-authored-by: Stephen Lewis (Burrows) <stephen.r.burrows@gmail.com>

This updates the generation of docs to remove the ephemeral attributes section in favor of having it be part of the arguments section to prevent any more confusion in the future. It also includes overall improvements to the doc generation for write-only arguments such as:
write-only arguments)ephemeral resourcesIdeally i would've liked to have the write-only field be grouped with its original field, though this would take much more work to do. I've included a Note that mentions the need to only set one field
wo or non-woto resolve this.Fixes hashicorp/terraform-provider-google#24702
Release Note Template for Downstream PRs (will be copied)
See Write release notes for guidance.