magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

fix: (storagetransfer) transfer path can be changed to empty string

Open gurusai-voleti opened this issue 1 year ago • 44 comments

Release Note Template for Downstream PRs (will be copied) Fixes: https://github.com/hashicorp/terraform-provider-google/issues/13673 Fixes: https://github.com/hashicorp/terraform-provider-google/issues/20421 See Write release notes for guidance.

storagetransfer: fix to allow empty string for path

gurusai-voleti avatar Nov 20 '24 13:11 gurusai-voleti

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 12 insertions(+), 2 deletions(-)) google-beta provider: Diff ( 1 file changed, 12 insertions(+), 2 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.azure_blob_storage_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_storage_transfer_job (25 total tests) Please add an acceptance test which includes these fields. The test should include the following:

resource "google_storage_transfer_job" "primary" {
  transfer_spec {
    azure_blob_storage_data_source {
      path = # value needed
    }
  }
}


modular-magician avatar Nov 20 '24 13:11 modular-magician

Tests analytics

Total tests: 11 Passed tests: 11 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • storagetransfer

🟢 All tests passed!

View the build log

modular-magician avatar Nov 20 '24 13:11 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 6 insertions(+), 1 deletion(-)) google-beta provider: Diff ( 1 file changed, 6 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

modular-magician avatar Nov 20 '24 13:11 modular-magician

Tests analytics

Total tests: 11 Passed tests: 11 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • storagetransfer

🟢 All tests passed!

View the build log

modular-magician avatar Nov 20 '24 13:11 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 122 insertions(+), 4 deletions(-)) google-beta provider: Diff ( 2 files changed, 122 insertions(+), 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

modular-magician avatar Nov 21 '24 06:11 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 122 insertions(+), 4 deletions(-)) google-beta provider: Diff ( 2 files changed, 122 insertions(+), 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

modular-magician avatar Nov 21 '24 06:11 modular-magician

Tests analytics

Total tests: 12 Passed tests: 11 Skipped tests: 0 Affected tests: 1

Click here to see the affected service packages
  • storagetransfer

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccStorageTransferJob_transferPathError

Get to know how VCR tests work

modular-magician avatar Nov 21 '24 06:11 modular-magician

🟢 Tests passed during RECORDING mode: TestAccStorageTransferJob_transferPathError [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

modular-magician avatar Nov 21 '24 06:11 modular-magician

Tests analytics

Total tests: 12 Passed tests: 11 Skipped tests: 0 Affected tests: 1

Click here to see the affected service packages
  • storagetransfer

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccStorageTransferJob_transferPathError

Get to know how VCR tests work

modular-magician avatar Nov 21 '24 06:11 modular-magician

🟢 Tests passed during RECORDING mode: TestAccStorageTransferJob_transferPathError [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

modular-magician avatar Nov 21 '24 06:11 modular-magician

Please link the issue in PR description that you are resolving.

kautikdk avatar Nov 21 '24 06:11 kautikdk

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 122 insertions(+), 4 deletions(-)) google-beta provider: Diff ( 2 files changed, 122 insertions(+), 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

Path is set as computed field which is user provided, i see it setup incorrectly as a computed field, so removed it and added validation as GCS bucket paths cannot be started with / and added diffsuppressfunc to revert to "" empty string as well

gurusai-voleti avatar Nov 21 '24 08:11 gurusai-voleti

Can you please briefly explain your solution and how it will allow users to set empty string in path field?

kautikdk avatar Nov 21 '24 09:11 kautikdk

Can you please briefly explain your solution and how it will allow users to set empty string in path field?

Path is an optional field, if not provided at first tf apply it is set to empty string, but in the customer reported issue they used "/" first and later realized to change to "" empty string which they cannot as in update d.HasChanges will not detect empty string as a change and an empty string cannot be considered for computed field as per terraform sdk (error occurred with computed set to true A computed value with the empty string as the new value and a non-empty old value was found. Interpreting the empty string as "unset" to align with legacy behavior.) so tf plan/apply will show no changes required, so removed computed for the field

as d.HasChanges and computed cannot consider empty string as a change or input, added DiffSuppressFunc if the old and new is same it will not show any difference in tf plan, if its different it will show difference in tf plan and path can be updated to "" empty string and added validation to the path field as gcs object path cannot be started with "/" (reference here https://cloud.google.com/storage-transfer/docs/reference/rest/v1/GcsData)

gurusai-voleti avatar Nov 21 '24 09:11 gurusai-voleti

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 127 insertions(+), 4 deletions(-)) google-beta provider: Diff ( 2 files changed, 127 insertions(+), 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

modular-magician avatar Nov 21 '24 10:11 modular-magician

Tests analytics

Total tests: 12 Passed tests: 12 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • storagetransfer

🟢 All tests passed!

View the build log

modular-magician avatar Nov 21 '24 10:11 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 129 insertions(+), 4 deletions(-)) google-beta provider: Diff ( 2 files changed, 129 insertions(+), 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

modular-magician avatar Nov 21 '24 10:11 modular-magician

Tests analytics

Total tests: 12 Passed tests: 12 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • storagetransfer

🟢 All tests passed!

View the build log

modular-magician avatar Nov 21 '24 10:11 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 129 insertions(+), 4 deletions(-)) google-beta provider: Diff ( 2 files changed, 129 insertions(+), 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

modular-magician avatar Nov 21 '24 10:11 modular-magician

Tests analytics

Total tests: 12 Passed tests: 12 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • storagetransfer

🟢 All tests passed!

View the build log

modular-magician avatar Nov 21 '24 10:11 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 124 insertions(+), 4 deletions(-)) google-beta provider: Diff ( 2 files changed, 124 insertions(+), 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

modular-magician avatar Nov 21 '24 12:11 modular-magician

Tests analytics

Total tests: 12 Passed tests: 12 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • storagetransfer

🟢 All tests passed!

View the build log

modular-magician avatar Nov 21 '24 12:11 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 225 insertions(+), 4 deletions(-)) google-beta provider: Diff ( 2 files changed, 225 insertions(+), 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

modular-magician avatar Nov 21 '24 14:11 modular-magician

Tests analytics

Total tests: 13 Passed tests: 12 Skipped tests: 0 Affected tests: 1

Click here to see the affected service packages
  • storagetransfer

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccStorageTransferJob_transferUpdateToEmptyString

Get to know how VCR tests work

modular-magician avatar Nov 21 '24 14:11 modular-magician

🟢 Tests passed during RECORDING mode: TestAccStorageTransferJob_transferUpdateToEmptyString [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

modular-magician avatar Nov 21 '24 14:11 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 225 insertions(+), 4 deletions(-)) google-beta provider: Diff ( 2 files changed, 225 insertions(+), 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

modular-magician avatar Nov 22 '24 09:11 modular-magician

Tests analytics

Total tests: 13 Passed tests: 13 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • storagetransfer

🟢 All tests passed!

View the build log

modular-magician avatar Nov 22 '24 09:11 modular-magician

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 225 insertions(+), 4 deletions(-)) google-beta provider: Diff ( 2 files changed, 225 insertions(+), 4 deletions(-))

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field transfer_spec.gcs_data_sink.path transitioned from optional+computed to optional google_storage_transfer_job - reference
  • Field transfer_spec.gcs_data_source.path transitioned from optional+computed to optional google_storage_transfer_job - reference

If you believe this detection to be incorrect please raise the concern with your reviewer. If you intend to make this change you will need to wait for a major release window. An override-breaking-change label can be added to allow merging.

modular-magician avatar Nov 25 '24 05:11 modular-magician

Tests analytics

Total tests: 13 Passed tests: 13 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • storagetransfer

🟢 All tests passed!

View the build log

modular-magician avatar Nov 25 '24 05:11 modular-magician

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@BBBmau, 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.

github-actions[bot] avatar Nov 27 '24 06:11 github-actions[bot]