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

compute: Validate stopping for update in plan stage

Open Asiderr opened this issue 1 year ago • 9 comments

This patch moves the allowUpdate check from the apply stage to the plan stage. Covers all configuration changes that require an instance to be stopped. It also adds new helper functions for checking network configuration changes and service account changes.

This patch is covered by existing acceptance tests: TestAccComputeInstance_updateRunning_desiredStatusRunning_notAllowStoppingForUpdate TestAccComputeInstance_updateRunning_desiredStatusNotSet_notAllowStoppingForUpdate

  • Add new customdiff validateStoppingForUpdate
  • Add new helper functions
    • hasServiceAccountChanged
    • hasNetworkInterfaceChanged
  • Delete allowUpdate check from apply stage
  • Refactor scopeChange check using the new helper function in apply stage

Closes: https://github.com/hashicorp/terraform-provider-google/issues/4076

Release Note Template for Downstream PRs (will be copied)

compute: validate stopping for update in plan stage

Asiderr avatar Oct 14 '24 16:10 Asiderr

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

@ScottSuarez, 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 14 '24 16:10 github-actions[bot]

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

modular-magician avatar Oct 16 '24 20:10 modular-magician

Tests analytics

Total tests: 1036 Passed tests: 951 Skipped tests: 73 Affected tests: 12

Click here to see the affected service packages
  • compute

Action taken

Found 12 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeAttachedDisk_diskInterface
  • TestAccComputeInstanceConfidentialInstanceConfigMain
  • TestAccComputeInstance_confidentialHyperDiskBootDisk
  • TestAccComputeInstance_machineTypeUrl
  • TestAccComputeInstance_maxRunDuration_update
  • TestAccComputeInstance_networkIpUpdate
  • TestAccComputeInstance_noServiceAccount
  • TestAccComputeInstance_serviceAccount
  • TestAccComputeInstance_spotVM_maxRunDuration_update
  • TestAccComputeInstance_updateRunning_desiredStatusNotSet_notAllowStoppingForUpdate
  • TestAccComputeInstance_updateRunning_desiredStatusRunning_notAllowStoppingForUpdate
  • TestAccDataSourceComputeInstanceSerialPort_basic

Get to know how VCR tests work

modular-magician avatar Oct 16 '24 20:10 modular-magician

