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 prefix to API Config #4193

Merged
merged 12 commits into from
Nov 9, 2020

Conversation

upodroid
Copy link
Contributor

@upodroid upodroid commented Nov 5, 2020

Fixes: hashicorp/terraform-provider-google#7724

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)

apigateway: added api_config_id_prefix field to `google_api_gateway_api_config` resoure

@google-cla google-cla bot added the cla: yes label Nov 5, 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.

@rileykarson, 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 ( 10 files changed, 77 insertions(+), 149 deletions(-))
Terraform Beta: Diff ( 15 files changed, 153 insertions(+), 167 deletions(-))
TF OiCS: Diff ( 2 files changed, 8 insertions(+), 2 deletions(-))

@upodroid
Copy link
Contributor Author

upodroid commented Nov 5, 2020

There is a weird bug with the API at the moment, it is returning 500 . There is an open case with Google for answers.

---[ REQUEST ]---------------------------------------
POST /v1beta/projects/REDACTED/locations/global/apis/tf-test-api-cfgowiilumik8/configs?alt=json&apiConfigId=tf-test-api-cfgowiilumik820201105142719960700000001 HTTP/1.1
Host: apigateway.googleapis.com
User-Agent: Terraform/0.13.2 (+https://www.terraform.io) Terraform-Plugin-SDK/2.0.3 terraform-provider-google-beta/acc
Content-Length: 639
Content-Type: application/json
Accept-Encoding: gzip

{
 "openapiDocuments": [
  {
   "document": {
    "contents": "c3dhZ2dlcjogJzIuMCcKaW5mbzoKICB0aXRsZTogZGV2IAogIGRlc2NyaXB0aW9uOiBTYW1wbGUgQVBJIG9uIEFQSSBHYXRld2F5IHdpdGggYSBDbG91ZCBSdW4gYmFja2VuZAogIHZlcnNpb246IDEuMC4wCnNjaGVtZXM6CiAgLSBodHRwcwpwcm9kdWNlczoKICAtIGFwcGxpY2F0aW9uL2pzb24KcGF0aHM6CiAgL2hlbGxvOgogICAgZ2V0OgogICAgICBzdW1tYXJ5OiBHcmVldCBhIHVzZXIKICAgICAgb3BlcmF0aW9uSWQ6IGhlbGxvCiAgICAgIHgtZ29vZ2xlLWJhY2tlbmQ6CiAgICAgICAgYWRkcmVzczogaHR0cHM6Ly9nb29nbGUuY29tCiAgICAgIHJlc3BvbnNlczoKICAgICAgICAnMjAwJzoKICAgICAgICAgIGRlc2NyaXB0aW9uOiBBIHN1Y2Nlc3NmdWwgcmVzcG9uc2UKICAgICAgICAgIHNjaGVtYToKICAgICAgICAgICAgdHlwZTogc3RyaW5n",
    "path": "spec.yaml"
   }
  }
 ]
}

-----------------------------------------------------
2020/11/05 14:33:09 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 500 Internal Server Error
Connection: close
Transfer-Encoding: chunked
Alt-Svc: h3-Q050=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private
Content-Type: application/json; charset=UTF-8
Date: Thu, 05 Nov 2020 14:33:09 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

97
{
  "error": {
    "code": 500,
    "message": "An internal error has occurred (c01394bc-6486-46fb-ace4-e27d61d3d715)",
    "status": "INTERNAL"
  }
}

@upodroid
Copy link
Contributor Author

upodroid commented Nov 5, 2020

Apparently, there are undocumented character limits which is 36 at the moment.

@upodroid
Copy link
Contributor Author

upodroid commented Nov 5, 2020

API Config is fixed now.

What do I do about:

  • google-beta/resource_access_approval_*_settings.go
  • google-beta/resource_os_login_ssh_public_key.go

These resources are tweaking the url variable before replaceVars function.

@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 ( 10 files changed, 78 insertions(+), 150 deletions(-))
Terraform Beta: Diff ( 15 files changed, 154 insertions(+), 168 deletions(-))
TF OiCS: Diff ( 2 files changed, 8 insertions(+), 2 deletions(-))

@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, 13 insertions(+), 92 deletions(-))
Terraform Beta: Diff ( 8 files changed, 102 insertions(+), 110 deletions(-))
TF OiCS: Diff ( 2 files changed, 8 insertions(+), 2 deletions(-))

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Generally looks good, although I think we can make a slightly stronger assertion (ExactlyOneOf) in schema.

