Skip to content

fix: (storage) data type change for retention_period#14269

Closed
gurusai-voleti wants to merge 2 commits intoGoogleCloudPlatform:FEATURE-BRANCH-major-release-7.0.0from
gurusai-voleti:retention_prd
Closed

fix: (storage) data type change for retention_period#14269
gurusai-voleti wants to merge 2 commits intoGoogleCloudPlatform:FEATURE-BRANCH-major-release-7.0.0from
gurusai-voleti:retention_prd

Conversation

@gurusai-voleti
Copy link
Copy Markdown
Contributor

@gurusai-voleti gurusai-voleti commented Jun 13, 2025

Release Note Template for Downstream PRs (will be copied)
Fixes: hashicorp/terraform-provider-google#19051
See Write release notes for guidance.

storage: changed `retention_period` to `string` data type in resource `google_storage_bucket`

@modular-magician
Copy link
Copy Markdown
Collaborator

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 ( 4 files changed, 16 insertions(+), 13 deletions(-))
google-beta provider: Diff ( 4 files changed, 16 insertions(+), 13 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 7 insertions(+), 1 deletion(-))

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

google-beta provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • storage

🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR.

View the build log

@modular-magician
Copy link
Copy Markdown
Collaborator

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 ( 4 files changed, 16 insertions(+), 14 deletions(-))
google-beta provider: Diff ( 4 files changed, 16 insertions(+), 14 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 4 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

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

  • Field retention_policy.retention_period changed from TypeInt to TypeString on google_storage_bucket - 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
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 120
Passed tests: 109
Skipped tests: 10
Affected tests: 1

Click here to see the affected service packages
  • storage

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
  • TestAccStorageBucket_storageClass

Get to know how VCR tests work

@modular-magician
Copy link
Copy Markdown
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccStorageBucket_storageClass [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
Copy link
Copy Markdown
Collaborator

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 ( 4 files changed, 16 insertions(+), 14 deletions(-))
google-beta provider: Diff ( 4 files changed, 16 insertions(+), 14 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 4 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

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

  • Field retention_policy.retention_period changed from TypeInt to TypeString on google_storage_bucket - 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
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 120
Passed tests: 110
Skipped tests: 10
Affected tests: 0

Click here to see the affected service packages
  • storage

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Copy Markdown
Collaborator

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 ( 4 files changed, 19 insertions(+), 15 deletions(-))
google-beta provider: Diff ( 4 files changed, 19 insertions(+), 15 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 4 insertions(+), 1 deletion(-))

Errors

google provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

google-beta provider:

  • The diff processor failed to build. This is usually due to the downstream provider failing to compile.

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • storage

🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR.

View the build log

@modular-magician
Copy link
Copy Markdown
Collaborator

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 ( 4 files changed, 22 insertions(+), 15 deletions(-))
google-beta provider: Diff ( 4 files changed, 22 insertions(+), 15 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 4 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

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

  • Field retention_policy.retention_period changed from TypeInt to TypeString on google_storage_bucket - 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
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 120
Passed tests: 110
Skipped tests: 10
Affected tests: 0

Click here to see the affected service packages
  • storage

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Copy Markdown
Collaborator

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 ( 4 files changed, 22 insertions(+), 15 deletions(-))
google-beta provider: Diff ( 4 files changed, 22 insertions(+), 15 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 4 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

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

  • Field retention_policy.retention_period changed from TypeInt to TypeString on google_storage_bucket - 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
Copy link
Copy Markdown
Collaborator

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 ( 4 files changed, 21 insertions(+), 14 deletions(-))
google-beta provider: Diff ( 4 files changed, 21 insertions(+), 14 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 4 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

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

  • Field retention_policy.retention_period changed from TypeInt to TypeString on google_storage_bucket - 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
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 120
Passed tests: 110
Skipped tests: 10
Affected tests: 0

Click here to see the affected service packages
  • storage

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 120
Passed tests: 110
Skipped tests: 10
Affected tests: 0

Click here to see the affected service packages
  • storage

🟢 All tests passed!

View the build log

@gurusai-voleti gurusai-voleti marked this pull request as ready for review June 17, 2025 05:09
@github-actions
Copy link
Copy Markdown

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

Googlers: For automatic test runs see go/terraform-auto-test-runs.

@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 github-actions bot requested a review from BBBmau June 17, 2025 05:10
@modular-magician
Copy link
Copy Markdown
Collaborator

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 ( 4 files changed, 22 insertions(+), 15 deletions(-))
google-beta provider: Diff ( 4 files changed, 22 insertions(+), 15 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 4 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

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

  • Field retention_policy.retention_period changed from TypeInt to TypeString on google_storage_bucket - 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.

@kautikdk
Copy link
Copy Markdown
Member

We might need state upgrader for this breaking change. Can you please check if that will be helpful?
References: https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/state-migration
https://github.com/GoogleCloudPlatform/magic-modules/pull/11471/files

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 120
Passed tests: 110
Skipped tests: 10
Affected tests: 0

Click here to see the affected service packages
  • storage

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Copy Markdown
Collaborator

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 ( 5 files changed, 558 insertions(+), 16 deletions(-))
google-beta provider: Diff ( 5 files changed, 558 insertions(+), 16 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 4 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

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

  • Field retention_policy.retention_period changed from TypeInt to TypeString on google_storage_bucket - 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.

@gurusai-voleti
Copy link
Copy Markdown
Contributor Author

We might need state upgrader for this breaking change. Can you please check if that will be helpful? References: https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/state-migration https://github.com/GoogleCloudPlatform/magic-modules/pull/11471/files

added state upgrader

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 120
Passed tests: 110
Skipped tests: 10
Affected tests: 0

Click here to see the affected service packages
  • storage

🟢 All tests passed!

View the build log

@github-actions
Copy link
Copy Markdown

@BBBmau This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

@kautikdk
Copy link
Copy Markdown
Member

kautikdk commented Jun 19, 2025

@BBBmau can you please review the state migration code as it was historically added/written by only magic-modules maintainers?

@github-actions
Copy link
Copy Markdown

@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

* `is_locked` - (Optional) If set to `true`, the bucket will be [locked](https://cloud.google.com/storage/docs/using-bucket-lock#lock-bucket) and permanently restrict edits to the bucket's retention policy. Caution: Locking a bucket is an irreversible action.

* `retention_period` - (Required) The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 2,147,483,647 seconds.
* `retention_period` - (Required) The period of time, in seconds, that objects in the bucket must be retained and cannot be deleted, overwritten, or archived. The value must be less than 3,155,760,000 seconds.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the upper limit coming from server side value limit?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes as per API its the latest value

}
retentionPolicy := retentionPolicies[0].(map[string]interface{})

value, _ := strconv.ParseInt(retentionPolicy["retention_period"].(string), 10, 64)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How this change will impact users? I am not very familiar with the tgc converters and how/when they are used.

Copy link
Copy Markdown
Contributor Author

@gurusai-voleti gurusai-voleti Jun 25, 2025

Choose a reason for hiding this comment

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

I also don't know much about these converters, but this is failing when building, so fixed the issue https://github.com/GoogleCloudPlatform/magic-modules/actions/runs/15634595262/job/44046728184

@gurusai-voleti gurusai-voleti requested a review from kautikdk June 26, 2025 09:50
@modular-magician
Copy link
Copy Markdown
Collaborator

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 ( 5 files changed, 561 insertions(+), 15 deletions(-))
google-beta provider: Diff ( 5 files changed, 561 insertions(+), 15 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 4 insertions(+), 1 deletion(-))

Breaking Change(s) Detected

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

  • Field retention_policy.retention_period changed from TypeInt to TypeString on google_storage_bucket - 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.

Errors

google-beta provider:

  • Failed to detect subcategory in the frontmatter in file website/docs/guides/version_7_upgrade.html.markdown.

@modular-magician
Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 123
Passed tests: 111
Skipped tests: 10
Affected tests: 2

Click here to see the affected service packages
  • storage
#### Action taken
Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccStorageBucket_IPFilter
  • TestAccStorageBucket_storageClass

Get to know how VCR tests work

@modular-magician
Copy link
Copy Markdown
Collaborator

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

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode:
TestAccStorageBucket_IPFilter [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@gurusai-voleti
Copy link
Copy Markdown
Contributor Author

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

🟢 No issues found for passed tests after REPLAYING rerun.

🔴 Tests failed during RECORDING mode: TestAccStorageBucket_IPFilter [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

unrelated test case is failing

@github-actions
Copy link
Copy Markdown

@GoogleCloudPlatform/terraform-team @BBBmau This PR has been waiting for review for 2 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.

@gurusai-voleti
Copy link
Copy Markdown
Contributor Author

@rileykarson (current oncall) need help on reviewing this item

@c2thorn c2thorn added the 7.0.0 label Jun 30, 2025
@NickElliot
Copy link
Copy Markdown
Contributor

Hi -- commenting to say for the time being to avoid merging this PR because we're making some changes to the feature branches, should be resolved some time tomorrow and will update then!

@c2thorn c2thorn deleted the branch GoogleCloudPlatform:FEATURE-BRANCH-major-release-7.0.0 July 1, 2025 16:37
@c2thorn c2thorn closed this Jul 1, 2025
@c2thorn c2thorn reopened this Jul 1, 2025
@c2thorn
Copy link
Copy Markdown
Member

c2thorn commented Jul 1, 2025

reached out to @gurusai-voleti offline to discuss the options for removing the conflicts

@modular-magician
Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

1 similar comment
@modular-magician
Copy link
Copy Markdown
Collaborator

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

Diff report

Your PR hasn't generated any diffs, but I'll let you know if a future commit does.

@gurusai-voleti
Copy link
Copy Markdown
Contributor Author

new PR #14442 has been created, closing this PR

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