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

test:add a scenario test for unset fields in bigquerydataset #3329

Merged

Conversation

xiaoweim
Copy link
Collaborator

@xiaoweim xiaoweim commented Dec 6, 2024

This PR adds a scenario test to log the behavior of the BigQueryDataset terraform controller when updating the resource with fields unset

  • Terraform finds the existing values of the unset field and maintain the value.

This test will later be used to verify the behavior of direct controller being backward compatible after #3125 is merged.

  • Run make ready-pr to ensure this PR is ready for review.
  • Perform necessary E2E testing for changed resources.

@xiaoweim xiaoweim force-pushed the bqds_test_unset_fields branch from 58e48f5 to bc7a9bc Compare December 6, 2024 06:34
@xiaoweim
Copy link
Collaborator Author

xiaoweim commented Dec 6, 2024

/assign @jingyih

@xiaoweim xiaoweim force-pushed the bqds_test_unset_fields branch from 27c48e2 to fa66e51 Compare December 10, 2024 01:06
@xiaoweim xiaoweim force-pushed the bqds_test_unset_fields branch from fa66e51 to c3244de Compare December 10, 2024 01:14
@xiaoweim
Copy link
Collaborator Author

/assign @acpana

Copy link
Collaborator

@jingyih jingyih left a comment

Choose a reason for hiding this comment

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

/lgtm

@google-oss-prow google-oss-prow bot added the lgtm label Dec 10, 2024
@xiaoweim
Copy link
Collaborator Author

/assign @maqiuyujoyce

@maqiuyujoyce
Copy link
Collaborator

This PR adds a scenario test to log the behavior of the BigQueryDataset terraform controller when updating the resource with fields unset

  • Terraform finds the existing values of the unset field and maintain the value.

Unsetting a field in a CR and reconcile it via the TF-based/DCL-based controller is to unmanage the field. @xiaoweim when you mentioned Terraform finds the existing values of the unset field and maintain the value. did you mean the TF lib or the TF-based controller maintains the value? If it is the TF lib (e.g. resource_bigquery_dataset.go having some special logic) then do we know why?

This test will later be used to verify the behavior of direct controller being backward compatible after #3125 is merged.

If it is the TF-based controller maintains the values of the unset fields, then I think those become externally-managed fields. @cheftako @yuwenma is it the correct understanding that we still support backwards compatibility of externally-managed fields feature when we migrate a resource to direct?

@jingyih
Copy link
Collaborator

jingyih commented Dec 10, 2024

My understanding is that, the purpose of this test is to document the current behavior of the TF-based implementation, ensuring we keep the same behavior in the direct controller.

@maqiuyujoyce
Copy link
Collaborator

@jingyih yes, I understand. In that case, does it mean we don't plan to / don't need to support the actual unsetting of those fields (i.e. fields not set in the underlying GCP resource)?

@jingyih
Copy link
Collaborator

jingyih commented Dec 10, 2024

@jingyih yes, I understand. In that case, does it mean we don't plan to / don't need to support the actual unsetting of those fields (i.e. fields not set in the underlying GCP resource)?

Maybe I am missing some context, but my initial understanding was that this resource is widely used, so we aim to preserve its existing behavior while migrating its implementation to a direct controller. Is there a specific bug or issue with this resource that requires properly unsetting the field?

@maqiuyujoyce
Copy link
Collaborator

Is there a specific bug or issue with this resource that requires properly unsetting the field?

I don't recall any myself. Double checking just in case!

@yuwenma
Copy link
Collaborator

yuwenma commented Dec 11, 2024

Maybe I am missing some context, but my initial understanding was that this resource is widely used, so we aim to preserve its existing behavior while migrating its implementation to a direct controller. Is there a specific bug or issue with this resource that requires properly unsetting the field?

@jingyih that's correct! Thanks for the explanation.

@xiaoweim Could you upload both direct and tf-based log so we can do the comparison?

@jingyih
Copy link
Collaborator

jingyih commented Dec 11, 2024

Maybe I am missing some context, but my initial understanding was that this resource is widely used, so we aim to preserve its existing behavior while migrating its implementation to a direct controller. Is there a specific bug or issue with this resource that requires properly unsetting the field?

@jingyih that's correct! Thanks for the explanation.

@xiaoweim Could you upload both direct and tf-based log so we can do the comparison?

Log for direct controller implementation is pending the go client migration PR #3125.

@xiaoweim
Copy link
Collaborator Author

Maybe I am missing some context, but my initial understanding was that this resource is widely used, so we aim to preserve its existing behavior while migrating its implementation to a direct controller. Is there a specific bug or issue with this resource that requires properly unsetting the field?

@jingyih that's correct! Thanks for the explanation.
@xiaoweim Could you upload both direct and tf-based log so we can do the comparison?

Log for direct controller implementation is pending the go client migration PR #3125.

Yes @yuwenma , Jingyi is right. The direct controller log will be reflected later after PR #3125 is merged.

@maqiuyujoyce
Copy link
Collaborator

/approve
/hold

Hold in case @yuwenma has further comments but overall lgtm.

Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maqiuyujoyce

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@yuwenma
Copy link
Collaborator

yuwenma commented Dec 12, 2024

Maybe I am missing some context, but my initial understanding was that this resource is widely used, so we aim to preserve its existing behavior while migrating its implementation to a direct controller. Is there a specific bug or issue with this resource that requires properly unsetting the field?

@jingyih that's correct! Thanks for the explanation.
@xiaoweim Could you upload both direct and tf-based log so we can do the comparison?

Log for direct controller implementation is pending the go client migration PR #3125.

Yes @yuwenma , Jingyi is right. The direct controller log will be reflected later after PR #3125 is merged.

That's fine. Can we have #3125 goes in first and then update this PR to include both TF-based and direct log?

@yuwenma
Copy link
Collaborator

yuwenma commented Dec 12, 2024

/hold cancel

@google-oss-prow google-oss-prow bot merged commit 989a8c0 into GoogleCloudPlatform:master Dec 12, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants