Skip to content

Add support for projects field in Developer Connect Insights InsightsConfig resource#16184

Merged
shuyama1 merged 6 commits intoGoogleCloudPlatform:mainfrom
ishamiGIT:feat/dci-tf-coverage-projectids
Feb 12, 2026
Merged

Add support for projects field in Developer Connect Insights InsightsConfig resource#16184
shuyama1 merged 6 commits intoGoogleCloudPlatform:mainfrom
ishamiGIT:feat/dci-tf-coverage-projectids

Conversation

@ishamiGIT
Copy link
Contributor

@ishamiGIT ishamiGIT commented Jan 21, 2026

This PR adds support for the project_ids field within the projects block for the google_developer_connect_insights_config resource. This enables users to specify target projects when configuring Developer Connect Insights.

The following changes are included:

  • Updated mmv1/products/developerconnect/InsightsConfig.yaml to include the new field.
  • Implemented new acceptance test cases for creating the project_ids field.

Addresses hashicorp/terraform-provider-google#25855

developerconnect: added `target_projects` field to `google_developer_connect_insights_config` resource

@github-actions github-actions bot requested a review from shuyama1 January 21, 2026 17:36
@github-actions
Copy link

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.

@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, 135 insertions(+), 17 deletions(-))
google-beta provider: Diff ( 4 files changed, 135 insertions(+), 17 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 32 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 33
Passed tests: 31
Skipped tests: 2
Affected tests: 0

Click here to see the affected service packages
  • developerconnect

🟢 All tests passed!

View the build log

@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, 135 insertions(+), 17 deletions(-))
google-beta provider: Diff ( 4 files changed, 135 insertions(+), 17 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 32 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 33
Passed tests: 31
Skipped tests: 2
Affected tests: 0

Click here to see the affected service packages
  • developerconnect

🟢 All tests passed!

View the build log

@shuyama1
Copy link
Member

Test is skipped in VCR. Running test on TC and I'll update the test result here when it completes

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Test failed with error:

=== RUN   TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigBasicExample
=== PAUSE TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigBasicExample
=== CONT  TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigBasicExample
    resource_developer_connect_insights_config_generated_test.go:63: Step 1/2 error: After applying this test step, the plan was not empty.
        stdout:
        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place
        Terraform will perform the following actions:
          # google_developer_connect_insights_config.insights_config_projects will be updated in-place
          ~ resource "google_developer_connect_insights_config" "insights_config_projects" {
                id                    = "projects/dci-tf-1aap91xhyt/locations/us-central1/insightsConfigs/tf-test-ic-projects-1aap91xhyt"
                name                  = "projects/dci-tf-1aap91xhyt/locations/us-central1/insightsConfigs/tf-test-ic-projects-1aap91xhyt"
                # (13 unchanged attributes hidden)
              ~ projects {
                  ~ project_ids = [
                      ~ "projects/337985338891" -> "dci-tf-1aap91xhyt",
                    ]
                }
            }
        Plan: 0 to add, 1 to change, 0 to destroy.
--- FAIL: TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigBasicExample (265.60s)
FAIL

It seems the API does not return the values for the field project_ids as sent, which causes a permadiff in Terraform. See details at https://googlecloudplatform.github.io/magic-modules/develop/diffs/#fix-diffs

@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, 136 insertions(+), 17 deletions(-))
google-beta provider: Diff ( 4 files changed, 136 insertions(+), 17 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 32 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 33
Passed tests: 31
Skipped tests: 2
Affected tests: 0

Click here to see the affected service packages
  • developerconnect

🟢 All tests passed!

View the build log

@ishamiGIT
Copy link
Contributor Author

Added DiffSupress function (diff_suppress_func: 'tpgresource.ProjectNumberDiffSuppress') to handle the VCR error.

@github-actions github-actions bot requested a review from shuyama1 February 4, 2026 21:16
@ishamiGIT ishamiGIT force-pushed the feat/dci-tf-coverage-projectids branch from e83ea88 to 503b123 Compare February 5, 2026 18:27
@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 ( 5 files changed, 149 insertions(+), 19 deletions(-))
google-beta provider: Diff ( 5 files changed, 149 insertions(+), 19 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 32 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 33
Passed tests: 31
Skipped tests: 2
Affected tests: 0

Click here to see the affected service packages
  • developerconnect

🟢 All tests passed!

View the build log

@shuyama1
Copy link
Member

shuyama1 commented Feb 5, 2026

Running tests on TC and I'll update the test result here when it completes

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

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

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

Test results form TC

TestAccDeveloperConnectInsightsConfig_update:

resource_developer_connect_insights_config_test.go:55: Step 3/4 error: Pre-apply plan check(s) failed:
        'google_developer_connect_insights_config.insights_config' - expected DestroyBeforeCreate, got action(s): [delete]
--- FAIL: TestAccDeveloperConnectInsightsConfig_update (260.05s)

TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigBasicExample:

resource_developer_connect_insights_config_generated_test.go:63: Resource specified by ResourceName couldn't be found: google_developer_connect_insights_config.insights_config
--- FAIL: TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigBasicExample (262.17s)

depends_on = [time_sleep.wait_for_propagation]
}

resource "google_developer_connect_insights_config" "insights_config_projects" {
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, somehow missed this in the previous reviews. We'd want to target one primary resource per test. Therefore, could you move this to a new test?

Comment on lines 318 to 320
resource "google_developer_connect_insights_config" "insights_config_apphub" {
location = "us-central1"
insights_config_id = "tf-test-ic%{random_suffix}"
insights_config_id = "tf-test-ic-apphub-%{random_suffix}"
Copy link
Member

Choose a reason for hiding this comment

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

This is changing the identifier of the resource in the update step which will cause the resource to recreate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -337,5 +337,16 @@ func testAccDeveloperConnectInsightsConfig_update(context map[string]interface{}
}
depends_on = [time_sleep.wait_for_propagation]
}
resource "google_developer_connect_insights_config" "insights_config_projects" {
Copy link
Member

Choose a reason for hiding this comment

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

Same here, we may want to move this to a new test instead of creating two google_developer_connect_insights_config resources in one test. Or if the resource can update in-place from using app_hub_application to projects, you could add a new test step to update it to use projects.

https://googlecloudplatform.github.io/magic-modules/test/test/#add-resource-tests covers more details on adding tests if it helps.

Let me know if you have any questions, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right. I've added a separate test for an insights_config resource created with an AppHub application and another for an insights_config resource created with projectIds.

@github-actions github-actions bot requested a review from shuyama1 February 9, 2026 17:43
@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 ( 6 files changed, 736 insertions(+), 16 deletions(-))
google-beta provider: Diff ( 6 files changed, 736 insertions(+), 16 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 32 insertions(+))

@modular-magician
Copy link
Collaborator

Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigProjectsExample

Tests analytics

Total tests: 35
Passed tests: 31
Skipped tests: 3
Affected tests: 1

Click here to see the affected service packages
  • developerconnect

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Several tests terminated during RECORDING mode.

View the build log or the debug log for each test

@github-actions github-actions bot requested a review from shuyama1 February 10, 2026 22:30
@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 ( 5 files changed, 393 insertions(+), 16 deletions(-))
google-beta provider: Diff ( 5 files changed, 393 insertions(+), 16 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 32 insertions(+))

@modular-magician
Copy link
Collaborator

Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigProjectsExample

Tests analytics

Total tests: 34
Passed tests: 31
Skipped tests: 3
Affected tests: 0

Click here to see the affected service packages
  • developerconnect

🟢 All tests passed!

View the build log

Copy link
Member

@shuyama1 shuyama1 left a comment

Choose a reason for hiding this comment

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

I double-checked with the team regarding the naming of this field: Let's rename this to target_projects. This helps distinguish it from the standard project field and aligns with how it's handled in gcloud.

I've added the suggested changes inline, which you can apply directly. I've also verified this in #16353 and tests passed. This should be good to go after applying the changes. Thanks!

ishamiGIT and others added 3 commits February 11, 2026 16:17
Co-authored-by: Shuya Ma <87669292+shuyama1@users.noreply.github.com>
Co-authored-by: Shuya Ma <87669292+shuyama1@users.noreply.github.com>
…onfig_projects.tf.tmpl

Co-authored-by: Shuya Ma <87669292+shuyama1@users.noreply.github.com>
@github-actions github-actions bot requested a review from shuyama1 February 11, 2026 21:18
@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 ( 5 files changed, 394 insertions(+), 16 deletions(-))
google-beta provider: Diff ( 5 files changed, 394 insertions(+), 16 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 32 insertions(+))

@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 ( 5 files changed, 394 insertions(+), 16 deletions(-))
google-beta provider: Diff ( 5 files changed, 394 insertions(+), 16 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 32 insertions(+))

@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 ( 5 files changed, 394 insertions(+), 16 deletions(-))
google-beta provider: Diff ( 5 files changed, 394 insertions(+), 16 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 32 insertions(+))

@modular-magician
Copy link
Collaborator

Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigProjectsExample

Tests analytics

Total tests: 34
Passed tests: 31
Skipped tests: 3
Affected tests: 0

Click here to see the affected service packages
  • developerconnect

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Collaborator

Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigProjectsExample

Tests analytics

Total tests: 34
Passed tests: 31
Skipped tests: 3
Affected tests: 0

Click here to see the affected service packages
  • developerconnect

🟢 All tests passed!

View the build log

@modular-magician
Copy link
Collaborator

Non-exercised tests

🔴 Tests were added that are skipped in VCR:

  • TestAccDeveloperConnectInsightsConfig_developerConnectInsightsConfigProjectsExample

Tests analytics

Total tests: 34
Passed tests: 31
Skipped tests: 3
Affected tests: 0

Click here to see the affected service packages
  • developerconnect

🟢 All tests passed!

View the build log

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