-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add import-only to KMS key #5143
Conversation
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. @melinath, please review this PR or find an appropriate assignee. |
/gcbrun |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccComputeInstanceFromMachineImage_basic|TestAccComputeInstanceFromMachineImage_overrideMetadataDotStartupScript|TestAccKmsCryptoKey_importOnly|TestAccPrivatecaCaPool_privatecaCapoolEmptyBaseline|TestAccPrivatecaCertificate_privatecaCertificateWithTemplateExample|TestAccTags You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=203007 |
Tests failed during RECORDING mode: TestAccPrivatecaCaPool_privatecaCapoolEmptyBaseline|TestAccKmsCryptoKey_importOnly|TestAccTags Please fix these to complete your PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! It looks like the new test is currently failing with the following error:
Error: Error creating CryptoKey: googleapi: Error 400: Import-only keys must skip initial version creation.
You might be able to get more information by generating the provider locally and then running the new test
I recommend setting TF_LOG=TRACE to get more verbose output.
Let me know how it goes & if you run into any problems you can't solve.
Oops, that's my oversight, and a quick fix. |
/gcbrun |
Friendly ping on this. We have an internal thread that suggests that the present failure is just a flake. |
Hello Everybody, |
Hey all - sorry for the delay on this; I lost track of this PR. The best thing you can do if this happens again on a PR in the future is to press the "Re-request review" button to make sure this is in the reviewer's actionable queue. /gcbrun because the last one failed due to CI issues rather than something wrong with the PR. |
@bdhess the failure was definitely unrelated to this PR; do you mean that the test is also flakey? |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccBigtableAppProfile_bigtableAppProfileSingleclusterExample|TestAccKmsCryptoKey_importOnly You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=207021 |
@melinath I mean flaky per the definition at go/flaky -- it fails nondeterministically with respect to the test inputs. |
@bdhess great, thanks for confirming. We generally would prefer not to merge new flakey tests; is it at all possible to fix the test to not be flakey? |
@melinath and I discussed offline that I don't think any new flakiness is introduced with this PR |
At least we're not aware of flakiness yet. :-) It looks like the new test failed in CI, but it could be a CI issue again. I'll do a rerun of just that test: https://ci-oss.hashicorp.engineering/buildConfiguration/GoogleCloudBeta_ProviderGoogleCloudBetaMmUpstream/207210 |
I cloned your fork and tried to run your test, but it first failed:
This is actually expected because when we import the state to verify the resource was created correctly, "skip_initial_version" is always set to false since its value cannot be inferred from the object read from the API and we assume a safe default. But it's actually easy to fix, you just need to add this change to your test:
With that change, your
|
I can confirm that (now that CI was able to run the test) we're seeing that same error in CI. Given that we're not able to set |
Similar to GoogleCloudPlatform#5131, and probably also required for the same customer. Apologies for the oversight.
The request attribute `skip_initial_version_creation` controls a creation-time behavior that cannot be subsequently verified.
Thanks a bunch @drebes for the analysis! |
@melinath I don't see a re-request review button sadly. Is that possibly limited to maintainers? |
@bdhess I've already re-requested a review for myself, so the button is not available to me right now either. :-) you could check for it once I get a chance to do a review again. |
I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccKmsCryptoKey_importOnly You can view the result here: https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=207236 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Add import-only to KMS key Similar to GoogleCloudPlatform#5131, and probably also required for the same customer. Apologies for the oversight. * Fix test failure * Ignore skip_initial_version_creation during ImportStateVerify The request attribute `skip_initial_version_creation` controls a creation-time behavior that cannot be subsequently verified.
Similar to #5131, and probably also required for the same customer.
Apologies for the oversight.
If this PR is for Terraform, I acknowledge that I have:
make test
andmake lint
to ensure it passes unit and linter tests.Release Note Template for Downstream PRs (will be copied)