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

Automerge on hold reason #6311

Closed
ChipWolf opened this issue May 23, 2020 · 7 comments
Closed

Automerge on hold reason #6311

ChipWolf opened this issue May 23, 2020 · 7 comments
Labels
duplicate This issue is closed as a duplicate of another issue platform:github GitHub Platform priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)

Comments

@ChipWolf
Copy link

ChipWolf commented May 23, 2020

What would you like Renovate to be able to do?
If automerge is enabled, I’d like to be given the reason why the pull request isn’t being merged.

Describe the solution you'd like
In the body of the pull requests, beside the automerge enabled indicator, the reason renovate is not currently merging the PR should be displayed.

Describe alternatives you've considered
Manually merging pull requests which are passing status checks and are fully rebased, due to not being aware of the reason for no automerge taking place.

Additional context
Several branch permissions can be configured, any of which could be preventing an automerge, there may be other situations outside of branch permissions which could also correspond to this state.

@ChipWolf
Copy link
Author

ChipWolf commented Jun 1, 2020

On removal of 'branch protection rules' from our master branch, automerges continued, which confirmed this issue for me.

@rarkins rarkins added platform:github GitHub Platform type:feature Feature (new functionality) needs-requirements priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Jun 1, 2020
@rarkins
Copy link
Collaborator

rarkins commented Jun 1, 2020

We can probably cover a few of these reasons but not all branch protection rules may be easily visible to us at the API level unfortunately. I saw a case today where all status checks returned "success" yet mergeStateStatus = BLOCKED in the PR. i.e. GitHub isn't great at responding with "You can't merge because of X reason". We may need to query the branch protection rules themselves and try to reason from them why it doesn't work (e.g. check if there's a list of approved mergers and if we're on it, etc).

@rarkins
Copy link
Collaborator

rarkins commented Jun 1, 2020

Needs some exploration of the GitHub API to determine which of the failure conditions we can determine and from which queries.

@viceice
Copy link
Member

viceice commented Jun 1, 2020

Maybe an idea: try automerge PR's as usual, if failed, check protection rules for possible causes. 🤔

@rarkins
Copy link
Collaborator

rarkins commented Jun 2, 2020

Maybe an idea: try automerge PR's as usual, if failed, check protection rules for possible causes. 🤔

Good idea. If it takes any extra queries to determine then we should do it lazily and once per repo, as rules are common per-repo and not per-PR.

@Jolg42
Copy link
Contributor

Jolg42 commented Nov 3, 2020

I was seeing the same kind of behavior here

DEBUG: getBranchStatus() result(branch="renovate/engines")
{
  "branchStatus": "green",
  "branchName": "renovate/engines"
}
DEBUG: Pull Request #4138 does not need updating(branch="renovate/engines")
DEBUG: Checking #4138 for automerge(branch="renovate/engines")
{
  "automerge": true,
  "automergeType": "pr",
  "automergeComment": "automergeComment"
}
DEBUG: PR is configured for automerge(branch="renovate/engines")
DEBUG: PR is not ready for merge(branch="renovate/engines")
{
  "canMergeReason": "mergeStateStatus = BLOCKED"
}

and adding Renovate to allowlist like below fixed it.

#846 (comment)

It would be really great to have better logging here, the exact problem would be the best but a link to docs listing potential problems would be nice as well I think 😃

@rarkins rarkins added the status:requirements Full requirements are not yet known, so implementation should not be started label Jan 12, 2021
@rarkins
Copy link
Collaborator

rarkins commented Mar 14, 2021

Duplicate of #2702

@rarkins rarkins closed this as completed Mar 14, 2021
@rarkins rarkins added the duplicate This issue is closed as a duplicate of another issue label Mar 14, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue is closed as a duplicate of another issue platform:github GitHub Platform priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:requirements Full requirements are not yet known, so implementation should not be started type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

4 participants