Skip to content

Fix : google_bigquery_data_transfer_config should support EventDrivenSchedule #15094

Closed
hassannmoussaa wants to merge 9 commits intoGoogleCloudPlatform:mainfrom
hassannmoussaa:fix-24274
Closed

Fix : google_bigquery_data_transfer_config should support EventDrivenSchedule #15094
hassannmoussaa wants to merge 9 commits intoGoogleCloudPlatform:mainfrom
hassannmoussaa:fix-24274

Conversation

@hassannmoussaa
Copy link
Contributor

@hassannmoussaa hassannmoussaa commented Sep 9, 2025

Description
google_bigquery_data_transfer_config should support EventDrivenSchedule

bigquerydatatransfer:  added `event_driven_schedule` field to `google_bigquery_data_transfer_config ` resource

New Configuration :

schedule_options = {
  event_driven_schedule = google_pubsub_subscription.my_subscription.id
}

References
PR to solve issue: hashicorp/terraform-provider-google#24274

@github-actions github-actions bot requested a review from trodge September 9, 2025 12:19
@github-actions
Copy link

github-actions bot commented Sep 9, 2025

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.

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

@hassannmoussaa
Copy link
Contributor Author

I need to work on coverage test before you review please @trodge

@hassannmoussaa
Copy link
Contributor Author

@trodge for your review

@github-actions
Copy link

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

@hassannmoussaa
Copy link
Contributor Author

@trodge are we ready here ?

@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, 81 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 3 files changed, 81 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 30 insertions(+))

Missing test report

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

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

