-
Notifications
You must be signed in to change notification settings - Fork 5
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
breaking: create and set branch configuration using var.branches
#61
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Terraform Format and Style 🖌
|
marwinbaumannsbp
changed the title
Create and set branch configuration using
breaking: create and set branch configuration using Oct 27, 2023
var.branches
var.branches
fatbasstard
reviewed
Mar 22, 2024
@shoekstra Can you add in the V6 provider support? |
shoekstra
force-pushed
the
add_branches_var
branch
from
March 28, 2024 09:02
5629a2f
to
f2081be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can you update the UPGRADING.md? With a bit of guidance how to change your variables to make it work with v1.0.0?
- Is some kind of state move needed?
- Where is the output of terraform test or an example plan?
Done ✅ |
shoekstra
force-pushed
the
add_branches_var
branch
3 times, most recently
from
April 4, 2024 13:07
2659dd1
to
d861461
Compare
fatbasstard
previously approved these changes
Apr 8, 2024
fatbasstard
reviewed
Apr 8, 2024
require_signed_commits = optional(bool, false) | ||
|
||
required_checks = optional(object({ | ||
strict = optional(bool) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we default this as well? (It's false
)
`var.branches` has been introduced to explicitly create branches, optionally from a source branch or SHA, and configure any branch protection rules. Before this, we relied on implicitly specifying branches via `var.branch_protection` which a) didn't allow us to specify where the branch starts from and b) could cause problems if changing the default branch, where Terraform would try to destroy the existing default branch instead of just setting a new default. This commit also implements some default values for branch protection: * `enforce_admins` defaults to `false` * `required_approving_review_count` defaults to `2` * `require_code_owner_reviews` defaults to `true` Also moved tests to the `test` directory seeing as we cannot reuse modules for testing right now, so may as well use the default location for `terraform test`. Signed-off-by: Stephen Hoekstra <shoekstra@schubergphilis.com>
…opulated This is a more intuitive approach, previously you still needed to set `use_default_branch_protection` to `false` which this commit fixes so it's more natural to use. Now you need to specify `use_branch_protection = false` to really opt out of branch protection for your branch. Signed-off-by: Stephen Hoekstra <shoekstra@schubergphilis.com>
shoekstra
force-pushed
the
add_branches_var
branch
2 times, most recently
from
May 6, 2024 14:35
532f8dd
to
f790efc
Compare
marwinbaumannsbp
previously approved these changes
May 6, 2024
shoekstra
force-pushed
the
add_branches_var
branch
7 times, most recently
from
May 6, 2024 15:37
f8c8af7
to
82cc7ec
Compare
Also fixed some checkov warnings, including setting required signed commits to true. Signed-off-by: Stephen Hoekstra <shoekstra@schubergphilis.com>
shoekstra
force-pushed
the
add_branches_var
branch
from
May 6, 2024 15:42
7830b03
to
e54e4b4
Compare
marwinbaumannsbp
approved these changes
May 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
var.branches
has been introduced to explicitly create branches, optionally from a source branch or SHA, and configure any branch protection rules.Before this, we relied on implicitly specifying branches via
var.branch_protection
which a) didn't allow us to specify where the branch starts from and b) could cause problems if changing the default branch, where Terraform would try to destroy the existing default branch instead of just setting a new default.This commit also implements some default values for branch protection:
enforce_admins
defaults tofalse
required_approving_review_count
defaults to2
require_code_owner_reviews
defaults totrue
require_signed_commits
defaults totrue
Also moved tests to the
test
directory seeing as we cannot reuse modules for testing right now, so may as well use the default location forterraform test
.Signed-off-by: Stephen Hoekstra shoekstra@schubergphilis.com