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

Added tag product and tagkey resource #4565

Merged
merged 19 commits into from
Mar 17, 2021

Conversation

melinath
Copy link
Member

@melinath melinath commented Mar 4, 2021

Related to hashicorp/terraform-provider-google#8428

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)

`google_tags_tag_key`

@google-cla google-cla bot added the cla: yes label Mar 4, 2021
@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@melinath melinath force-pushed the tpg-8428-tagkey branch 2 times, most recently from cb72024 to 41870a3 Compare March 5, 2021 18:14
@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccServiceUsageConsumerQuotaOverride_regionConsumerQuotaOverrideExample|TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated Please fix these to complete your PR

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@melinath
Copy link
Member Author

It looks like only 100 of the 240 failing tests got retried; I'll try a new /gcbrun. In the meantime, here's a run for the tags tests specifically: https://ci-oss.hashicorp.engineering/buildConfiguration/GoogleCloudBeta_ProviderGoogleCloudBetaMmUpstream/177518

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@melinath
Copy link
Member Author

Sorry, tests are still failing after all. I'll ping you when I have them fixed.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@modular-magician

This comment has been minimized.

@melinath
Copy link
Member Author

@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 ( 4 files changed, 156 insertions(+))
Terraform Beta: Diff ( 10 files changed, 927 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=177534"

@modular-magician

This comment has been minimized.

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccComposerEnvironment_withEncryptionConfig|TestAccComputeInstance_IP|TestAccComputeInstance_diskEncryption|TestAccComputeInstance_networkTier|TestAccComputeInstance_PTRRecord|TestAccComputeInstance_attachedDisk_sourceUrl|TestAccComputeInstance_diskEncryptionRestart|TestAccComputeInstance_attachedDisk|TestAccComputeInstance_bootDisk_sourceUrl|TestAccComputeInstance_attachedDisk_modeRo|TestAccComputeInstance_bootDisk_source|TestAccComputeInstance_kmsDiskEncryption|TestAccComputeInstance_bootDisk_type|TestAccComputeInstance_bootDisk_mode|TestAccComputeInstance_scratchDisk|TestAccComputeInstance_serviceAccount|TestAccComputeInstance_forceNewAndChangeMetadata|TestAccComputeInstance_update|TestAccComputeInstance_subnet_auto|TestAccComputeInstance_subnet_custom|TestAccComputeInstance_networkIPAuto|TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeInstance_scheduling|TestAccComputeInstance_network_ip_custom|TestAccComputeInstance_attachedDiskUpdate|TestAccComputeInstance_private_image_family|TestAccComputeInstance_stopInstanceToUpdate|TestAccComputeInstance_multiNic|TestAccComputeInstance_forceChangeMachineTypeManually|TestAccComputeInstance_guestAccelerator|TestAccComputeInstance_minCpuPlatform|TestAccComputeInstance_guestAcceleratorSkip|TestAccComputeInstance_deletionProtectionExplicitFalse|TestAccComputeInstance_primaryAliasIpRange|TestAccComputeInstance_hostname|TestAccComputeInstance_secondaryAliasIpRange|TestAccComputeInstance_deletionProtectionExplicitTrueAndUpdateFalse|TestAccComputeInstanceConfidentialInstanceConfigMain|TestAccComputeInstance_shieldedVmConfig|TestAccComputeInstance_desiredStatusOnCreation|TestAccComputeInstance_updateRunning_desiredStatusNotSet_notAllowStoppingForUpdate|TestAccComputeInstance_enableDisplay|TestAccComputeInstance_updateRunning_desiredStatusRunning_allowStoppingForUpdate|TestAccComputeInstance_updateRunning_desiredStatusRunning_notAllowStoppingForUpdate|TestAccComputeInstance_desiredStatusTerminatedUpdateFields|TestAccComputeInstance_updateRunning_desiredStatusTerminated_allowStoppingForUpdate|TestAccComputeInstance_updateRunning_desiredStatusTerminated_notAllowStoppingForUpdate|TestAccComputeInstance_resourcePolicyCollocate|TestAccComputeInstance_updateTerminated_desiredStatusNotSet_allowStoppingForUpdate|TestAccComputeInstance_desiredStatusUpdateBasic|TestAccComputeInstance_updateTerminated_desiredStatusTerminated_allowStoppingForUpdate|TestAccComputeInstance_updateTerminated_desiredStatusNotSet_notAllowStoppingForUpdate|TestAccComputeInstance_updateTerminated_desiredStatusTerminated_notAllowStoppingForUpdate|TestAccComputeInstance_updateTerminated_desiredStatusRunning_notAllowStoppingForUpdate|TestAccComputeInstance_updateTerminated_desiredStatusRunning_allowStoppingForUpdate|TestAccComputeInstance_subnetworkUpdate|TestAccComputeNodeTemplate_nodeTemplateServerBindingExample|TestAccComputePerInstanceConfig_update|TestAccComputeRegionAutoscaler_regionAutoscalerBasicExample|TestAccComputeRegionAutoscaler_scaleDownControl|TestAccComputeRegionAutoscaler_scalingSchedule|TestAccComputeRegionAutoscaler_update|TestAccComputeRegionAutoscaler_scaleInControl|TestAccComputeRegionBackendService_regionBackendServiceBalancingModeExample|TestAccComputeRegionBackendService_withBackendInternal|TestAccComputeRegionBackendService_withBackendMultiNic|TestAccComputeRegionBackendService_withBackendInternalManaged|TestAccComputeRegionDiskResourcePolicyAttachment_regionDiskResourcePolicyAttachmentBasicExample|TestAccComputeRegionBackendService_ilbUpdateFull|TestAccRegionInstanceGroupManager_basic|TestAccRegionInstanceGroupManager_targetSizeZero|TestAccRegionInstanceGroupManager_versions|TestAccRegionInstanceGroupManager_distributionPolicy|TestAccRegionInstanceGroupManager_autoHealingPolicies|TestAccRegionInstanceGroupManager_stateful|TestAccRegionInstanceGroupManager_update|TestAccComputeRegionPerInstanceConfig_update|TestAccComputeResourcePolicy_attached|TestAccComputeRoute_hopInstance|TestAccComputeSnapshot_snapshotBasicExample|TestAccComputeSnapshot_encryption|TestAccComputeTargetInstance_targetInstanceBasicExample|TestAccComputeTargetPool_basic|TestAccComputeTargetInstance_targetInstanceCustomNetworkExample|TestAccContainerAnalysisOccurrence_basic|TestAccContainerAnalysisOccurrence_multipleSignatures|TestAccContainerCluster_withAddons|TestAccContainerCluster_withReleaseChannelEnabledDefaultVersion|TestAccContainerCluster_withVersion|TestAccContainerCluster_withWorkloadMetadataConfig|TestAccContainerCluster_withSandboxConfig|TestAccContainerCluster_nodeAutoprovisioning|TestAccContainerCluster_nodeAutoprovisioningDefaults|TestAccContainerCluster_nodeAutoprovisioningDefaultsMinCpuPlatform|TestAccContainerCluster_withWorkloadIdentityConfig|TestAccContainerCluster_withDatabaseEncryption|TestAccContainerNodePool_withWorkloadIdentityConfig|TestAccContainerNodePool_withInvalidUpgradeSettings|TestAccContainerNodePool_withGPU|TestAccContainerNodePool_withKubeletConfig You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=177550"

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccComputeInstance_scheduling|TestAccComputeInstance_soleTenantNodeAffinities|TestAccComputeInstance_secondaryAliasIpRange|TestAccComputeInstance_updateRunning_desiredStatusTerminated_allowStoppingForUpdate|TestAccComputeInstance_desiredStatusTerminatedUpdateFields|TestAccComputeInstance_updateRunning_desiredStatusRunning_allowStoppingForUpdate|TestAccComputeInstance_desiredStatusUpdateBasic|TestAccComputeInstance_shieldedVmConfig|TestAccComputeInstance_enableDisplay|TestAccComposerEnvironment_withEncryptionConfig Please fix these to complete your PR

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Couple questions, but nothing blocking

name: Tags
versions:
- !ruby/object:Api::Product::Version
name: beta
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this in beta with a "v3" api?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

well, I guess technically it's in "Preview"

- !ruby/object:Api::Type::String
name: parent
description: |
Input only. The resource name of the new TagKey's parent. Must be of the form organizations/{org_id}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be a project instead of an organization?

Copy link
Member Author

Choose a reason for hiding this comment

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

I imagine that's the plan, but for now the documentation specifically says parent has to be formatted as an organization. Do you think I should check whether using a project works? https://cloud.google.com/resource-manager/reference/rest/v3/tagKeys

"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
)