resource "google_bigquery_data_transfer_config" "primary" {
  schedule_options {
    event_driven_schedule {
      pubsub_subscription = # value needed
    }
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • bigquerydatatransfer

🟢 All tests passed!

View the build log

Copy link
Contributor

@trodge trodge left a comment

Choose a reason for hiding this comment

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

We'll need a test that includes the new field.

@hassannmoussaa
Copy link
Contributor Author

@trodge Acceptance test added

@github-actions github-actions bot requested a review from trodge September 16, 2025 13:02
@github-actions github-actions bot requested a review from trodge September 18, 2025 15:01
@github-actions
Copy link

@trodge 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
Copy link

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

@trodge
Copy link
Contributor

trodge commented Sep 29, 2025

Apologies for delated review while I was OOO, running the tests again now.

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

Missing test report

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

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

resource "google_bigquery_data_transfer_config" "primary" {
  schedule_options {
    event_driven_schedule {
      pubsub_subscription = # value needed
    }
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • bigquerydatatransfer

🟢 All tests passed!

View the build log

Copy link
Contributor

@trodge trodge left a comment

Choose a reason for hiding this comment

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

What is the reason for excluding tests for this resource?

Also, I think the example syntax may be incorrect. See above comment for how it should be formatted for consistency with other examples and the resource structure.

@hassannmoussaa
Copy link
Contributor Author

Sure ill be solving this asap

@github-actions github-actions bot requested a review from trodge September 30, 2025 22:34
@hassannmoussaa
Copy link
Contributor Author

@trodge making exclude_test:false is making conflicts and if you see ohter examples have the same config exclude_test:true

Original Code

examples:
  - name: 'bigquerydatatransfer_config_scheduled_query'
    primary_resource_id: 'query_config'
    vars:
      display_name: 'my-query'
      dataset_id: 'my_dataset'
    exclude_test: true
  - name: 'bigquerydatatransfer_config_cmek'
    primary_resource_id: 'query_config_cmek'
    vars:
      dataset_id: 'example_dataset'
      key_name: 'example-key'
      keyring_name: 'example-keyring'
      display_name: 'display-name'
    exclude_test: true
  - name: 'bigquerydatatransfer_config_salesforce'
    primary_resource_id: 'salesforce_config'
    vars:
      display_name: 'my-salesforce-config'
      dataset_id: 'my_dataset'
    exclude_test: true
  - name: bigquerydatatransfer_config_pub_sub
    primary_resource_id: 'event_driven_config'
    vars:
      display_name: 'my-event-driven-query'
      dataset_id: 'my_dataset'
      topic_name: 'my_dataset_topic'
      subscription_name: 'my_dataset_topic_subscription'
    exclude_test: true

What do you think

@github-actions github-actions bot requested a review from trodge October 2, 2025 11:01
@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, 195 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 4 files changed, 195 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 33 insertions(+))

Missing test report

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

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

resource "google_bigquery_data_transfer_config" "primary" {
  schedule_options {
    event_driven_schedule {
      pubsub_subscription = # value needed
    }
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • bigquerydatatransfer

🟢 All tests passed!

View the build log

@github-actions github-actions bot requested a review from trodge October 4, 2025 19:13
@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, 199 insertions(+), 3 deletions(-))
google-beta provider: Diff ( 4 files changed, 199 insertions(+), 3 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 33 insertions(+))

@modular-magician
Copy link
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • bigquerydatatransfer

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccBigqueryDataTransferConfig_pub_sub_basic [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

@trodge
Copy link
Contributor

trodge commented Oct 6, 2025

New failure:

  error=
  | exit status 1
  | 
  | Error: Reference to undeclared resource
  | 
  |   on terraform_plugin_test.tf line 24, in resource "google_bigquery_dataset" "my_dataset":
  |   24:   depends_on = [google_project_iam_member.permissions]
  | 
  | A managed resource "google_project_iam_member" "permissions" has not been
  | declared in the root module.
  | 
  | Error: "dataset_id" must contain only letters (a-z, A-Z), numbers (0-9), or underscores (_)
  | 
  |   with google_bigquery_dataset.my_dataset,
  |   on terraform_plugin_test.tf line 26, in resource "google_bigquery_dataset" "my_dataset":
  |   26:   dataset_id    = "my_dataset-oprmm462r2"

I reccomend not attempting to set permissions using resources in the test config, as this can interfere with concurrent runs. Instead, add the necessary permissions to .ci/infra/terraform/main.tf

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

@trodge 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
Contributor

@trodge trodge left a comment

Choose a reason for hiding this comment

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

See above comment re: no IAM resources in test configs

@hassannmoussaa
Copy link
Contributor Author

Fixed in last commit

@github-actions github-actions bot requested a review from trodge October 10, 2025 21:04
@trodge
Copy link
Contributor

trodge commented Oct 10, 2025

Approved the build just now, it should finish running in an hour or so.

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

@modular-magician
Copy link
Collaborator

Tests analytics

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

Click here to see the affected service packages
  • bigquerydatatransfer

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

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🔴 Tests failed during RECORDING mode:
TestAccBigqueryDataTransferConfig_pub_sub_basic [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

data "google_project" "project" {
}

resource "google_project_iam_member" "permissions" {
Copy link
Contributor

Choose a reason for hiding this comment

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

See previous comment about not using IAM resources directly in test configs.

resource "google_bigquery_dataset" "my_dataset" {
depends_on = [google_project_iam_member.permissions]

dataset_id = "my_dataset-%s"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
dataset_id = "my_dataset-%s"
dataset_id = "my_dataset_%s"

- is not allowed in this resource's id.

@hassannmoussaa
Copy link
Contributor Author

Will be solving this today

@github-actions github-actions bot requested a review from trodge October 16, 2025 11:44
@github-actions
Copy link

@trodge 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
Contributor

@trodge trodge left a comment

Choose a reason for hiding this comment

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

See above (requesting changes again to stop bot reminders)

@github-actions
Copy link

github-actions bot commented Nov 4, 2025

@hassannmoussaa, 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
Copy link

@hassannmoussaa, this PR is waiting for action from you. If no action is taken, this PR will be closed in 14 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
Copy link

@hassannmoussaa, this PR is waiting for action from you. If no action is taken, this PR will be closed in 2 weekdays.

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
Copy link

github-actions bot commented Dec 2, 2025

@hassannmoussaa, this PR is being closed due to inactivity.

@github-actions github-actions bot closed this Dec 2, 2025
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