Skip to content

gkebackup backupplan: Add State and StateReason fields#8227

Merged
shuyama1 merged 3 commits into
GoogleCloudPlatform:mainfrom
neha-vellanki12:main
Jul 17, 2023
Merged

gkebackup backupplan: Add State and StateReason fields#8227
shuyama1 merged 3 commits into
GoogleCloudPlatform:mainfrom
neha-vellanki12:main

Conversation

@neha-vellanki12

@neha-vellanki12 neha-vellanki12 commented Jun 28, 2023

Copy link
Copy Markdown
Contributor

new read only state and state_reason fields were added to gkebackup backupplan resource in api. we are adding these read only fields to terraform

If this PR is for Terraform, I acknowledge that I have:

  • [ X] Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • [X ] Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • [X ] Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • [ X] Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read Write release notes before writing my release note below.

Release Note Template for Downstream PRs (will be copied)

gkebackup: added `state` and `state_reason` output-only fields to `google_gkebackup_backupplan` resource

@modular-magician

Copy link
Copy Markdown
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I've detected that you're a community contributor. @shuyama1, a repository maintainer, has been assigned to assist you and help review your changes.

❓ First time contributing? Click here for more details

Your assigned reviewer will help review your code by:

  • Ensuring it's backwards compatible, covers common error cases, etc.
  • Summarizing the change into a user-facing changelog note.
  • Passes tests, either our "VCR" suite, a set of presubmit tests, or with manual test runs.

You can help make sure that review is quick by running local tests and ensuring they're passing in between each push you make to your PR's branch. Also, try to leave a comment with each push you make, as pushes generally don't generate emails.

If your reviewer doesn't get back to you within a week after your most recent change, please feel free to leave a comment on the issue asking them to take a look! In the absence of a dedicated review dashboard most maintainers manage their pending reviews through email, and those will sometimes get lost in their inbox.


@modular-magician

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

Terraform GA: Diff ( 2 files changed, 30 insertions(+))
Terraform Beta: Diff ( 2 files changed, 30 insertions(+))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2832
Passed tests 2536
Skipped tests: 294
Affected tests: 2

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
TestAccComputeNetworkEndpoints_networkEndpointsBasic|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests passed during RECORDING mode:
TestAccComputeNetworkEndpoints_networkEndpointsBasic[Debug log]

Tests failed during RECORDING mode:
TestAccComputeFirewallPolicyRule_multipleRules[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

@shuyama1 shuyama1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly looks good. left a question inline and pre-validation failed due to

 Error: 272:70 [trailing-spaces] trailing spaces

description: |
The number of Kubernetes Pods backed up in the last successful Backup created via this BackupPlan.
- !ruby/object:Api::Type::String
name: state

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we think these fields will be useful to Terraform users? Would you mind sharing the API documentation of these fields or what are the possible values for state? as I imagine we would always get state: READY for successful resource creation/update, otherwise we would end up with errors and might not write these fields to terraform state.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Public facing documentation isn't complete for api change. This is the description of the fields

STATE_UNSPECIFIED: Default first value for Enums.
CLUSTER_PENDING: Waiting for cluster state to be RUNNING.
PROVISIONING: The BackupPlan is in the process of being created.
READY: BackupPlan is ready to schedule backups
FAILED: BackupPlan creation has failed.
DEACTIVATED: The BackupPlan has been deactivated.
DELETING: The BackupPlan is in the process of being deleted.

Note that CLUSTER_PENDING state can potentially take a significant amount of time (30-40 min) depending on how the agent is being installed. State Reason during FAILED state can be helpful for customers to understand where the failure occurred (especially since the operation can take 30-40 min), and how to fix it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@shuyama1 let me know if you think this isn't a useful field for terraform users

@modular-magician

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

Terraform GA: Diff ( 2 files changed, 30 insertions(+))
Terraform Beta: Diff ( 2 files changed, 30 insertions(+))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2834
Passed tests 2538
Skipped tests: 295
Affected tests: 1

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
TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests failed during RECORDING mode:
TestAccComputeFirewallPolicyRule_multipleRules[Error message] [Debug log]

Please fix these to complete your PR
View the build log or the debug log for each test

Comment thread mmv1/products/gkebackup/BackupPlan.yaml Outdated
The number of Kubernetes Pods backed up in the last successful Backup created via this BackupPlan.
- !ruby/object:Api::Type::String
name: state
output: True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
output: True
output: true

only nitpick - for consistency.

Comment thread mmv1/products/gkebackup/BackupPlan.yaml Outdated
The State of the BackupPlan.
- !ruby/object:Api::Type::String
name: stateReason
output: True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
output: True
output: true

@modular-magician

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

Terraform GA: Diff ( 2 files changed, 30 insertions(+))
Terraform Beta: Diff ( 2 files changed, 30 insertions(+))
TF Conversion: Diff ( 2 files changed, 3 insertions(+), 3 deletions(-))

@modular-magician

Copy link
Copy Markdown
Collaborator

Tests analytics

Total tests: 2852
Passed tests 2554
Skipped tests: 296
Affected tests: 2

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
TestAccContainerAwsNodePool_BetaBasicHandWritten|TestAccComputeFirewallPolicyRule_multipleRules

Get to know how VCR tests work

@modular-magician

Copy link
Copy Markdown
Collaborator

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

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@shuyama1 shuyama1 changed the title gkebackup backupplan: Add read-only State and StateReason fields gkebackup backupplan: Add State and StateReason fields Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants