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

Make tpgtools generate beta docs into GA as well for parity with mmv1. #5325

Merged
merged 5 commits into from
Nov 10, 2021

Conversation

nat-henderson
Copy link
Contributor

Also, minor changes to make sure that the docs are a little bit better - allow overrides of documentation values, for instance.

Also, includes the actual description of the resource, which, at the moment is not acceptable in the DCL. Will need to implement an override in the DCL.

Fixes the worst of hashicorp/terraform-provider-google#10252, bringing the urgency down to "we need better docstrings for these fields". I'll get to that soon.

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).
  • Generated Terraform, and ran make test and make lint to ensure it passes unit and linter tests.
  • 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).
  • Ran relevant acceptance tests (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

all: fixed an issue where some documentation for new resources was not showing up in the GA provider if it was beta-only.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 6 files changed, 101 insertions(+), 8 deletions(-))
Terraform Beta: Diff ( 5 files changed, 14 insertions(+), 14 deletions(-))

@@ -48,7 +48,7 @@ func mergeResource(res *Resource, resources map[Version][]*Resource, version *Ve
}
return ga
}
beta.Description = "Beta only"
beta.Description = fmt.Sprintf("Beta only: %s", beta.Description)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I'm fairly certain that adding this as-is is worse than having nothing there- "DCL specification for X" is completely meaningless, and there is zero discoverability on what "DCL" means. We should update the description for the affected resources before this part of the change, at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree - I didn't look at how bad those were. I'll put this change on hold until that's fixed.

tpgtools/main.go Outdated
@@ -90,6 +90,12 @@ func main() {
generateResourceFile(resource)
generateSweeperFile(resource)
generateResourceTestFile(resource)
}
// Website files are always generated for the beta version.
for _, resource := range resources[BETA_VERSION] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we guard this on just the GA version and used the specified version otherwise? w/ the alpha version, we'll want to generate the alpha website.

- substitution: "project"
value: ":PROJECT"
docs_value: "preexisting-project-to-monitor-with"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mentioned offline that the DCL provided sample values, but I'm not seeing them in https://github.com/GoogleCloudPlatform/declarative-resource-client-library/blob/main/services/google/monitoring/samples/basic_monitored_project.yaml. Do they not exist? Keeping values for every field in every sample seems onerous.

@google-cla
Copy link

google-cla bot commented Oct 26, 2021

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 12 files changed, 140 insertions(+), 45 deletions(-))
Terraform Beta: Diff ( 12 files changed, 51 insertions(+), 49 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceGoogleSQLCaCerts_basic|TestAccAssuredWorkloadsWorkload_BasicHandWritten|TestAccAssuredWorkloadsWorkload_FullHandWritten|TestAccCloudRunService_cloudRunServiceSqlExample|TestAccComputeFirewallPolicyRule_update|TestAccContainerCluster_withAuthenticatorGroupsConfig|TestAccContainerNodePool_withWorkloadIdentityConfig|TestAccDataprocWorkflowTemplate_basic|TestAccEventarcTrigger_BasicHandWritten|TestAccMonitoringMonitoredProject_BasicMonitoredProject|TestAccOrgPolicyPolicy_EnforcePolicy|TestAccOrgPolicyPolicy_ProjectPolicy|TestAccOrgPolicyPolicy_FolderPolicy|TestAccOrgPolicyPolicy_OrganizationPolicy|TestAccPrivatecaCertificateTemplate_BasicCertificateTemplate|TestAccSQLDatabase_sqlDatabaseBasicExample|TestAccSqlDatabaseInstance_basicSecondGen|TestAccSqlDatabaseInstance_basicMSSQL|TestAccSqlDatabaseInstance_settings_basic|TestAccSqlDatabaseInstance_settings_deletionProtection|TestAccSqlDatabaseInstance_slave|TestAccSqlDatabaseInstance_diskspecs|TestAccSqlDatabaseInstance_maintenance|TestAccSqlDatabaseInstance_settings_upgrade|TestAccSqlDatabaseInstance_settingsDowngrade|TestAccSqlDatabaseInstance_authNets|TestAccSqlDatabaseInstance_multipleOperations|TestAccSqlDatabaseInstance_basic_with_user_labels|TestAccSqlDatabaseInstance_withPrivateNetwork|TestAccSqlDatabase_basic|TestAccSqlDatabase_update|TestAccSqlClientCert_mysql|TestAccSqlUser_postgresIAM You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=212770

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccOrgPolicyPolicy_EnforcePolicy|TestAccMonitoringMonitoredProject_BasicMonitoredProject|TestAccOrgPolicyPolicy_ProjectPolicy|TestAccEventarcTrigger_BasicHandWritten|TestAccAssuredWorkloadsWorkload_BasicHandWritten|TestAccAssuredWorkloadsWorkload_FullHandWritten|TestAccComputeFirewallPolicyRule_update|TestAccContainerCluster_withAuthenticatorGroupsConfig|TestAccSqlDatabaseInstance_basicMSSQL|TestAccSqlUser_postgresIAM Please fix these to complete your PR

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 12 files changed, 140 insertions(+), 45 deletions(-))
Terraform Beta: Diff ( 12 files changed, 51 insertions(+), 49 deletions(-))

