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

Feat: add auto approve field to sub environment configuration #871

Merged
merged 7 commits into from
Jul 8, 2024

Conversation

TomerHeber
Copy link
Collaborator

Issue & Steps to Reproduce / Feature Request

resolves #869

Solution

  1. Added the new field to the API.
  2. Added the new field to the schema.
  3. Updated the code.
  4. Updated the acceptance tests.
  5. Updated the integration tests.

@@ -744,6 +751,7 @@ func deploy(d *schema.ResourceData, apiClient client.ApiClientInterface) diag.Di
Revision: subEnvironment.Revision,
Workspace: subEnvironment.Workspace,
ConfigurationChanges: configurationChanges,
UserRequiresApproval: !subEnvironment.ApprovePlanAutomatically,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

notice the '!'

Choose a reason for hiding this comment

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

so what will happen when it is not there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the schema has a default value 'true'.
so it will be 'false'.

@@ -885,6 +893,7 @@ func getCreatePayload(d *schema.ResourceData, apiClient client.ApiClientInterfac
Revision: subEnvironment.Revision,
ConfigurationChanges: subEnvironment.Configuration,
Workspace: subEnvironment.Workspace,
UserRequiresApproval: !subEnvironment.ApprovePlanAutomatically,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

notice the '!'

@@ -2437,6 +2438,7 @@ func TestUnitEnvironmentWithSubEnvironment(t *testing.T) {
Revision: subEnvironment.Revision,
Workspace: updatedSubEnvironment.Workspace,
ConfigurationChanges: updatedSubEnvironment.Configuration,
UserRequiresApproval: true,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

false for 'approve_plan_automatically' will set UserRequiresApproval to true

@TomerHeber TomerHeber requested a review from yaronya June 4, 2024 16:09
@env0 env0 deleted a comment from ItamarMalka Jun 9, 2024
@yaronya yaronya removed their request for review June 9, 2024 06:29
Copy link
Contributor

@avnerenv0 avnerenv0 left a comment

Choose a reason for hiding this comment

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

LGTM,
Please try to fix all the typos in a different PR cause most of the changes here are not related.

@github-actions github-actions bot added ready to merge PR approved - can be merged once the PR owner is ready and removed pending final review labels Jul 8, 2024
@TomerHeber
Copy link
Collaborator Author

TomerHeber commented Jul 8, 2024

LGTM, Please try to fix all the typos in a different PR cause most of the changes here are not related.

My apologies.
I will refrain from doing that moving forward.
I'll merge this PR (to avoid the headache of reverting all the typo changes).

@TomerHeber TomerHeber merged commit 0de03f8 into main Jul 8, 2024
4 checks passed
@TomerHeber TomerHeber deleted the feat-add-auto-approve-for-sub-#869 branch July 8, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-client feature integration-tests provider ready to merge PR approved - can be merged once the PR owner is ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Add auto approve field to sub environment configuration
3 participants