// Tags tests cannot be run in parallel without running into Error Code 10: ABORTED
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need any warning on this in the resource itself? Maybe that two tags can't be applied on the same resource at the same time?

Copy link
Member Author

@melinath melinath Mar 16, 2021

Choose a reason for hiding this comment

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

I think it should be fine for normal users of terraform - I set up a mutex lock, so a local terraform process should only ever try to create one tag at a time. (And for users who do run into the error due to concurrent users, the message is pretty clear, I think?)

does that address your concern?

@melinath
Copy link
Member Author

@melinath
Copy link
Member Author

tag tests are passing! 🎉

@melinath
Copy link
Member Author

I'm going ahead with a merge on this so I can get started on the other tag resources, but I'm happy to do follow-on PRs for tagkey as well.

@melinath melinath merged commit 16ca167 into GoogleCloudPlatform:master Mar 17, 2021
@melinath melinath deleted the tpg-8428-tagkey branch March 17, 2021 15:23
melinath added a commit to melinath/magic-modules that referenced this pull request Mar 17, 2021
It got out of sync with changes to the api.yaml file from GoogleCloudPlatform#4565
melinath added a commit that referenced this pull request Mar 17, 2021
It got out of sync with changes to the api.yaml file from #4565
modular-magician added a commit to modular-magician/terraform-provider-google-beta that referenced this pull request Mar 17, 2021
It got out of sync with changes to the api.yaml file from GoogleCloudPlatform/magic-modules#4565

Signed-off-by: Modular Magician <[email protected]>
modular-magician added a commit to hashicorp/terraform-provider-google-beta that referenced this pull request Mar 17, 2021
It got out of sync with changes to the api.yaml file from GoogleCloudPlatform/magic-modules#4565

Signed-off-by: Modular Magician <[email protected]>
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