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

Add BlockingFunctionsConfig, RecaptchaConfig and QuotaConfig fields to identityplatform config #8402

Merged
merged 8 commits into from
Jul 28, 2023

Conversation

mraouffouad
Copy link
Contributor

@mraouffouad mraouffouad commented Jul 20, 2023

Add BlockingFunctionsConfig, AuthorizedDomains and QuotaConfig fields to identityplatform config

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).
  • 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).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (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.

Release Note Template for Downstream PRs (will be copied)

identityplayform: added support for `blocking_functions` `quota` and `authorized_domains` in `google_identity_platform_config`

@modular-magician
Copy link
Collaborator

Hello! I am a robot. It looks like you are a community contributor. @slevenick, 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.

@modular-magician
Copy link
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.

Terraform GA: Diff ( 3 files changed, 563 insertions(+))
Terraform Beta: Diff ( 3 files changed, 563 insertions(+))
TF Conversion: Diff ( 3 files changed, 202 insertions(+), 3 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_identity_platform_config (1 total tests)
Untested fields: quota.sign_up_quota_config.quota_duration, quota.sign_up_quota_config.start_time

Please add acceptance tests which include these fields.

@mraouffouad
Copy link
Contributor Author

@slevenick This is a redo of PR/8064 after addressing @roaks3 's comments.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2871
Passed tests 2570
Skipped tests: 299
Affected tests: 2

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
TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerAwsNodePool_BetaBasicHandWritten[Error message] [Debug log]
TestAccComputeFirewallPolicyRule_multipleRules[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

Temporarily enable VCR to run the tests. Also, provide a more user's friendly desc for the quota field.
@modular-magician
Copy link
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.

Terraform GA: Diff ( 3 files changed, 563 insertions(+), 1 deletion(-))
Terraform Beta: Diff ( 3 files changed, 563 insertions(+), 1 deletion(-))
TF Conversion: Diff ( 3 files changed, 202 insertions(+), 3 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_identity_platform_config (1 total tests)
Untested fields: quota.sign_up_quota_config.quota_duration, quota.sign_up_quota_config.start_time

Please add acceptance tests which include these fields.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2871
Passed tests 2570
Skipped tests: 298
Affected tests: 3

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccIdentityPlatformConfig_identityPlatformConfigBasicExample|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerAwsNodePool_BetaBasicHandWritten[Error message] [Debug log]
TestAccIdentityPlatformConfig_identityPlatformConfigBasicExample[Error message] [Debug log]
TestAccComputeFirewallPolicyRule_multipleRules[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

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

googleapi: Error 400: INVALID_CONFIG : SignUp quota must start between now and 365 days from now.

When this quota will take affect.
- !ruby/object:Api::Type::String
name: 'quotaDuration'
description: |
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also add an example of how to structure the duration string? E.g.

A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".

@modular-magician
Copy link
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.

Terraform GA: Diff ( 3 files changed, 570 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 3 files changed, 570 insertions(+), 3 deletions(-))
TF Conversion: Diff ( 3 files changed, 202 insertions(+), 3 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_identity_platform_config (1 total tests)
Untested fields: quota.sign_up_quota_config.quota_duration

Please add acceptance tests which include these fields.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2874
Passed tests 2573
Skipped tests: 299
Affected tests: 2

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
TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerAwsNodePool_BetaBasicHandWritten[Error message] [Debug log]
TestAccComputeFirewallPolicyRule_multipleRules[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

Fix the quota start_time format.
@modular-magician
Copy link
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.

Terraform GA: Diff ( 3 files changed, 570 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 3 files changed, 570 insertions(+), 3 deletions(-))
TF Conversion: Diff ( 3 files changed, 202 insertions(+), 3 deletions(-))

Missing test report

Your PR includes resource fields which are not covered by any test.

Resource: google_identity_platform_config (1 total tests)
Untested fields: quota.sign_up_quota_config.quota_duration

Please add acceptance tests which include these fields.

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2874
Passed tests 2573
Skipped tests: 299
Affected tests: 2

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
TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerAwsNodePool_BetaBasicHandWritten[Error message] [Debug log]
TestAccComputeFirewallPolicyRule_multipleRules[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

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

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

Fails with:
Field 'startTime', Illegal timestamp format; timestamps must end with 'Z' or have a valid timezone offset."

Are you able to run the test yourself?

@mraouffouad
Copy link
Contributor Author

Fails with: Field 'startTime', Illegal timestamp format; timestamps must end with 'Z' or have a valid timezone offset."

Are you able to run the test yourself?

I got that error locally before I added the call to UTC(), which I assumed would fix the problem. I'll try a further fix locally and update the PR once it passes.

@modular-magician
Copy link
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.

Terraform GA: Diff ( 3 files changed, 572 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 3 files changed, 572 insertions(+), 3 deletions(-))
TF Conversion: Diff ( 3 files changed, 202 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2882
Passed tests 2580
Skipped tests: 301
Affected tests: 1

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
TestAccContainerAwsNodePool_BetaBasicHandWritten

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerAwsNodePool_BetaBasicHandWritten[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

@mraouffouad
Copy link
Contributor Author

@slevenick Running the test locally passes all the field validation steps but produces the error below at the end. Perhaps it had to do with my env settings. Github is not showing the test on the list failed tests. Can you confirm?

Error:

vcr_utils.go:152: Step 1/2 error: After applying this test step, the plan was not empty.
    stdout:
    
    
    Terraform used the selected providers to generate the following execution
    plan. Resource actions are indicated with the following symbols:
      ~ update in-place
    
    Terraform will perform the following actions:
    
      # google_identity_platform_config.default will be updated in-place
      ~ resource "google_identity_platform_config" "default" {
            id                         = "projects/terraform-gcip-6/config"
            name                       = "projects/365025219842/config"
            # (3 unchanged attributes hidden)
    
          ~ quota {
              ~ sign_up_quota_config {
                  ~ start_time     = "2023-07-27T02:55:00Z" -> "2023-07-26T22:55:00-04:00"
                    # (2 unchanged attributes hidden)
                }
            }
    
            # (1 unchanged block hidden)
        }
    
    Plan: 0 to add, 1 to change, 0 to destroy.

@slevenick
Copy link
Contributor

The test is skipped in VCR, so I have to run it myself. I think your local failure indicates a problem with how the resource works. I'm not sure exactly why though.

@mraouffouad
Copy link
Contributor Author

mraouffouad commented Jul 26, 2023

I see. Thanks for running the test. I enabled VCR, let's see what the logs will reveal.

@modular-magician
Copy link
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.

Terraform GA: Diff ( 3 files changed, 572 insertions(+), 4 deletions(-))
Terraform Beta: Diff ( 3 files changed, 572 insertions(+), 4 deletions(-))
TF Conversion: Diff ( 3 files changed, 202 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2882
Passed tests 2580
Skipped tests: 300
Affected tests: 2

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
TestAccIdentityPlatformConfig_identityPlatformConfigBasicExample|TestAccContainerAwsNodePool_BetaBasicHandWritten

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

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

Rerun these tests in REPLAYING mode to catch issues

$\textcolor{red}{\textsf{Tests failed when rerunning REPLAYING mode:}}$
TestAccIdentityPlatformConfig_identityPlatformConfigBasicExample[Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerAwsNodePool_BetaBasicHandWritten[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

@mraouffouad
Copy link
Contributor Author

Error: Error updating Config "projects/tf-test-my-projectt1rb1914oe/config": Patch "https://identitytoolkit.googleapis.com/v2/projects/tf-test-my-projectt1rb1914oe/config?alt=json&updateMask=autodeleteAnonymousUsers%2CblockingFunctions%2Cquota%2CauthorizedDomains": Requested interaction not found

Ah, I guess this is why VCR was skipped in the first place: hashicorp/terraform-provider-google#14158

It leaves me with no options other than tying to run the test locally. @slevenick I would appreciate it if you do the same.

@mraouffouad
Copy link
Contributor Author

Error: Error updating Config "projects/tf-test-my-projectt1rb1914oe/config": Patch "https://identitytoolkit.googleapis.com/v2/projects/tf-test-my-projectt1rb1914oe/config?alt=json&updateMask=autodeleteAnonymousUsers%2CblockingFunctions%2Cquota%2CauthorizedDomains": Requested interaction not found

Ah, I guess this is why VCR was skipped in the first place: hashicorp/terraform-provider-google#14158

It leaves me with no options other than tying to run the test locally. @slevenick I would appreciate it if you do the same.

However, FWIW the test passed during recording mode.

@modular-magician
Copy link
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.

Terraform GA: Diff ( 3 files changed, 572 insertions(+), 3 deletions(-))
Terraform Beta: Diff ( 3 files changed, 572 insertions(+), 3 deletions(-))
TF Conversion: Diff ( 3 files changed, 202 insertions(+), 3 deletions(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 2890
Passed tests 2587
Skipped tests: 302
Affected tests: 1

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
TestAccContainerAwsNodePool_BetaBasicHandWritten

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccContainerAwsNodePool_BetaBasicHandWritten[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

@slevenick slevenick merged commit 281ad38 into GoogleCloudPlatform:main Jul 28, 2023
8 checks passed
DanielRieske pushed a commit to bschaatsbergen/magic-modules that referenced this pull request Aug 2, 2023
…o identityplatform config (GoogleCloudPlatform#8402)

* Add Add BlockingFunctionsConfig, AuthorizedDomains and QuotaConfig fields to Config.yaml

* adding new fields to identity_platform_config_basic.tf.erb

* Update Config.yaml

Temporarily enable VCR to run the tests. Also, provide a more user's friendly desc for the quota field.

* Fix the failing test

* Update Config.yaml

Fix the quota start_time format.

* Attempt 2: Fix the failing test

* Update Config.yaml Enabling VCR.

* Update Config.yaml

Re-enable skip_vcr due to hashicorp/terraform-provider-google#14158.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants