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

storage_bucket_object: added holds #4921

Merged
merged 2 commits into from
Jul 1, 2021
Merged

storage_bucket_object: added holds #4921

merged 2 commits into from
Jul 1, 2021

Conversation

jaceq
Copy link
Contributor

@jaceq jaceq commented Jun 25, 2021

Signed-off-by: Jacek Kikiewicz [email protected]

This is a followup from hashicorp/terraform-provider-google#9403 as per request of @ScottSuarez
This closes: hashicorp/terraform-provider-google#6022

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.

I haven't been able to ACC tests

Release Note Template for Downstream PRs (will be copied)

storage_bucket_object: added temporary_hold and event_based_hold attributes

@google-cla
Copy link

google-cla bot commented Jun 25, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Jun 25, 2021
@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review.

Thanks for your contribution! A human will be with you soon.

@rileykarson, please review this PR or find an appropriate assignee.

@jaceq
Copy link
Contributor Author

jaceq commented Jun 25, 2021

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Jun 25, 2021
@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 ( 2 files changed, 76 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 2 files changed, 76 insertions(+), 1 deletion(-))

@ScottSuarez
Copy link
Contributor

/gcbrun

@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 ( 2 files changed, 76 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 4 files changed, 78 insertions(+), 4 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccCloudbuildWorkerPool_withNetwork|TestAccContainerNodePool_withGPU|TestAccEventarcTrigger_basic|TestAccEventarcTrigger_transport|TestAccStorageObject_holds You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=193725

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccStorageObject_holds|TestAccCloudbuildWorkerPool_withNetwork|TestAccContainerNodePool_withGPU Please fix these to complete your PR

@ScottSuarez
Copy link
Contributor

Looks like the test in failing in ci

=== RUN   TestAccStorageObject_holds
=== PAUSE TestAccStorageObject_holds
=== CONT  TestAccStorageObject_holds
    testing_new.go:63: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: Error deleting contents of object tf-gce-test: googleapi: Error 403: Object 'tf-test-bucket-2404561034928499575/tf-gce-test' is under active Temporary hold and cannot be deleted, overwritten or archived until hold is removed., forbidden
        
        
--- FAIL: TestAccStorageObject_holds (7.85s)

perhaps you will need to set deletion protection to false on the bucket and add another step where you take the hold off the object, yes?

@jaceq
Copy link
Contributor Author

jaceq commented Jun 28, 2021

@ScottSuarez thx for input.
This is a bit tricky though, at the moment resource_storage_bucket_object.go has no updates... so holds are 'ForceNew' this means that in reality there so now way to take them away by updating in any way...
What do you suggest in this case? Shall I look into extending bucket object with update call? (I guess otherwise it won't work)

@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 ( 2 files changed, 123 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 3 files changed, 124 insertions(+), 2 deletions(-))

@jaceq
Copy link
Contributor Author

jaceq commented Jun 28, 2021

Ok, so I added Update function and set holds as update able.
I also managed to run ACC tests (well only for holds) this time and now they are green, overall test is:

  • creating object with holds
  • updating object to remove holds

@ScottSuarez
Copy link
Contributor

everything looks good to me aside from that one comment pending tests pass

Signed-off-by: Jacek Kikiewicz <[email protected]>
@c2thorn
Copy link
Member

c2thorn commented Jun 30, 2021

Hi @jaceq
We changed our CI recently, so in order to get the tests going, this will need to be rebased off of the latest commit of master. Sorry about this.

@ScottSuarez ScottSuarez self-requested a review June 30, 2021 21:00
@ScottSuarez
Copy link
Contributor

/gcbrun .. I pulled master for them ^^

@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 ( 2 files changed, 121 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 3 files changed, 122 insertions(+), 2 deletions(-))

1 similar comment
@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 ( 2 files changed, 121 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 3 files changed, 122 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccComputeInstance_advancedMachineFeatures|TestAccComputeInstance_updateRunning_desiredStatusNotSet_notAllowStoppingForUpdate|TestAccComputeInstance_updateRunning_desiredStatusRunning_notAllowStoppingForUpdate|TestAccContainerNodePool_withGPU|TestAccStorageObject_holds You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=194484

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccComputeInstance_updateRunning_desiredStatusRunning_notAllowStoppingForUpdate|TestAccComputeInstance_updateRunning_desiredStatusNotSet_notAllowStoppingForUpdate|TestAccContainerNodePool_withGPU Please fix these to complete your PR

@jaceq
Copy link
Contributor Author

jaceq commented Jul 1, 2021

@ScottSuarez sorry, I am confused a bit, is there still something for me to do (rebase) or not?

@ScottSuarez
Copy link
Contributor

nope you are good to go! Thanks for the contribution @jaceq ^^

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.

Storage bucket object holds
4 participants