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 deletion_protection field to workflow resource #12116

Merged

Conversation

BENY4M1N
Copy link
Member

@BENY4M1N BENY4M1N commented Oct 24, 2024

workflows: added `deletion_protection` field to `google_workflows_workflow` resource

@github-actions github-actions bot requested a review from SirGitsalot October 24, 2024 14:41
Copy link

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

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

@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, 28 insertions(+))
google-beta provider: Diff ( 4 files changed, 28 insertions(+))
Open in Cloud Shell: Diff ( 1 file changed, 1 insertion(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 3
Passed tests: 3
Skipped tests: 0
Affected tests: 0

Click here to see the affected service packages
  • workflows

🟢 All tests passed!

View the build log

@SirGitsalot
Copy link
Member

Mostly LGTM, but you'll need to implement the pre-delete custom code.

Since this is breaking change (albeit one that's allowed) it should have accompanying tests that update the deletion_protection field (and only the deletion_protection field). You can pretty much just copy and paste the TestAccWorkflowsWorkflow_Update test, but change it so that it's only updating deletion_protection.

Create one test with three steps that confirm going from false to true works as expected:

  1. Create the resource with deletion_protection set to false
  2. Update deletion_protection to true
  3. Update deletion_protection again to be false

Steps one and two will simulate a workflow created with an earlier version of TPG being updated with a version of TPG containing this change; the third step just allows the workflow to be deleted after the test completes.

And add another test with two steps that go from true to false. It's a total of 5 test steps but only two config generator functions are necessary since the only difference is the value of deletion_protection .

Copy link

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

@BENY4M1N
Copy link
Member Author

SirGitsalot

Thanks for your thorough review. I have added the pre-delete custom code and additional VCR tests as you mentioned.

@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 ( 5 files changed, 151 insertions(+), 139 deletions(-))
google-beta provider: Diff ( 5 files changed, 151 insertions(+), 139 deletions(-))
Open in Cloud Shell: Diff ( 1 file changed, 1 insertion(+))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 5
Passed tests: 3
Skipped tests: 0
Affected tests: 2

Click here to see the affected service packages
  • workflows

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
  • TestAccWorkflowsWorkflow_UpdateDeletionProtectionFalseToTrue
  • TestAccWorkflowsWorkflow_UpdateDeletionProtectionTrueToFalse

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

🟢 Tests passed during RECORDING mode:
TestAccWorkflowsWorkflow_UpdateDeletionProtectionFalseToTrue [Debug log]
TestAccWorkflowsWorkflow_UpdateDeletionProtectionTrueToFalse [Debug log]

🟢 No issues found for passed tests after REPLAYING rerun.


🟢 All tests passed!

View the build log or the debug log for each test

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