🟢 Tests passed during RECORDING mode: TestAccComputeInstance_updateRunning_desiredStatusNotSet_notAllowStoppingForUpdate[Debug log] TestAccComputeInstance_updateRunning_desiredStatusRunning_notAllowStoppingForUpdate[Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode: TestAccComputeAttachedDisk_diskInterface[Error message] [Debug log] TestAccComputeInstanceConfidentialInstanceConfigMain[Error message] [Debug log] TestAccComputeInstance_confidentialHyperDiskBootDisk[Error message] [Debug log] TestAccComputeInstance_machineTypeUrl[Error message] [Debug log] TestAccComputeInstance_maxRunDuration_update[Error message] [Debug log] TestAccComputeInstance_networkIpUpdate[Error message] [Debug log] TestAccComputeInstance_noServiceAccount[Error message] [Debug log] TestAccComputeInstance_serviceAccount[Error message] [Debug log] TestAccComputeInstance_spotVM_maxRunDuration_update[Error message] [Debug log] TestAccDataSourceComputeInstanceSerialPort_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

modular-magician avatar Oct 16 '24 20:10 modular-magician

@ScottSuarez 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 17 '24 09:10 github-actions[bot]

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

modular-magician avatar Oct 17 '24 18:10 modular-magician

Tests analytics

Total tests: 1036 Passed tests: 959 Skipped tests: 73 Affected tests: 4

Click here to see the affected service packages
  • compute

Action taken

Found 4 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeInstance_machineTypeUrl
  • TestAccComputeInstance_maxRunDuration_update
  • TestAccComputeInstance_noServiceAccount
  • TestAccComputeInstance_serviceAccount

Get to know how VCR tests work

modular-magician avatar Oct 17 '24 19:10 modular-magician

🔴 Tests failed during RECORDING mode: TestAccComputeInstance_machineTypeUrl[Error message] [Debug log] TestAccComputeInstance_maxRunDuration_update[Error message] [Debug log] TestAccComputeInstance_noServiceAccount[Error message] [Debug log] TestAccComputeInstance_serviceAccount[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

modular-magician avatar Oct 17 '24 19:10 modular-magician

@GoogleCloudPlatform/terraform-team @ScottSuarez 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 21 '24 09:10 github-actions[bot]

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

modular-magician avatar Oct 25 '24 17:10 modular-magician

Tests analytics

Total tests: 1040 Passed tests: 958 Skipped tests: 73 Affected tests: 9

Click here to see the affected service packages
  • compute

Action taken

Found 9 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeInstanceConfidentialInstanceConfigMain
  • TestAccComputeInstanceFromMachineImage_confidentialInstanceConfigMain
  • TestAccComputeInstance_confidentialHyperDiskBootDisk
  • TestAccComputeInstance_maxRunDuration_update
  • TestAccComputeInstance_networkIpUpdate
  • TestAccComputeInstance_spotVM_maxRunDuration_update
  • TestAccComputeInstance_updateRunning_desiredStatusNotSet_notAllowStoppingForUpdate
  • TestAccComputeInstance_updateRunning_desiredStatusRunning_notAllowStoppingForUpdate
  • TestAccDataSourceComputeInstanceSerialPort_basic

Get to know how VCR tests work

modular-magician avatar Oct 25 '24 17:10 modular-magician

🟢 Tests passed during RECORDING mode: TestAccComputeInstance_maxRunDuration_update [Debug log] TestAccComputeInstance_updateRunning_desiredStatusNotSet_notAllowStoppingForUpdate [Debug log] TestAccComputeInstance_updateRunning_desiredStatusRunning_notAllowStoppingForUpdate [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🔴 Tests failed during RECORDING mode: TestAccComputeInstanceConfidentialInstanceConfigMain [Error message] [Debug log] TestAccComputeInstanceFromMachineImage_confidentialInstanceConfigMain [Error message] [Debug log] TestAccComputeInstance_confidentialHyperDiskBootDisk [Error message] [Debug log] TestAccComputeInstance_networkIpUpdate [Error message] [Debug log] TestAccComputeInstance_spotVM_maxRunDuration_update [Error message] [Debug log] TestAccDataSourceComputeInstanceSerialPort_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

modular-magician avatar Oct 25 '24 17:10 modular-magician

@ScottSuarez 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 07 '24 09:11 github-actions[bot]

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

modular-magician avatar Nov 08 '24 18:11 modular-magician

Tests analytics

Total tests: 648 Passed tests: 586 Skipped tests: 61 Affected tests: 1

Click here to see the affected service packages
  • compute

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

Get to know how VCR tests work

modular-magician avatar Nov 08 '24 18:11 modular-magician

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

modular-magician avatar Nov 08 '24 18:11 modular-magician

@GoogleCloudPlatform/terraform-team @ScottSuarez 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 Nov 11 '24 09:11 github-actions[bot]

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

modular-magician avatar Nov 15 '24 20:11 modular-magician

Tests analytics

Total tests: 426 Passed tests: 365 Skipped tests: 61 Affected tests: 0

Click here to see the affected service packages
  • compute

🔴 Errors occurred during REPLAYING mode. Please fix them to complete your PR.

View the build log

modular-magician avatar Nov 15 '24 21:11 modular-magician

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

github-actions[bot] avatar Nov 18 '24 09:11 github-actions[bot]

/gcbrun

ScottSuarez avatar Nov 18 '24 20:11 ScottSuarez

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

modular-magician avatar Nov 18 '24 20:11 modular-magician

Tests analytics

Total tests: 710 Passed tests: 639 Skipped tests: 70 Affected tests: 1

Click here to see the affected service packages
  • compute

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

Get to know how VCR tests work

modular-magician avatar Nov 18 '24 21:11 modular-magician

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

modular-magician avatar Nov 18 '24 21:11 modular-magician

@Asiderr, 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 Dec 02 '24 09:12 github-actions[bot]

@Asiderr, 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[bot] avatar Dec 16 '24 09:12 github-actions[bot]

@Asiderr, 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[bot] avatar Dec 26 '24 09:12 github-actions[bot]

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

github-actions[bot] avatar Dec 30 '24 09:12 github-actions[bot]