/gcbrun

products/apigateway/api.yaml Show resolved Hide resolved
products/apigateway/terraform.yaml Outdated Show resolved Hide resolved
@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, 13 insertions(+), 92 deletions(-))
Terraform Beta: Diff ( 8 files changed, 103 insertions(+), 110 deletions(-))
TF OiCS: Diff ( 2 files changed, 8 insertions(+), 2 deletions(-))

@upodroid upodroid force-pushed the api-config-prefixes branch from 9a2ce6c to 52d51fc Compare November 6, 2020 17:48
@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, 13 insertions(+), 92 deletions(-))
Terraform Beta: Diff ( 8 files changed, 102 insertions(+), 110 deletions(-))
TF OiCS: Diff ( 2 files changed, 8 insertions(+), 2 deletions(-))

@rileykarson
Copy link
Member

/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=156424"

@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, 13 insertions(+), 92 deletions(-))
Terraform Beta: Diff ( 8 files changed, 102 insertions(+), 110 deletions(-))
TF OiCS: Diff ( 2 files changed, 8 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceSpannerInstance_basic|TestAccApiGatewayApiConfigIamBindingGenerated|TestAccApiGatewayApiConfigIamMemberGenerated|TestAccApiGatewayApiConfigIamPolicyGenerated|TestAccApiGatewayGatewayIamBindingGenerated|TestAccApiGatewayGatewayIamMemberGenerated|TestAccApiGatewayGatewayIamPolicyGenerated|TestAccApiGatewayApiConfig_apigatewayApiConfigBasicExample|TestAccApiGatewayApiConfig_apigatewayApiConfigBasicExampleUpdated|TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated|TestAccApiGatewayGateway_apigatewayGatewayBasicExample|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccBigqueryDataTransferConfig|TestAccComposerEnvironment_withUpdateOnCreate|TestAccFilestoreInstance_filestoreInstanceBasicExample|TestAccFilestoreInstance_update|TestAccOSLoginSSHPublicKey_osLoginSshKeyExpiry You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=156436"

@rileykarson
Copy link
Member

Runtime error on the recording step, rerunning.

/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=156437"

@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, 13 insertions(+), 92 deletions(-))
Terraform Beta: Diff ( 8 files changed, 102 insertions(+), 110 deletions(-))
TF OiCS: Diff ( 2 files changed, 8 insertions(+), 2 deletions(-))

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccDataSourceSpannerInstance_basic|TestAccApiGatewayApiConfigIamBindingGenerated|TestAccApiGatewayApiConfigIamMemberGenerated|TestAccApiGatewayApiConfigIamPolicyGenerated|TestAccApiGatewayGatewayIamBindingGenerated|TestAccApiGatewayGatewayIamMemberGenerated|TestAccApiGatewayGatewayIamPolicyGenerated|TestAccApiGatewayApiConfig_apigatewayApiConfigBasicExample|TestAccApiGatewayApiConfig_apigatewayApiConfigBasicExampleUpdated|TestAccApiGatewayGateway_apigatewayGatewayBasicExample|TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated|TestAccActiveDirectoryDomainTrust_activeDirectoryDomainTrustBasicExample|TestAccBigqueryDataTransferConfig|TestAccComposerEnvironment_withUpdateOnCreate|TestAccFilestoreInstance_filestoreInstanceBasicExample|TestAccFilestoreInstance_update|TestAccOSLoginSSHPublicKey_osLoginSshKeyExpiry You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=156453"

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.

API Config Prefix field
3 participants