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

Gitlab Mergability - Block Apply on failed builds #1277

Closed
warmfusion opened this issue Dec 1, 2020 · 2 comments
Closed

Gitlab Mergability - Block Apply on failed builds #1277

warmfusion opened this issue Dec 1, 2020 · 2 comments

Comments

@warmfusion
Copy link
Contributor

Hello,

We use gitlab-ci for testing our terraform projects for certain conventions and other linting requirements before they may be applied.

We've setup gitlab to block merging a request if there are failing pipelines on the merge and enabled the mergability flag, but it appears that Atlantis proceeds with applying if requested.

Is it possible to block a terraform apply if the gitlab branch is not mergeable due to the pipeline failure?

Thanks

@kitos9112
Copy link

This would be quite handy, we've got a similar environments where we use GitLab runners to run static code analysis beforehand (e.g. yaml/json validation, terragrunt and terraform validate commands, etc...). Then, we manually run atlantis apply if we're happy with the result.

@jghal
Copy link

jghal commented Apr 21, 2022

I'm still seeing this issue with Atlantis 0.19.2. I have this in my server-side repos.yaml file

repos:
- id: /.*/
  allowed_overrides: [workflow]
  apply_requirements: [approved, mergeable, undiverged]

And I am able to apply an MR that hasn't not met the required approvals.

EDIT: just found #1174 which links to an upstream GitLab API bug (returning mergeable even though the UI says it's not)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants