Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add availability_domain field to GCE instance scheduling #11618

Closed
wants to merge 1 commit into from

Conversation

kubalaguna
Copy link
Contributor

@kubalaguna kubalaguna commented Sep 3, 2024

Release Note Template for Downstream PRs (will be copied)

compute: added `availability_domain` field to `google_compute_instance` resource

Copy link

google-cla bot commented Sep 3, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

github-actions bot commented Sep 3, 2024

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

@rileykarson, 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 github-actions bot requested a review from rileykarson September 3, 2024 09:42
@modular-magician modular-magician added the awaiting-approval Pull requests that need reviewer's approval to run presubmit tests label Sep 3, 2024
rileykarson
rileykarson previously approved these changes Sep 3, 2024
Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

LGTM assuming tests pass! (will merge after results if so)

@modular-magician modular-magician added service/compute-instances and removed awaiting-approval Pull requests that need reviewer's approval to run presubmit tests labels Sep 3, 2024
@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, 101 insertions(+))
google-beta provider: Diff ( 7 files changed, 143 insertions(+))
terraform-google-conversion: Diff ( 2 files changed, 10 insertions(+), 1 deletion(-))

Missing test report

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

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

resource "google_compute_instance" "primary" {
  scheduling {
    availability_domain  = # value needed
    maintenance_interval = # value needed
  }
}

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

resource "google_compute_instance_from_machine_image" "primary" {
  scheduling {
    availability_domain  = # value needed
    maintenance_interval = # value needed
    min_node_cpus        = # value needed
    preemptible          = # value needed
  }
}

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

resource "google_compute_instance_from_template" "primary" {
  scheduling {
    availability_domain  = # value needed
    maintenance_interval = # value needed
    min_node_cpus        = # value needed
    on_host_maintenance  = # value needed
    preemptible          = # value needed
  }
}

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

resource "google_compute_region_instance_template" "primary" {
  scheduling {
    availability_domain = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 834
Passed tests: 755
Skipped tests: 77
Affected tests: 2

Click here to see the affected service packages
  • compute

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
  • TestAccComputeInstanceTemplate_instanceWithAvailabilityDomain
  • TestAccComputeInstanceTemplate_withNamePrefix

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeInstanceTemplate_withNamePrefix[Debug log]
$\textcolor{red}{\textsf{Tests failed when rerunning REPLAYING mode:}}$
TestAccComputeInstanceTemplate_withNamePrefix[Error message] [Debug log]

Tests failed due to non-determinism or randomness when the VCR replayed the response after the HTTP request was made.

Please fix these to complete your PR. If you believe these test failures to be incorrect or unrelated to your change, or if you have any questions, please raise the concern with your reviewer.


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeInstanceTemplate_instanceWithAvailabilityDomain[Error message] [Debug log]

$\textcolor{red}{\textsf{Errors occurred during RECORDING mode. Please fix them to complete your PR.}}$

View the build log or the debug log for each test

@github-actions github-actions bot requested a review from rileykarson September 5, 2024 17:38
@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 Sep 5, 2024
@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, 17 insertions(+))
google-beta provider: Diff ( 4 files changed, 59 insertions(+))
terraform-google-conversion: Diff ( 2 files changed, 10 insertions(+), 1 deletion(-))

Missing test report

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

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

resource "google_compute_instance" "primary" {
  scheduling {
    availability_domain  = # value needed
    maintenance_interval = # value needed
  }
}

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

resource "google_compute_instance_from_machine_image" "primary" {
  scheduling {
    availability_domain  = # value needed
    maintenance_interval = # value needed
    min_node_cpus        = # value needed
    preemptible          = # value needed
  }
}

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

resource "google_compute_instance_from_template" "primary" {
  scheduling {
    availability_domain  = # value needed
    maintenance_interval = # value needed
    min_node_cpus        = # value needed
    on_host_maintenance  = # value needed
    preemptible          = # value needed
  }
}

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 23
Passed tests: 5
Skipped tests: 18
Affected tests: 0

Click here to see the affected service packages
  • compute

$\textcolor{red}{\textsf{Errors occurred during REPLAYING mode. Please fix them to complete your PR.}}$

View the build log

@@ -272,6 +275,7 @@ func flattenScheduling(resp *compute.Scheduling) []map[string]interface{} {
"min_node_cpus": resp.MinNodeCpus,
"provisioning_model": resp.ProvisioningModel,
"instance_termination_action": resp.InstanceTerminationAction,
"availability_domain": resp.AvailabilityDomain,
Copy link
Member

Choose a reason for hiding this comment

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

We're writing availability_domain to instance template due to the shared code, but the value isn't available. I assume the unset value is nil so we can't just use a conditional write, an approach used in some other places. We may want to add the field to schema in instance template and add a note it doesn't currently work (but that could lead to weird behaviour if it's added in the future).

Otherwise we may need to pass a flag through from the initial callsite about whether we're working on a template or actual instance, and use that to control what we write.

(I would personally like to remove the shared code eventually to avoid these kind of decisions, not that maintaining separate copies will be very fun 🙁 )

Copy link

@kubalaguna, this PR is waiting for action from you. 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

If no action is taken, this PR will be closed in 28 days.

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

@c2thorn
Copy link
Member

c2thorn commented Sep 24, 2024

Hi @kubalaguna

Tomorrow, the Magic Modules repository is scheduled to undergo a language migration from Ruby to Go. You can view more details about this in our announcement here: hashicorp/terraform-provider-google#19583 (or go/mm-migration-announcement if you are a Googler)

This open pull request may become incompatible due to most YAML and .erb files converting to Go-compatible files.

Our team (Magic Modules repository maintainers) has tooling to automatically convert changes to the new language, and we can prepare a new commit for this pull request that is compatible with the migration.

In order to push the new changes to your pull request, we would need to force push the commit to your fork's branch. Our tooling saves a backup branch before converting, so we could rollback or open a new pull request if needed. We would also work with you and the PR reviewer in the event additional changes are needed.

You also have the option to update the pull request yourself after the migration. You can view a preview branch and updated documentation related to the migration changes.

We will take no action until we have your explicit permission to push changes to your fork's branch used for this pull request. Let me or your reviewer know if you have any further questions!

Copy link

github-actions bot commented Oct 4, 2024

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

@c2thorn
Copy link
Member

c2thorn commented Oct 14, 2024

It has been several weeks and this PR is likely too far out of date to convert with our tooling. Please disregard my previous comment and recreate this PR in the new format.

@c2thorn c2thorn closed this Oct 14, 2024
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.

4 participants