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

apply_requirements or similar way to block applies of unapproved PRs #1252

Open
ZIJ opened this issue Mar 7, 2024 · 4 comments
Open

apply_requirements or similar way to block applies of unapproved PRs #1252

ZIJ opened this issue Mar 7, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@ZIJ
Copy link
Contributor

ZIJ commented Mar 7, 2024

Currently the only way to prevent applies of un-approved PRs is via Access Policy [EE feature] in the Management Repo

Atlantis has a simple apply_requirements config options; it might make sense to have smth similar in Digger CE

@ZIJ ZIJ changed the title Support apply_requirements or similar way to prevent applies of unapproved PRs apply_requirements or similar way to prevent applies of unapproved PRs Mar 7, 2024
@ZIJ ZIJ changed the title apply_requirements or similar way to prevent applies of unapproved PRs apply_requirements or similar way to block applies of unapproved PRs Mar 7, 2024
@al-lac
Copy link

al-lac commented Mar 7, 2024

This would be really nice to have!

@ben-of-codecraft
Copy link
Contributor

This is a really key feature for us as well

@al-lac
Copy link

al-lac commented May 16, 2024

This actually works already (kind of). When a PR is not mergable (due to lacking reviews or failing checks), digger will not run applies and fail with the following error:
CleanShot 2024-05-16 at 09 06 51@2x

For our use case this was enough.

@ben-of-codecraft
Copy link
Contributor

ben-of-codecraft commented May 17, 2024

I did notice this yesterday for the GitHub CI. It looks like it checks IsMergeable so if you have approvals or status checks set up it will not allow they to apply to happen.

What I would prefer now is a way to configure that at a project level. If you set up your repo to be a multi-account project, the most common case being a dev/prod environment that shares common modules. Then you run into a problem, as you may want to have your developer environment be able to apply without approvals, but your production environment still requires approval requirements be met.

This is more of a request at the GitHub level being able to specify directory level checks in branch protection vs having to write a custom status check action; however, it would be nice to allow Digger to have an option to override the default behavior of always forcing a mergeable PR for lower level environments.

Maybe something like

projects:
    - name: "{{github.org}}-{{github.repo}}-dev"
      dir: dev
      workflow: default
      skip_merge_check: true   # skips the isMergeable check on Digger Apply
      include_patterns: [
        "./modules/**",
        "./config/dev/**",
      ]
      workflow_file: digger_workflow.yml
      aws_role_to_assume:
        state: {{output.stsStateRole.dev}}
        command: {{output.stsCommandRole.dev}}              

    - name: "{{github.org}}-{{github.repo}}-prod"
      dir: prod
      workflow: default
      skip_merge_check: false      # default anyway  just here for illustration 
      include_patterns: [
        "./modules/**",
        "./config/prod/**",
      ]
      workflow_file: digger_workflow.yml
      aws_role_to_assume:
        state: {{output.stsStateRole.prod}}
        command: {{output.stsCommandRole.prod}}  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants