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 properties field to apigee environment resource #12752

Merged

Conversation

Lagu22
Copy link
Contributor

@Lagu22 Lagu22 commented Jan 14, 2025

Added properties field to Apigee environment resource as described in the Apigee API docs: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

apigee: added `properties` field to `google_apigee_environment` resource

@Lagu22 Lagu22 marked this pull request as ready for review January 14, 2025 18:55
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 14, 2025
@github-actions github-actions bot requested a review from zli82016 January 14, 2025 18:56
Copy link

github-actions bot commented Jan 14, 2025

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

@hao-nan-li, 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 modular-magician added service/apigee and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jan 14, 2025
@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.

google provider: Diff ( 2 files changed, 167 insertions(+))
google-beta provider: Diff ( 2 files changed, 167 insertions(+))
terraform-google-conversion: Diff ( 1 file changed, 62 insertions(+))

Missing test report

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

Resource: google_apigee_environment (35 total tests)
Please add an acceptance test which includes these fields. The test should include the following:

resource "google_apigee_environment" "primary" {
  properties {
    property {
      name  = # value needed
      value = # value needed
    }
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 53
Passed tests: 17
Skipped tests: 35
Affected tests: 1

Click here to see the affected service packages
  • apigee

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccApigeeEnvironmentAddonsConfig_apigeeEnvAddonsAnalyticsTestExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

mmv1/products/apigee/Environment.yaml Outdated Show resolved Hide resolved
@zli82016
Copy link
Member

Can you please add the update test for the new field by following the doc? Thanks.

@zli82016
Copy link
Member

🔴 Tests failed during RECORDING mode: TestAccApigeeEnvironmentAddonsConfig_apigeeEnvAddonsAnalyticsTestExample [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

The failed test is unrelated.

@github-actions github-actions bot requested a review from zli82016 January 15, 2025 19:44
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 15, 2025
@Lagu22
Copy link
Contributor Author

Lagu22 commented Jan 15, 2025

Can you please add the update test for the new field by following the doc? Thanks.

I updated the existing 'update' test to include the new field. I am currently in a unfortunate position - I cannot run these tests locally at the moment. Is there an option to run the acceptance tests in some sort of environment (containerized?) where billing charges would not be accrued?

@zli82016
Copy link
Member

Can you please add the update test for the new field by following the doc? Thanks.

I updated the existing 'update' test to include the new field. I am currently in a unfortunate position - I cannot run these tests locally at the moment. Is there an option to run the acceptance tests in some sort of environment (containerized?) where billing charges would not be accrued?

The test will run in this PR

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 15, 2025
@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.

google provider: Diff ( 3 files changed, 173 insertions(+))
google-beta provider: Diff ( 3 files changed, 173 insertions(+))
terraform-google-conversion: Diff ( 1 file changed, 62 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 53
Passed tests: 16
Skipped tests: 35
Affected tests: 2

Click here to see the affected service packages
  • apigee

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
  • TestAccApigeeEnvironmentAddonsConfig_apigeeEnvAddonsAnalyticsTestExample
  • TestAccApigeeEnvironment_apigeeEnvironmentUpdateTest

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccApigeeEnvironmentAddonsConfig_apigeeEnvAddonsAnalyticsTestExample [Error message] [Debug log]
TestAccApigeeEnvironment_apigeeEnvironmentUpdateTest [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

@zli82016
Copy link
Member

The test TestAccApigeeEnvironment_apigeeEnvironmentUpdateTest failed. It looks like the properties field is not updated in API side.

Request

PATCH /v1/organizations/tf-testrirhw3kx9o/environments/tf-testrirhw3kx9o?alt=json&updateMask=displayName%2Cdescription%2Cproperties HTTP/1.1
Host: apigee.googleapis.com
User-Agent: Terraform/1.10.0 (+https://www.terraform.io) Terraform-Plugin-SDK/2.33.0 terraform-provider-google-beta/acc
Content-Length: 176
Content-Type: application/json
Accept-Encoding: gzip

{
 "description": "Updated Apigee Environment Description",
 "displayName": "environment-1-updated",
 "properties": {
  "property": [
   {
    "name": "property-1-key",
    "value": "property-1-value"
   }
  ]
 }
}

Response

---[ REQUEST ]---------------------------------------
GET /v1/organizations/tf-testrirhw3kx9o/environments/tf-testrirhw3kx9o?alt=json HTTP/1.1
Host: apigee.googleapis.com
User-Agent: Terraform/1.10.0 (+https://www.terraform.io) Terraform-Plugin-SDK/2.33.0 terraform-provider-google-beta/acc
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------
2025/01/15 20:24:18 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Type: application/json; charset=UTF-8
Date: Wed, 15 Jan 2025 20:24:18 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "name": "tf-testrirhw3kx9o",
  "description": "Apigee Environment",
  "createdAt": "1736972617275",
  "lastModifiedAt": "1736972622408",
  "displayName": "environment-1",
  "state": "ACTIVE",
  "deploymentType": "PROXY",
  "apiProxyType": "PROGRAMMABLE"
}

@Lagu22 , do you have an idea if the API supports properties update?

@Lagu22
Copy link
Contributor Author

Lagu22 commented Jan 15, 2025

The test TestAccApigeeEnvironment_apigeeEnvironmentUpdateTest failed. It looks like the properties field is not updated in API side.

Request

PATCH /v1/organizations/tf-testrirhw3kx9o/environments/tf-testrirhw3kx9o?alt=json&updateMask=displayName%2Cdescription%2Cproperties HTTP/1.1
Host: apigee.googleapis.com
User-Agent: Terraform/1.10.0 (+https://www.terraform.io) Terraform-Plugin-SDK/2.33.0 terraform-provider-google-beta/acc
Content-Length: 176
Content-Type: application/json
Accept-Encoding: gzip

{
 "description": "Updated Apigee Environment Description",
 "displayName": "environment-1-updated",
 "properties": {
  "property": [
   {
    "name": "property-1-key",
    "value": "property-1-value"
   }
  ]
 }
}

Response

---[ REQUEST ]---------------------------------------
GET /v1/organizations/tf-testrirhw3kx9o/environments/tf-testrirhw3kx9o?alt=json HTTP/1.1
Host: apigee.googleapis.com
User-Agent: Terraform/1.10.0 (+https://www.terraform.io) Terraform-Plugin-SDK/2.33.0 terraform-provider-google-beta/acc
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------
2025/01/15 20:24:18 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 200 OK
Content-Type: application/json; charset=UTF-8
Date: Wed, 15 Jan 2025 20:24:18 GMT
Server: ESF
Vary: Origin
Vary: X-Origin
Vary: Referer
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

{
  "name": "tf-testrirhw3kx9o",
  "description": "Apigee Environment",
  "createdAt": "1736972617275",
  "lastModifiedAt": "1736972622408",
  "displayName": "environment-1",
  "state": "ACTIVE",
  "deploymentType": "PROXY",
  "apiProxyType": "PROGRAMMABLE"
}

@Lagu22 , do you have an idea if the API supports properties update?

Based on the API doc: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments/update it does when the update is made as a PUT.
Looking at the logs you shared it appears the the API call actually made is this PATCH: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments/modifyEnvironment

@zli82016
Copy link
Member

zli82016 commented Jan 15, 2025

Based on the API doc: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments/update it does when the update is made as a PUT. Looking at the logs you shared it appears the the API call actually made is this PATCH: https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments/modifyEnvironment

I see. That is a separate issue. Thanks for the information.

Created a Github issue

@zli82016
Copy link
Member

@Lagu22 , can you add the new field to a create test? Thanks.

@zli82016
Copy link
Member

@modular-magician reassign-reviewer

@github-actions github-actions bot requested a review from hao-nan-li January 16, 2025 00:34
@Lagu22
Copy link
Contributor Author

Lagu22 commented Jan 16, 2025

@Lagu22 , can you add the new field to a create test? Thanks.

Added per the doc link you provided. Should I leave the update test as is in this PR or remove the modifications I made to it?

@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 16, 2025
@zli82016
Copy link
Member

@Lagu22 , can you add the new field to a create test? Thanks.

Added per the doc link you provided. Should I leave the update test as is in this PR or remove the modifications I made to it?

You can leave the update test in this PR

@modular-magician modular-magician removed the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Jan 16, 2025
@Lagu22
Copy link
Contributor Author

Lagu22 commented Jan 16, 2025

@Lagu22 , can you add the new field to a create test? Thanks.

Added per the doc link you provided. Should I leave the update test as is in this PR or remove the modifications I made to it?

You can leave the update test in this PR

OK, thank you for the swift reply. Please let me know if I can be of assistance on the issue you created. Happy to contribute where I can.

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

google provider: Diff ( 4 files changed, 284 insertions(+))
google-beta provider: Diff ( 4 files changed, 284 insertions(+))
terraform-google-conversion: Diff ( 1 file changed, 62 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 54
Passed tests: 16
Skipped tests: 36
Affected tests: 2

Click here to see the affected service packages
  • apigee
#### Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccApigeeEnvironment_apigeeEnvironmentBasicPropertiesTestExample

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
  • TestAccApigeeEnvironmentAddonsConfig_apigeeEnvAddonsAnalyticsTestExample
  • TestAccApigeeEnvironment_apigeeEnvironmentUpdateTest

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccApigeeEnvironmentAddonsConfig_apigeeEnvAddonsAnalyticsTestExample [Error message] [Debug log]
TestAccApigeeEnvironment_apigeeEnvironmentUpdateTest [Error message] [Debug log]

🔴 Errors occurred during RECORDING mode. Please fix them to complete your PR.

View the build log or the debug log for each test

Copy link
Member

@zli82016 zli82016 left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants