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

feat(apihub): Add support for API Hub Attributes

Open jayce-jia opened this issue 2 months ago • 13 comments

Fixes https://github.com/hashicorp/terraform-provider-google/issues/24372

  • Add google_apihub_attribute resource
  • Add pre_create hook to stop creation for system-defined attributes earlier

Release Note Template for Downstream PRs (will be copied)

See Write release notes for guidance.

`google_apihub_attribute`

jayce-jia avatar Oct 02 '25 11:10 jayce-jia

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.

@NickElliot, 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 Oct 02 '25 11:10 github-actions[bot]

@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Oct 07 '25 09:10 github-actions[bot]

@GoogleCloudPlatform/terraform-team @NickElliot This PR has been waiting for review for 1 week. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Oct 09 '25 09:10 github-actions[bot]

@jayce-jia, this PR is waiting for action from you. If no action is taken, this PR will be closed in 28 days.

Please address any comments or change requests, or re-request review from a core reviewer if no action is required.

Image showing the re-request review button

This notification can be disabled with the disable-automatic-closure label.

github-actions[bot] avatar Oct 23 '25 09:10 github-actions[bot]

is there a reason you couldnt include creating an apihub instance in the tests?

Hi @NickElliot sorry somehow missed the message. TBH I didn't dig deep into how the hub instance should be created for tests.

Just referred to all other resources (example), tests were all excluded. I supposed there was a reason and the apihub team should be resolving this.

I'm not very familiar with the testing infra of this project. But happy to explore that if you have an example.

jayce-jia avatar Oct 23 '25 13:10 jayce-jia

@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Oct 28 '25 09:10 github-actions[bot]

No worries Nick, yes I've done tests on my local and CRUD for resources are good. I'm using this forked version to provision attributes for my projects now and no further issues.

jayce-jia avatar Oct 31 '25 10:10 jayce-jia

@NickElliot This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Nov 05 '25 09:11 github-actions[bot]

@NickElliot This PR is approved and has been waiting for merge for 1 week. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Nov 12 '25 09:11 github-actions[bot]

@NickElliot This PR is approved and has been waiting for merge for 2 weeks. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Nov 19 '25 09:11 github-actions[bot]

@NickElliot This PR is approved and has been waiting for merge for 3 weeks. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Nov 26 '25 09:11 github-actions[bot]

@NickElliot This PR is approved and has been waiting for merge for 4 weeks. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Dec 03 '25 09:12 github-actions[bot]

@NickElliot This PR is approved and has been waiting for merge for 5 weeks. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Dec 10 '25 09:12 github-actions[bot]

@NickElliot This PR is approved and has been waiting for merge for 6 weeks. Is it ready to merge? Use the label disable-review-reminders to disable these notifications.

github-actions[bot] avatar Dec 17 '25 09:12 github-actions[bot]

/gcbrun

NickElliot avatar Dec 19 '25 18:12 NickElliot

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

Missing test report

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

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

resource "google_apihub_attribute" "primary" {
  allowed_values {
    description  = # value needed
    display_name = # value needed
    id           = # value needed
    immutable    = # value needed
  }
  attribute_id = # value needed
  cardinality  = # value needed
  data_type    = # value needed
  description  = # value needed
  display_name = # value needed
  location     = # value needed
  scope        = # value needed
}


modular-magician avatar Dec 19 '25 18:12 modular-magician

Tests analytics

Total tests: 2 Passed tests: 1 Skipped tests: 1 Affected tests: 0

Click here to see the affected service packages
  • apihub

🟢 All tests passed!

View the build log

modular-magician avatar Dec 19 '25 18:12 modular-magician