fix(storage-bucket-object): do not delete object on update content, j…
The aim of this is to avoid object deletion on content update, linked to https://github.com/hashicorp/terraform-provider-google/issues/10488
before this PR :
# google_storage_bucket_object.gsn-psc-informations must be replaced
-/+ resource "google_storage_bucket_object" "test" {
~ content = (sensitive value) # forces replacement
~ content_type = "text/plain; charset=utf-8" -> (known after apply)
~ crc32c = "+Yfdfw==" -> (known after apply)
~ detect_md5hash = "4zoxBKTWpq0ORYqR4FRpCg==" -> "different hash" # forces replacement
- event_based_hold = false -> null
~ id = "test-test" -> (known after apply)
~ kms_key_name = "projects/myproject/locations/myregion/keyRings/mykeyring/cryptoKeys/mykeyname/cryptoKeyVersions/1" -> (known after apply)
~ md5hash = "4zoxBKTWpq0ORYqR4FRpCg==" -> (known after apply)
~ media_link = "https://storage.googleapis.com/download/storage/v1/b/test/o/test?generation=1708531718170806&alt=media" -> (known after apply)
- metadata = {} -> null
name = "test"
~ output_name = "test" -> (known after apply)
~ self_link = "https://www.googleapis.com/storage/v1/b/test/o/test" -> (known after apply)
~ storage_class = "STANDARD" -> (known after apply)
- temporary_hold = false -> null
# (1 unchanged attribute hidden)
}
After this PR :
# google_storage_bucket_object.gsn-psc-informations must be replaced
~ resource "google_storage_bucket_object" "test" {
~ content = (sensitive value)
~ detect_md5hash = "4zoxBKTWpq0ORYqR4FRpCg==" -> "different hash"
id = "test-test"
name = "test"
}
you can test it with : https://github.com/public-cloud-wl/terraform-provider-google/releases/tag/v5.17.3 registry link : https://registry.terraform.io/providers/public-cloud-wl/google/latest
Release Note Template for Downstream PRs (will be copied)
storage: The update on `google_storage_bucket_object` content is now no more delete to create object, but just push a new object if the content change
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
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.
/gcbrun
@BBBmau seems that you are required for review ;)
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.
Terraform GA: Diff ( 1 file changed, 45 insertions(+), 35 deletions(-)) Terraform Beta: Diff ( 1 file changed, 45 insertions(+), 35 deletions(-))
Tests analytics
Total tests: 89
Passed tests: 83
Skipped tests: 6
Affected tests: 0
Click here to see the affected service packages
- storage
$\textcolor{green}{\textsf{All tests passed!}}$ View the build log
@Maarc-D i appreciate the patience! Checks seem to be good, I'll do a more thorough test before approving this.
Hello @rileykarson @BBBmau can you please help us triggering the checks again? Seems we're possibly at one step from merging this :)
@GoogleCloudPlatform/terraform-team This PR has been waiting for review for 3 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.
/gcbrun
Hello @BBBmau @rileykarson it seems tests are stuck somewhere. Any chance you can please help us with this?
@melinath this may fall under the contributions rotation? At least the membership checker error
The membership checker error is due to this PR being extremely old - @Maarc-D you will need to either merge the main branch into the PR branch or rebase the PR branch.
@GoogleCloudPlatform/terraform-team This PR has been waiting for review for 4 weeks. Please take a look! Use the label disable-review-reminders to disable these notifications.
The membership checker error is due to this PR being extremely old - @Maarc-D you will need to either merge the main branch into the PR branch or rebase the PR branch.
I did sync the fork ;)
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, 108 insertions(+), 35 deletions(-))
google-beta provider: Diff ( 2 files changed, 108 insertions(+), 35 deletions(-))
Missing test report
Your PR includes resource fields which are not covered by any test.
Resource: google_storage_bucket_object (185 total tests)
Please add an acceptance test which includes these fields. The test should include the following:
resource "google_storage_bucket_object" "primary" {
detect_md5hash = # value needed
}
Tests analytics
Total tests: 94
Passed tests: 88
Skipped tests: 6
Affected tests: 0
Click here to see the affected service packages
- storage
Non-exercised tests
Tests were added that are skipped in VCR:
- TestResourceStorageBucketObjectUpdate_ContentChange
$\textcolor{green}{\textsf{All tests passed!}}$ View the build log
This would be such a helpful change. Would it help if someone opened a new PR? I understand this PR is pretty old.
This PR has been waiting for review for 2 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.
This would be such a helpful change. Would it help if someone opened a new PR? I understand this PR is pretty old.
I'm not sure a duplicate PR will help, but you can put a thumb up on this one ;) I did sync my fork so no matter the time the PR is open it should be up to date.
@BBBmau will take care of it, I hope ^^
can you run the command below in order to resolve the lint check errors?
==> Checking that code complies with gofmt requirements...
gofmt needs running on the following files:
./google/services/storage/resource_storage_bucket_object.go
You can use the command: `make fmt` to reformat code.
make: *** [GNUmakefile:26: fmtcheck] Error 1
can you run the command below in order to resolve the lint check errors?
==> Checking that code complies with gofmt requirements... gofmt needs running on the following files: ./google/services/storage/resource_storage_bucket_object.go You can use the command: `make fmt` to reformat code. make: *** [GNUmakefile:26: fmtcheck] Error 1
@BBBmau done ;)
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, 106 insertions(+), 33 deletions(-))
google-beta provider: Diff ( 2 files changed, 106 insertions(+), 33 deletions(-))
Missing test report
Your PR includes resource fields which are not covered by any test.
Resource: google_storage_bucket_object (185 total tests)
Please add an acceptance test which includes these fields. The test should include the following:
resource "google_storage_bucket_object" "primary" {
detect_md5hash = # value needed
}
Tests analytics
Total tests: 94
Passed tests: 88
Skipped tests: 6
Affected tests: 0
Click here to see the affected service packages
- storage
Non-exercised tests
Tests were added that are skipped in VCR:
- TestResourceStorageBucketObjectUpdate_ContentChange
$\textcolor{green}{\textsf{All tests passed!}}$ View the build log
can you run the command below in order to resolve the lint check errors?
==> Checking that code complies with gofmt requirements... gofmt needs running on the following files: ./google/services/storage/resource_storage_bucket_object.go You can use the command: `make fmt` to reformat code. make: *** [GNUmakefile:26: fmtcheck] Error 1@BBBmau done ;)
only thing left is to add a test that includes detect_md5hash which is mentioned in the previous comments from magic magician. After that I can approve and get this merged (:
@BBBmau I did not add this field ;) But with my modification I think this one should be computed, I tried to add the argument but do you know how I can trigger @modular-magician to make the checks ?
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, 111 insertions(+), 35 deletions(-))
google-beta provider: Diff ( 2 files changed, 111 insertions(+), 35 deletions(-))
Missing test report
Your PR includes resource fields which are not covered by any test.
Resource: google_storage_bucket_object (185 total tests)
Please add an acceptance test which includes these fields. The test should include the following:
resource "google_storage_bucket_object" "primary" {
detect_md5hash = # value needed
}
Tests analytics
Total tests: 0
Passed tests: 0
Skipped tests: 0
Affected tests: 0
Click here to see the affected service packages
- storage
Non-exercised tests
Tests were added that are skipped in VCR:
- TestResourceStorageBucketObjectUpdate_ContentChange
$\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$ View the build log
@rileykarson @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.
@GoogleCloudPlatform/terraform-team @rileykarson @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.