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

breaking: create and set branch configuration using var.branches #61

Merged
merged 4 commits into from
May 7, 2024

Commits on May 6, 2024

  1. Create and set branch configuration using var.branches

    `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>
    shoekstra committed May 6, 2024
    Configuration menu
    Copy the full SHA
    4109416 View commit details
    Browse the repository at this point in the history
  2. Make sure branch protection is used if branch_protection field is p…

    …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 committed May 6, 2024
    Configuration menu
    Copy the full SHA
    0a5da41 View commit details
    Browse the repository at this point in the history
  3. Add upgrade guide and some more README

    Also fixed some checkov warnings, including setting required signed
    commits to true.
    
    Signed-off-by: Stephen Hoekstra <shoekstra@schubergphilis.com>
    shoekstra committed May 6, 2024
    Configuration menu
    Copy the full SHA
    e54e4b4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3cda203 View commit details
    Browse the repository at this point in the history