-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Failed: Pull request must be mergeable before running apply. (gitlab) #4949
Comments
Hey @kunal2791! I'm here to help you with your GitLab Merge Requests issue. I can assist with bug fixes, answer your questions, and guide you on how to become a contributor. Let's get this sorted out! Atlantis might be failing to detect GitLab Merge Requests (MR) as mergeable due to several conditions that need to be met. The Here is a relevant code snippet from the if ((supportsDetailedMergeStatus &&
(mr.DetailedMergeStatus == "mergeable" ||
mr.DetailedMergeStatus == "ci_still_running" ||
mr.DetailedMergeStatus == "ci_must_pass" ||
mr.DetailedMergeStatus == "need_rebase")) ||
(!supportsDetailedMergeStatus &&
mr.MergeStatus == "can_be_merged")) && //nolint:staticcheck // Need to reference deprecated field for backwards compatibility
mr.ApprovalsBeforeMerge <= 0 &&
mr.BlockingDiscussionsResolved &&
!mr.WorkInProgress &&
(allowSkippedPipeline || !isPipelineSkipped) {
logger.Debug("Merge request is mergeable")
return true, nil
}
logger.Debug("Merge request is not mergeable")
return false, nil If any of these conditions are not met, the merge request will not be considered mergeable by Atlantis [1]. Additionally, there are similar issues reported by other users:
You might want to verify if the |
@dosu. We do get the same error message but in github PR, but in log we found that atlantis is unable to read the response. Unable to check pull mergeable status, error: getting pull request status: fetching rulesets, branch protections and status checks from GraphQL: Something went wrong while executing your query. unable to get pull request status: fetching mergeability status for repo: test-org/test-iac, and pull number: xx: getting pull request status: fetching rulesets, branch protections and status checks from GraphQL: Something went wrong while executing your query. |
Atlantis failing to properly detect GitLab Merge Requests (MR) as mergeable, even when they meet the criteria (such as pipeline passed, approvals received, and no conflicts).
if apply_requirement set to mergeable.
this is config file.
repos:
allowed_overrides: [workflow]
pre_workflow_hooks:
#post_workflow_hooks:
#- run: '[ -f atlantis.yaml ] && { rm atlantis.yaml && echo "File deleted."; } || echo "Not found"'
workflow: terragrunt
delete_source_branch_on_merge: true
apply_requirements: [mergeable]
workflows:
terragrunt:
plan:
steps:
apply:
steps:
The text was updated successfully, but these errors were encountered: