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

Fixed an issue which force optional field is_ca in Certificate to be set

Open gfxcc opened this issue 1 year ago • 32 comments

b/345539403

The semantic of is_ca for Certificate in terraform is

  1. If ca_options is not specified at all (enabled by this PR) OR ca_options {non_ca=true} is specified
    • a certificate will be issued with a basicConstraints ext(is_ca=false)
  2. if ca_options {} is specified, a certificate will be issued without a basicConstraints ext.
  3. if ca_options {is_ca=true} is specified, a certificate will be issued with a basicConstraints ext (is_ca=true).

Release Note Template for Downstream PRs (will be copied)

privateca: fixed an issue which force optional field is_ca in Certificate to be set

gfxcc avatar Jun 08 '24 01:06 gfxcc

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

modular-magician avatar Jun 08 '24 01:06 modular-magician

Tests analytics

Total tests: 39 Passed tests: 31 Skipped tests: 7 Affected tests: 1

Click here to see the affected service packages
  • privateca

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
TestAccPrivatecaCaPool_privatecaCapoolEmptyBaseline

Get to know how VCR tests work

modular-magician avatar Jun 08 '24 01:06 modular-magician

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccPrivatecaCaPool_privatecaCapoolEmptyBaseline[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Jun 08 '24 01:06 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 ( 4 files changed, 20 insertions(+), 13 deletions(-)) google-beta provider: Diff ( 4 files changed, 20 insertions(+), 13 deletions(-)) terraform-google-conversion: Diff ( 1 file changed, 5 insertions(+), 1 deletion(-))

modular-magician avatar Jun 09 '24 23:06 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 ( 4 files changed, 20 insertions(+), 13 deletions(-)) google-beta provider: Diff ( 4 files changed, 20 insertions(+), 13 deletions(-)) terraform-google-conversion: Diff ( 1 file changed, 5 insertions(+), 1 deletion(-))

modular-magician avatar Jun 09 '24 23:06 modular-magician

Tests analytics

Total tests: 39 Passed tests: 25 Skipped tests: 7 Affected tests: 7

Click here to see the affected service packages
  • privateca

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccPrivatecaCaPool_privatecaCapoolEmptyBaseline|TestAccPrivatecaCertificate_privatecaCertificateConfigExample|TestAccPrivatecaCertificate_privatecaCertificateCsrExample|TestAccPrivatecaCertificate_privatecaCertificateCustomSkiExample|TestAccPrivatecaCertificate_privatecaCertificateNoAuthorityExample|TestAccPrivatecaCertificate_privatecaCertificateUpdate|TestAccPrivatecaCertificate_privatecaCertificateWithTemplateExample

Get to know how VCR tests work

modular-magician avatar Jun 09 '24 23:06 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccPrivatecaCaPool_privatecaCapoolEmptyBaseline[Debug log] TestAccPrivatecaCertificate_privatecaCertificateConfigExample[Debug log] TestAccPrivatecaCertificate_privatecaCertificateCsrExample[Debug log] TestAccPrivatecaCertificate_privatecaCertificateCustomSkiExample[Debug log] TestAccPrivatecaCertificate_privatecaCertificateNoAuthorityExample[Debug log] TestAccPrivatecaCertificate_privatecaCertificateWithTemplateExample[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccPrivatecaCertificate_privatecaCertificateUpdate[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Jun 09 '24 23:06 modular-magician

Tests analytics

Total tests: 39 Passed tests: 25 Skipped tests: 7 Affected tests: 7

Click here to see the affected service packages
  • privateca

Action taken

Found 7 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccPrivatecaCaPool_privatecaCapoolEmptyBaseline|TestAccPrivatecaCertificate_privatecaCertificateConfigExample|TestAccPrivatecaCertificate_privatecaCertificateCsrExample|TestAccPrivatecaCertificate_privatecaCertificateCustomSkiExample|TestAccPrivatecaCertificate_privatecaCertificateNoAuthorityExample|TestAccPrivatecaCertificate_privatecaCertificateUpdate|TestAccPrivatecaCertificate_privatecaCertificateWithTemplateExample

Get to know how VCR tests work

modular-magician avatar Jun 09 '24 23:06 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccPrivatecaCaPool_privatecaCapoolEmptyBaseline[Debug log] TestAccPrivatecaCertificate_privatecaCertificateConfigExample[Debug log] TestAccPrivatecaCertificate_privatecaCertificateCsrExample[Debug log] TestAccPrivatecaCertificate_privatecaCertificateCustomSkiExample[Debug log] TestAccPrivatecaCertificate_privatecaCertificateNoAuthorityExample[Debug log] TestAccPrivatecaCertificate_privatecaCertificateWithTemplateExample[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccPrivatecaCertificate_privatecaCertificateUpdate[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Jun 09 '24 23:06 modular-magician

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

@shuyama1, 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 Jun 10 '24 01:06 github-actions[bot]

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

github-actions[bot] avatar Jun 13 '24 09:06 github-actions[bot]

I think the failing test TestAccPrivatecaCertificate_privatecaCertificateUpdate is related. The test failed due to error:

vcr_utils.go:152: Step 3/6 error: Error running pre-apply refresh: exit status 1
        
        Error: Provider produced invalid plan
        
        Provider "registry.terraform.io/hashicorp/google" has indicated "requires
        replacement" on google_privateca_certificate.default for a non-existent
        attribute path cty.Path{cty.GetAttrStep{Name:"config"},
        cty.IndexStep{Key:cty.NumberIntVal(0)}, cty.GetAttrStep{Name:"x509_config"},
        cty.IndexStep{Key:cty.NumberIntVal(0)}, cty.GetAttrStep{Name:"ca_options"},
        cty.IndexStep{Key:cty.NumberIntVal(0)}, cty.GetAttrStep{Name:"is_ca"}}.
        
        This is a bug in the provider, which should be reported in the provider's own
        issue tracker.

The test passed when running it locally. Do you think it could due to the limitation from RECORDING mode?

gfxcc avatar Jun 13 '24 16:06 gfxcc

It shouldn't be affected by running in VCR, especially in recording mode, as it's just running the actual acceptance test. Let me re-run the test for now, and if it fails again, I'll need to look a bit closer into the failure.

/gcbrun

shuyama1 avatar Jun 13 '24 16:06 shuyama1

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

modular-magician avatar Jun 13 '24 16:06 modular-magician

Tests analytics

Total tests: 39 Passed tests: 31 Skipped tests: 7 Affected tests: 1

Click here to see the affected service packages
  • privateca

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
TestAccPrivatecaCertificate_privatecaCertificateUpdate

Get to know how VCR tests work

modular-magician avatar Jun 13 '24 16:06 modular-magician

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$ TestAccPrivatecaCertificate_privatecaCertificateUpdate[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$ View the build log or the debug log for each test

modular-magician avatar Jun 13 '24 16:06 modular-magician

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

github-actions[bot] avatar Jun 18 '24 09:06 github-actions[bot]

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

github-actions[bot] avatar Jun 20 '24 09:06 github-actions[bot]

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

modular-magician avatar Jun 24 '24 17:06 modular-magician

Tests analytics

Total tests: 63 Passed tests: 31 Skipped tests: 7 Affected tests: 1

Click here to see the affected service packages
  • privateca

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

Get to know how VCR tests work

modular-magician avatar Jun 24 '24 17:06 modular-magician

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$ TestAccPrivatecaCertificate_privatecaCertificateUpdate[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{green}{\textsf{All tests passed!}}$

View the build log or the debug log for each test

modular-magician avatar Jun 24 '24 17:06 modular-magician

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

github-actions[bot] avatar Jun 27 '24 09:06 github-actions[bot]

@gfxcc, this PR is waiting for action from you. Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

If no action is taken, this PR will be closed in 28 days.

This notification can be disabled with the disable-automatic-closure label.

github-actions[bot] avatar Jul 12 '24 09:07 github-actions[bot]

Just want to confirm I understand the cases correctly -

  • omitting the ca_options block in Terraform would be the same as setting ca_options {non_ca=true}, which means we will send CaOptions {is_ca=false} to the API.

Correct. The requests are different (omitting ca_options vs CaOptions {is_ca=false}), but result to the same behavior.

  • omitting the ca_options block is different from explicitly set it as a empty block ca_options {} in Terraform, as the latter means CaOptions {} (is_ca unspecified) to the API?

Correct. Those 2 config has different meaning to the API.

The new behaviors are listed in the PR description.

gfxcc avatar Jul 12 '24 18:07 gfxcc

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

github-actions[bot] avatar Jul 17 '24 09:07 github-actions[bot]

Sorry for the delay on review. I'll be taking a look later today.

shuyama1 avatar Jul 18 '24 17:07 shuyama1

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

github-actions[bot] avatar Jul 19 '24 09:07 github-actions[bot]

/gcbrun

shuyama1 avatar Jul 23 '24 17:07 shuyama1

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

modular-magician avatar Jul 23 '24 17:07 modular-magician

Tests analytics

Total tests: 39 Passed tests: 32 Skipped tests: 7 Affected tests: 0

Click here to see the affected service packages
  • privateca

$\textcolor{green}{\textsf{All tests passed!}}$

View the build log

modular-magician avatar Jul 23 '24 17:07 modular-magician