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

Fix path_matcher in region url maps #4298

Merged
merged 3 commits into from
Dec 22, 2020
Merged

Fix path_matcher in region url maps #4298

merged 3 commits into from
Dec 22, 2020

Conversation

Gilles95
Copy link
Contributor

@Gilles95 Gilles95 commented Dec 8, 2020

The default_service in path_matcher is actually not required as it should be default_service or default_url_redirect.
(related to hashicorp/terraform-provider-google#7951)

Further info in https://cloud.google.com/compute/docs/reference/rest/v1/regionUrlMaps , extract below:

pathMatchers[].defaultService
Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set.

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.

Release Note Template for Downstream PRs (will be copied)

google_compute_region_url_map: removed requirement for default_service, as it should be a choice of default_service or default_url_redirect

The default_service in path_matcher is actually not required as it should be default_service or default_url_redirect.

Further info in https://cloud.google.com/compute/docs/reference/rest/v1/regionUrlMaps 
> pathMatchers[].defaultService 
>> Only one of defaultService, defaultUrlRedirect or defaultRouteAction.weightedBackendService must be set.
@google-cla
Copy link

google-cla bot commented Dec 8, 2020

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 Dec 8, 2020
@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.

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

@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, 7 insertions(+), 7 deletions(-))
Terraform Beta: Diff ( 2 files changed, 7 insertions(+), 7 deletions(-))
Ansible: Diff ( 1 file changed, 2 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

Oops! It looks like you're using an unknown release-note type in your changelog entries:

  • REPLACEME

Please only use the types listed in https://github.com/GoogleCloudPlatform/magic-modules/blob/master/.ci/RELEASE_NOTES_GUIDE.md.

@Gilles95
Copy link
Contributor Author

Gilles95 commented Dec 8, 2020

@googlebot I signed it!

@googlebot I signed it!

@google-cla google-cla bot added cla: yes and removed cla: no labels Dec 8, 2020
@Gilles95
Copy link
Contributor Author

Gilles95 commented Dec 9, 2020

Anyone would know why we can't see the logs/details for the failing checks TerraformVCRCommunity and generate-diffs ?
(unless that is due the PR being draft state)

@Gilles95 Gilles95 marked this pull request as ready for review December 9, 2020 15:43
@ScottSuarez
Copy link
Contributor

ScottSuarez commented Dec 10, 2020

I don't think the build runs are currently visible to users outside our organization currently. Don't worry I'll track things and shepherd on my side.

Hey @Gilles95 good catch on this. Was wondering if you would be averse to writing a customized diff for this scenario so we can still get plan time validation for this (ie: check one of them is set or give back error). Also perhaps supplying a testcase.

I recently added something similar here. If not we can look into completing this and tasking it out later.

@Gilles95
Copy link
Contributor Author

Hello @ScottSuarez , thanks for following up. I will have a look for the customized diff and test case. Just bear with me I am not familiar with those yet ;-)

@google-cla
Copy link

google-cla bot commented Dec 10, 2020

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels Dec 10, 2020
@Gilles95
Copy link
Contributor Author

@ScottSuarez I have added a testcase but when running I got the below and I am not sure what is it:

resource_compute_region_url_map_test.go:879:1: wrong signature for TestAccComputeRegionUrlMap_defaultUrlRedirectWithinPathMatcherConfig, must be: func TestAccComputeRegionUrlMap_defaultUrlRedirectWithinPathMatcherConfig(t *testing.T)
FAIL github.com/hashicorp/terraform-provider-google/google [setup failed]

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

@Gilles95
Copy link
Contributor Author

@googlebot I fixed it.

@google-cla google-cla bot added cla: yes and removed cla: no labels Dec 10, 2020
@ScottSuarez
Copy link
Contributor

Hey @Gilles95, the second function that supplies the config should start with a lowercase TestAccComputeRegionUrlMap_defaultUrlRedirectWithinPathMatcherConfig. What's happening most likely is the regex is trying to run this second function as a test case when it actually isn't one. Let me know if that doesn't clear things up for you.

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

@Gilles95
Copy link
Contributor Author

Gilles95 commented Dec 11, 2020

@ScottSuarez , thanks for that, That was it ...the uppercase. Now this looks good:

--- PASS: TestAccComputeRegionUrlMap_defaultUrlRedirectWithinPathMatcher (45.36s)

Let me know if that ok for the test or if I need to amend it.
Regarding the customized diff I am not too sure about it, if someone from your side can look into it that would be great and I will keep an eye on it for next time.

@ScottSuarez
Copy link
Contributor

/gcbrun

It should be fine, my college @rileykarson mentioned we don't actually need customized diff in this scenario. The field exactly_one_of should handle this appropriately. Seems this behavior we a misstep on our part.

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=163084"

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

@ScottSuarez
Copy link
Contributor

/gcbrun

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=163188"

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

@Gilles95
Copy link
Contributor Author

Hello @ScottSuarez ,
Let me know if I can do anything to help on this PR.
If you are on holidays, then enjoy and will see that next year ;-)
Thanks
Gilles

@ScottSuarez
Copy link
Contributor

Hi @Gilles95, sort of in semi holiday mode. Imma try to get this in for you though. Although it's worth noting we won't be releasing until January. Hope you are having a great holiday :) .

@ScottSuarez
Copy link
Contributor

/gcbrun

@modular-magician
Copy link
Collaborator

I have triggered VCR tests based on this PR's diffs. See the results here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=164214"

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

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceComposerEnvironment_basic|TestAccDataSourceSpannerInstance_basic|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccBigqueryDataTransferConfig|TestAccBillingBudget_billingBudgetBasicExample|TestAccBillingBudget_billingBudgetLastperiodExample|TestAccBillingBudget_billingBudgetFilterExample|TestAccBillingBudget_billingBudgetNotifyExample|TestAccCloudRunDomainMapping_cloudRunDomainMappingBasicExample|TestAccComposerEnvironment_withUpdateOnCreate|TestAccComputeBackendService_backendServiceCacheExample|TestAccComputeRegionUrlMap_defaultUrlRedirectWithinPathMatcher|TestAccComputeRouterNat_basic|TestAccComputeRouterNat_update|TestAccComputeRouterNat_withManualIpAndSubnetConfiguration|TestAccComputeRouterNat_withNatIpsAndDrainNatIps|TestAccContainerCluster_withAdvancedDatapath|TestAccOSLoginSSHPublicKey_osLoginSshKeyExpiry You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=164217"

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.

3 participants