Also, minor changes to make sure that the docs are a little bit better - allow overrides of documentation values, for instance.

Also, includes the actual description of the resource, which, at the moment is not acceptable in the DCL.  Will need to implement an override in the DCL.
@nat-henderson
Copy link
Contributor Author

Okay - as long as those tests pass overnight, should be good to review. I'll mark it non-draft after checking.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 12 files changed, 153 insertions(+), 41 deletions(-))
Terraform Beta: Diff ( 21 files changed, 71 insertions(+), 53 deletions(-))

@nat-henderson
Copy link
Contributor Author

Okay, this looks right to me.

@nat-henderson nat-henderson marked this pull request as ready for review October 28, 2021 17:33
@nat-henderson
Copy link
Contributor Author

Assured workloads and eventarc still have messy docs. Fixing that on the DCL side involves diving into more complicated overrides. If you'll accept this (imo, clear improvement) as is, I'll fix that on our end separately, and we'll get the fix when it can be done on our end.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician. Your PR generated some diffs in downstreams - here they are.

Diff report:

Terraform GA: Diff ( 12 files changed, 155 insertions(+), 41 deletions(-))
Terraform Beta: Diff ( 12 files changed, 69 insertions(+), 48 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDatasourceGoogleServiceNetworkingPeeredDnsDomain_basic|TestAccAssuredWorkloadsWorkload_BasicHandWritten|TestAccAssuredWorkloadsWorkload_FullHandWritten|TestAccCloudFunctionsFunction_vpcConnector|TestAccComputeInstanceFromMachineImage_basic|TestAccComputeInstanceFromMachineImage_overrideMetadataDotStartupScript|TestAccComputeInstanceFromMachineImage_diffProject|TestAccComputeRegionNetworkEndpointGroup_regionNetworkEndpointGroupAppengineExample|TestAccComputeServiceAttachment_serviceAttachmentBasicExampleUpdate|TestAccContainerNodePool_withWorkloadIdentityConfig|TestAccEventarcTrigger_BasicHandWritten|TestAccMonitoringMonitoredProject_BasicMonitoredProject|TestAccOrgPolicyPolicy_EnforcePolicy|TestAccOrgPolicyPolicy_FolderPolicy|TestAccOrgPolicyPolicy_ProjectPolicy|TestAccPrivatecaCertificateTemplate_BasicCertificateTemplate|TestAccSqlDatabaseInstance_withPrivateNetwork|TestAccSqlUser_postgresIAM You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=217340

@rileykarson
Copy link
Member

There's a failure in TestAccEventarcTrigger_BasicHandWritten that appears related, btw!

@nat-henderson
Copy link
Contributor Author

Nuts, thanks.

@rileykarson rileykarson mentioned this pull request Nov 12, 2021
5 tasks
betsy-lichtenberg pushed a commit to betsy-lichtenberg/magic-modules that referenced this pull request Apr 25, 2022
GoogleCloudPlatform#5325)

* Make tpgtools generate beta docs into GA as well for parity with mmv1.

Also, minor changes to make sure that the docs are a little bit better - allow overrides of documentation values, for instance.

Also, includes the actual description of the resource, which, at the moment is not acceptable in the DCL.  Will need to implement an override in the DCL.

* Generate reasonable documentation for autogenerated and handwritten tests.

* Default to - instead of _

* Improve documentation further with links and guides.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants