magic-modules icon indicating copy to clipboard operation
magic-modules copied to clipboard

Adding resource google_apigee_developer_app

Open rickygodoy opened this issue 6 months ago • 9 comments

#23363

Adding a first version for google_apigee_developer_app.

`google_apigee_developer_app`

rickygodoy avatar Jun 20 '25 18:06 rickygodoy

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 ( 6 files changed, 1765 insertions(+), 2 deletions(-)) google-beta provider: Diff ( 6 files changed, 1765 insertions(+), 2 deletions(-)) terraform-google-conversion: Diff ( 1 file changed, 164 insertions(+))

Missing test report

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

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

resource "google_apigee_developer_app" "primary" {
  api_products = # value needed
  credentials {
    api_products {
      apiproduct = # value needed
      status     = # value needed
    }
    attributes {
      name  = # value needed
      value = # value needed
    }
    consumer_key    = # value needed
    consumer_secret = # value needed
    expires_at      = # value needed
    issued_at       = # value needed
    scopes          = # value needed
    status          = # value needed
  }
  key_expires_in = # value needed
  scopes         = # value needed
  status         = # value needed
}


modular-magician avatar Jun 20 '25 18:06 modular-magician

Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccApigeeDeveloperApp_apigeeDeveloperAppBasicTestExample
  • TestAccApigeeDeveloperApp_apigeeDeveloperAppWithAttributesTestExample
  • TestAccApigeeDeveloperApp_apigeeDeveloperApp_full

Tests analytics

Total tests: 0 Passed tests: 0 Skipped tests: 0 Affected tests: 0

Click here to see the affected service packages
  • apigee
🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR.

View the build log

modular-magician avatar Jun 20 '25 18:06 modular-magician

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 ( 6 files changed, 1763 insertions(+), 2 deletions(-)) google-beta provider: Diff ( 6 files changed, 1763 insertions(+), 2 deletions(-)) terraform-google-conversion: Diff ( 1 file changed, 164 insertions(+))

Missing test report

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

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

resource "google_apigee_developer_app" "primary" {
  api_products = # value needed
  credentials {
    api_products {
      apiproduct = # value needed
      status     = # value needed
    }
    attributes {
      name  = # value needed
      value = # value needed
    }
    consumer_key    = # value needed
    consumer_secret = # value needed
    expires_at      = # value needed
    issued_at       = # value needed
    scopes          = # value needed
    status          = # value needed
  }
  key_expires_in = # value needed
  scopes         = # value needed
  status         = # value needed
}


modular-magician avatar Jun 20 '25 18:06 modular-magician

Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccApigeeDeveloperApp_apigeeDeveloperAppBasicTestExample
  • TestAccApigeeDeveloperApp_apigeeDeveloperAppWithAttributesTestExample
  • TestAccApigeeDeveloperApp_apigeeDeveloperApp_full

Tests analytics

Total tests: 64 Passed tests: 20 Skipped tests: 44 Affected tests: 0

Click here to see the affected service packages
  • apigee
🟢 All tests passed!

View the build log

modular-magician avatar Jun 20 '25 18:06 modular-magician

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 ( 6 files changed, 1762 insertions(+), 2 deletions(-)) google-beta provider: Diff ( 6 files changed, 1762 insertions(+), 2 deletions(-)) terraform-google-conversion: Diff ( 1 file changed, 164 insertions(+))

Missing test report

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

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

resource "google_apigee_developer_app" "primary" {
  api_products = # value needed
  scopes       = # value needed
}


modular-magician avatar Jun 20 '25 20:06 modular-magician

Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccApigeeDeveloperApp_apigeeDeveloperApp_full

Tests analytics

Total tests: 64 Passed tests: 20 Skipped tests: 42 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
  • TestAccApigeeDeveloperApp_apigeeDeveloperAppBasicTestExample
  • TestAccApigeeDeveloperApp_apigeeDeveloperAppWithAttributesTestExample

Get to know how VCR tests work

modular-magician avatar Jun 20 '25 20:06 modular-magician

🟢 Tests passed during RECORDING mode: TestAccApigeeDeveloperApp_apigeeDeveloperAppBasicTestExample [Debug log] TestAccApigeeDeveloperApp_apigeeDeveloperAppWithAttributesTestExample [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

modular-magician avatar Jun 20 '25 21:06 modular-magician

Tested locally with success:

resource "google_apigee_developer_app" "app" {
  name            = "teste_app"
  developer_email = "[email protected]"
  org_id          = "organizations/rgodoy-apigee"
  callback_url    = "http://localhost"

  attributes {
    name  = "sample_name"
    value = "sample_value"
  }
}

Creating: Screenshot 2025-06-20 at 18 14 07

After creation: Screenshot 2025-06-20 at 18 14 29

Changing fields: Screenshot 2025-06-20 at 18 18 43

Importing: Screenshot 2025-06-20 at 18 20 19

I'm only waiting for the Apigee Product resource (which my peer is working on) to add those 2 missing fields, but I guess it's worth the review already (it's my first contribution here, would love some tips).

rickygodoy avatar Jun 20 '25 21:06 rickygodoy

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

Googlers: For automatic test runs see go/terraform-auto-test-runs.

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

github-actions[bot] avatar Jun 20 '25 21:06 github-actions[bot]

One final practical test with all parameters:

Screenshot 2025-06-23 at 11 47 52

Created successfully on console: Screenshot 2025-06-23 at 11 48 31

rickygodoy avatar Jun 23 '25 14:06 rickygodoy

Triggered the skipped test TestAccApigeeDeveloperApp_apigeeDeveloperApp_full on TC. I'll update the test result once it's complete

shuyama1 avatar Jun 23 '25 20:06 shuyama1

@shuyama1

Thanks, I'm reviewing all of those items right now 😄

One question: how can I run the exact same test locally? After generating the provider and building, I try make testacc TEST=./google/services/apigee TESTARGS='-run=TestAccApigeeDeveloperApp_apigeeDeveloperApp_full but I don't get the same output as you did.

rickygodoy avatar Jun 24 '25 16:06 rickygodoy

@shuyama1

After some deeper analysis and tests, I realized the developers.apps create API is not idempotent and the right way would be to use developers.apps.keys and developers.apps.keys.apiproducts to correctly maintain the flow and state for the credentials, just like the web interface does.

For that, I'll create two different resources, a developer_app to be the parent:

Screenshot 2025-06-29 at 22 47 00 Screenshot 2025-06-29 at 22 47 27

And a developer_app_credential to represent a credential within the app:

Screenshot 2025-06-29 at 22 47 11

By doing that, it'll be possible to create and manage multiple credentials, add/remove products to each of them and also approve/revoke status at app, credential and product level (just like the web interface provides).

I'm closing this PR and soon I'll open 2, one for each resource described above.

Thanks!

rickygodoy avatar Jun 30 '25 14:06 rickygodoy