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

Added code for Apigee environment groups #4570

Merged
merged 35 commits into from
Mar 10, 2021

Conversation

priya-saxena21
Copy link
Contributor

@priya-saxena21 priya-saxena21 commented Mar 8, 2021

Fixes hashicorp/terraform-provider-google#8627

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_apigee_envgroup

@google-cla google-cla bot added the cla: yes label Mar 8, 2021
@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.

@slevenick, 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 ( 6 files changed, 737 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 7 files changed, 738 insertions(+), 3 deletions(-))
TF Conversion: Diff ( 1 file changed, 64 insertions(+))

@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=176155"

@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 ( 6 files changed, 737 insertions(+), 2 deletions(-))
Terraform Beta: Diff ( 7 files changed, 739 insertions(+), 3 deletions(-))
TF Conversion: Diff ( 1 file changed, 64 insertions(+))

@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=176156"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=176157"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=176158"

@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated Please fix these to complete your PR

1 similar comment
@modular-magician
Copy link
Collaborator

Tests failed during RECORDING mode: TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated Please fix these to complete your PR

mmv1/products/apigee/api.yaml Show resolved Hide resolved

nameParts := strings.Split(d.Get("name").(string), "/")
if len(nameParts) == 4 {
// `organizations/{{org_name}}/environments/{{name}}`
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it is referring to environments rather than envgroups. Does this custom import need to exist? Have you ran into problems importing it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry it was a typo. Yes we need the custom imports. I fixed it to envgroups now in the latest commit.

# the resources needed for the acceptance test.
name: "apigee_environment_group_basic_test"
primary_resource_id: "apigee_environment_group"
test_env_vars:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want to add some special handling for the service networking connection. That resource causes problems for our CI. We want to bootstrap these networks for sharing across apigee org tests. See https://github.com/GoogleCloudPlatform/magic-modules/blob/master/mmv1/products/redis/terraform.yaml#L41 for an example

Copy link
Member

Choose a reason for hiding this comment

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

The reason why we can't use a boostrapped VPC/service networking is that those need to be created on the ephemeral project where we host the parent Apigee org that owns this resource. Even if we were to have the VPC on a shared VPC on the integration host project, we'd need to set these ephemeral projects as service projects to the integration project.

So a better solution would be to create a bootstrapped Apigee Org, and not recreate the Org for every child resource we implement. We already have three: Instances, Environments and Environments groups, which should not be creating Orgs. as part of their acceptance tests as that is a complex operation as the steps show.

We discussed this briefly here but unfortunately I had no time to look into this yet. Although I still want to do it, I think this shouldn't block the envgroups functionality here, since these tests are valid, just not ideal/optimized.

mmv1/products/apigee/api.yaml Outdated Show resolved Hide resolved
return nil, fmt.Errorf("Error setting name: %s", err)
}
} else if len(nameParts) == 3 {
// `organizations/{{org_name}}/{{name}}`
Copy link
Contributor

Choose a reason for hiding this comment

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

Why would we expect this form? I don't think we even want to support this form, it doesn't match any of our current patterns for formats that I'm aware of

@@ -13,13 +13,13 @@ if $(echo $USER | fgrep -wq -e ndmckinley -e danawillow -e emilymye -e megan07 -
exit 0
else
echo "Checking GCP org membership"
GCP_MEMBER=$(curl -sw '%{http_code}' -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/orgs/GoogleCloudPlatform/members/$USER -o /dev/null)
GCP_MEMBER=$(curl -Lsw '%{http_code}' -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/orgs/GoogleCloudPlatform/members/$USER -o /dev/null)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what happened here, but it looks like you've picked up changes from another branch. Can you rebase off of a current version of master to get rid of these? They are also blocking the diff generator from running

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

@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=176393"

@modular-magician
Copy link
Collaborator

I have triggered VCR tests in RECORDING mode for the following tests that failed during VCR: TestAccApiGatewayGateway_apigatewayGatewayBasicExampleUpdated You can view the result here: "https://ci-oss.hashicorp.engineering/viewQueued.html?itemId=176489"

@slevenick slevenick self-requested a review March 10, 2021 01:09
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.

I'd like to change the testing structure so that it works with VCR in the future, but this should work for now

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.

Add support for Apigee Environment Groups
5 participants