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

Allowing Skipped GitHub status checks to count for the mergeable command requirement, when that status check is a required one #4249

Closed
1 task
dgteixeira opened this issue Feb 15, 2024 · 4 comments · Fixed by #4193
Labels
feature New functionality/enhancement

Comments

@dgteixeira
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Describe the user story

Currently, when a GitHub status check is marked as a required status check and has the skipped result, it does not allow Atlantis to merge the PR, with the following error:

Apply Failed: Pull request must be mergeable before running apply.

We have this use case that a required status check only gets a pass or fail if a specific label is present on the PR.
We want it to run on all PRs, but skip when some conditions are met.
Example of a skipped status check:
image

In this use case, Atlantis counts this PR as non-mergeable, providing the error above.

Describe the solution you'd like

I would like to add the possibility of allowing skipped status checks as a viable response for a mergeable PR.

I believe that this would be feasible by changing these lines of code:

for _, r := range suite.CheckRuns {
//check to see if the check is required
if isRequiredCheck(*r.Name, required.RequiredStatusChecks.Contexts) {
if *c.Conclusion == "success" {
continue
}
return false, nil

With something like:

				if isRequiredCheck(*r.Name, required.RequiredStatusChecks.Contexts) {
					if (*c.Conclusion == "success" || *c.Conclusion == "skipped") {
						continue
					}
					return false, nil
				}

The output of the conclusion field I got it from the GitHub API docs, with the response schema being shown below:
image

Describe the drawbacks of your solution
This would mean that all skipped status checks would not be counted to the mergeable Atlantis verification, which might not be wanted in some use cases.

Describe alternatives you've considered
Changing the methodology we are currently using for the workflow that is being Skipped on these repos, but it's something we would like to avoid.

@dgteixeira dgteixeira added the feature New functionality/enhancement label Feb 15, 2024
@stasostrovskyi
Copy link
Contributor

There is PR to fix a bunch of issues with mergeability and required checks, also enabling atlantis to work with rulesets (or at least required checks from rulesets) - #4193. Maybe this idea can be integrated there?

@dgteixeira
Copy link
Author

@stasostrovskyi , yes, that makes sense, I already added a comment in the PR to see if he can add it to his branch/idea.

@henriklundstrom
Copy link
Contributor

@dgteixeira I've implemented this now. It's included in my PR, see d288d6c.

@dgteixeira
Copy link
Author

@chenrui333, hey, how are you?

Any idea when a release will be available that includes #4193 ?

Thanks !

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

Successfully merging a pull request may close this issue.

3 participants