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

Update urlRedirect property of UrlMap and RegionUrlMap #3378

Merged

Conversation

ctavan
Copy link
Contributor

@ctavan ctavan commented Apr 15, 2020

Release Note Template for Downstream PRs (will be copied)

compute: `google_compute_region_url_map` mark `strip_query` as optional and default to false
compute: `google_compute_url_map` mark `strip_query` as optional and default to false

@googlebot
Copy link

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.

@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.

@emilymye, 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, 56 insertions(+), 39 deletions(-))
Terraform Beta: Diff ( 4 files changed, 170 insertions(+), 116 deletions(-))
Ansible: Diff ( 4 files changed, 171 insertions(+), 109 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.

@ctavan
Copy link
Contributor Author

ctavan commented Apr 15, 2020

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@danawillow danawillow requested a review from slevenick April 21, 2020 22:41
@danawillow
Copy link
Contributor

Picking a new reviewer randomly while Emily's out

@slevenick
Copy link
Contributor

Looks good, thanks @ctavan

Can I have you push a new commit to this branch to re-trigger the build checks? I added a changelog note so it should pass that step now. You can just amend your previous commit and force push

* The stripQuery parameter should not be required since it is set to
  false by default.
* Documentation has been synced with:
  https://cloud.google.com/compute/docs/reference/rest/v1/urlMaps
@ctavan ctavan force-pushed the update-url-redirect-property branch from 6f0d41c to 31153d5 Compare April 23, 2020 21:01
@ctavan
Copy link
Contributor Author

ctavan commented Apr 23, 2020

@slevenick I rebased and did a force push.

@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, 56 insertions(+), 39 deletions(-))
Terraform Beta: Diff ( 4 files changed, 170 insertions(+), 116 deletions(-))
Ansible: Diff ( 4 files changed, 171 insertions(+), 109 deletions(-))

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.

Thanks for the updates!

@danawillow
Copy link
Contributor

Eep, this change allows a config to contain an empty url_redirect{} block, which we try not to allow because they're pretty error-prone (for some reason I thought I had written this up in https://github.com/terraform-providers/terraform-provider-google/wiki/Developer-Best-Practices, but doesn't look like it so we'll say this was on me). A huge number of our 3.0.0 changes were to prevent this situation (hashicorp/terraform-provider-google#3928). Is there a different field in that block that we could set to Required, or could we add an AtLeastOneOf to the block as a whole?

@ctavan
Copy link
Contributor Author

ctavan commented Apr 29, 2020

Uhh, ooh… I'm sorry, I was definitely not aware of that!

From reading the docs I cannot tell for sure if there is any of the properties in the urlRedirect group are required, I agree that AtLeastOneOf would be a nicer solution but.

If we have to go back to the workaround of making at least one property required I think we should

  1. document in the yaml file that this is a workaround and does not mirror the actual requirements of the API and
  2. I'd vote for httpsRedirect as the flag instead of stripQuery.

All that I can tell for sure is that if this is a problem we have the same problem with the defaultUrlRedirect blocks (#3379) and that we have this problem for UrlMap and for RegionUrlMap.

@slevenick
Copy link
Contributor

Ack I missed this!

I'll go back through the fields changed in this PR and those added in #3379 to require the stripQuery field.

Unfortunately we can't switch from having stripQuery required to httpsRedirect at this point because that would break user configs that haven't specified httpsRedirect.

nathkn pushed a commit to nathkn/magic-modules that referenced this pull request May 18, 2020
…atform#3378)

* The stripQuery parameter should not be required since it is set to
  false by default.
* Documentation has been synced with:
  https://cloud.google.com/compute/docs/reference/rest/v1/urlMaps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants