Skip to content

feat(datapipeline): add desired_state virtual field for pipeline state management#18214

Draft
vr-ibm wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:datapipeline-desired-state
Draft

feat(datapipeline): add desired_state virtual field for pipeline state management#18214
vr-ibm wants to merge 3 commits into
GoogleCloudPlatform:mainfrom
vr-ibm:datapipeline-desired-state

Conversation

@vr-ibm

@vr-ibm vr-ibm commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Fixes hashicorp/terraform-provider-google#23879

Adds a desired_state virtual field to google_data_pipeline_pipeline that allows users to control the pipeline state (pause/resume) via Terraform. Previously, the state field was marked as required and immutable, which prevented users from managing pipeline lifecycle after creation.

Details

  • Changed state to output-only (it reflects the current API state)
  • Added desired_state virtual field accepting STATE_ACTIVE or STATE_PAUSED
  • Added post_create hook to set state if desired_state differs from default
  • Added post_update hook to call stop/run API when desired_state changes
  • Added CustomizeDiff validation to restrict desired_state values
  • Uses the Data Pipelines stop and run API endpoints
datapipeline: added `desired_state` virtual field to `google_data_pipeline_pipeline` for pipeline state management

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests service/dataflow and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jul 7, 2026
@modular-magician

modular-magician commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 5d14367:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 3 files changed, 106 insertions(+), 24 deletions(-)
google-beta provider View Diff 3 files changed, 106 insertions(+), 24 deletions(-)
terraform-google-conversion View Diff 1 file changed, 58 insertions(+), 10 deletions(-)

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field state became Computed only on google_data_pipeline_pipeline - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

Missing test report

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

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

resource "google_data_pipeline_pipeline" "primary" {
  desired_state = # value needed
}

Test report

Analytics

Total Tests Passed Skipped Affected
3 0 0 3
Affected Service Packages
  • datapipeline

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccDataPipelinePipeline_basicFlexTemplate
  • TestAccDataPipelinePipeline_basicLaunchTemplate
  • TestAccDataPipelinePipeline_dataPipelinePipelineExample

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
❌ Error · Log - TestAccDataPipelinePipeline_basicFlexTemplate
❌ Error · Log - TestAccDataPipelinePipeline_basicLaunchTemplate
❌ Error · Log - TestAccDataPipelinePipeline_dataPipelinePipelineExample

Caution

Issues requiring attention before PR completion

🔴 Initial Recording Failed: Some tests failed during the recording step. See the table above for details.

Please address these issues to complete your PR. If you believe these detections are incorrect or unrelated to your change, please raise the concern with your reviewer.

View the recording VCR build log or the debug logs folder for detailed results.

@vr-ibm VCR tests complete for 5d14367!

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jul 7, 2026
@modular-magician

modular-magician commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit f9c80f1:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 5 files changed, 112 insertions(+), 30 deletions(-)
google-beta provider View Diff 5 files changed, 112 insertions(+), 30 deletions(-)
terraform-google-conversion View Diff 1 file changed, 58 insertions(+), 10 deletions(-)
Open in Cloud Shell View Diff 1 file changed, 1 insertion(+), 1 deletion(-)

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field state became Computed only on google_data_pipeline_pipeline - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

Test report

Analytics

Total Tests Passed Skipped Affected
3 0 0 3
Affected Service Packages
  • datapipeline

Learn how VCR tests work


Step 1: Replaying Mode

Action taken

Found 3 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit.

Click here to see the affected tests
  • TestAccDataPipelinePipeline_basicFlexTemplate
  • TestAccDataPipelinePipeline_basicLaunchTemplate
  • TestAccDataPipelinePipeline_dataPipelinePipelineExample

View the replaying VCR build log


Step 2: Recording Mode

Recording Mode Replaying Rerun Test Name
✅ Log TestAccDataPipelinePipeline_basicFlexTemplate
✅ Log TestAccDataPipelinePipeline_basicLaunchTemplate
✅ Log TestAccDataPipelinePipeline_dataPipelinePipelineExample

🟢 All tests passed!

View the recording VCR build log or the debug logs folder for detailed results.

@vr-ibm VCR tests complete for f9c80f1!

@modular-magician modular-magician added awaiting-approval Pull requests that need reviewer's approval to run presubmit tests and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Jul 8, 2026
@modular-magician

modular-magician commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes for commit 905d8e0:

Diff report

Your PR generated the following diffs in downstream repositories:

Repository Diff Link Changes
google provider View Diff 5 files changed, 112 insertions(+), 30 deletions(-)
google-beta provider View Diff 5 files changed, 112 insertions(+), 30 deletions(-)
terraform-google-conversion View Diff 1 file changed, 58 insertions(+), 10 deletions(-)
Open in Cloud Shell View Diff 1 file changed, 1 insertion(+), 1 deletion(-)

Breaking Change(s) Detected

The following breaking change(s) were detected within your pull request.

  • Field state became Computed only on google_data_pipeline_pipeline - reference

If you believe this detection to be incorrect please raise the concern with your reviewer.
If you intend to make this change you will need to wait for a major release window.
An override-breaking-change label can be added to allow merging.

Test report

Analytics

Total Tests Passed Skipped Affected
3 3 0 0
Affected Service Packages
  • datapipeline

Learn how VCR tests work


Step 1: Replaying Mode

🟢 All tests passed in Replaying mode! No Recording was needed.

View the replaying VCR build log

@vr-ibm VCR tests complete for 905d8e0!

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.

google_data_pipeline_pipeline: state defaults to STATE_ACTIVE despite other enums set in config

2 participants