question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Retry on mergeableState: UNKNOWN

See original GitHub issue

How would you describe the issue?

We have a bot that updates dependencies once a week and it creates PRs in quick succession. Once the first PR is merged automatically, other PRs see mergeableState: UNKNOWN for a short while. Sometimes you can even observe that in the GitHub UI (the merge button is greyed out). We tried increasing the MAXIMUM_RETRIES, but it looks like the action is not retrying in this case.

How can we reproduce the issue?

I’m not sure if it can be reproduced manually without a bot. But basically create multiple PRs in quick succession. Here is an example run: https://github.com/moia-dev/scynamo/runs/1548816898#step:2:7

What are the expected results?

Retry on mergeableState: UNKNOWN according to the MAXIMUM_RETRIES setting.

What are the actual results?

AFAICT there were no retries in that run.

How much does it hurt?

Unfortunately this problem breaks our use case.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
desbocommented, Mar 19, 2021

I’ve found that the UNKNOWN state is reported when the workflow run for a PR is in progress. As this action runs as part of a workflow run, it seems the PR will always be in this state when the automated merge is attempted. So rather than adding retry logic (which would only extend the runtime of the action), I think merges should still be attempted on state UNKNOWN.

If it helps anyone, I ended up making my own action to merge PRs that doesn’t have this issue: https://github.com/desbo/merge-pr-action

1reaction
xtazzcommented, Apr 14, 2021

@desbo I found a comment from GitHub:

The null value means that the mergeability of the pull request hasn’t been computed yet. Mergeability is computed on demand and in the background, so when you fetch a pull request for which the mergeability isn’t known – you get back a null value but also a job is kicked off to compute the mergeability. If you make another request, you should see a non-null value for the mergeable attribute.

So, sometimes it will be already calculated and present, but sometimes merge-me action will kick it off, that’s why I implemented retry logic for getting PR information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does GitHub API return an unknown mergeable_state ...
If you make another request, you should see a non-null value for the mergeable attribute. I guess implementing delayed retries is the way...
Read more >
kodiak.queries.MergeableState.UNKNOWN Example - Program Talk
UNKNOWN. Learn how to use python api kodiak.queries.MergeableState.UNKNOWN. ... api_call_retries_remaining: int, api_call_errors: Sequence[APICallRetry], ...
Read more >
Improvements for `mergeable` status · Issue #37
This is a known documented limitation, but when the mergeable state is unknown, ... Alternatively I could have retried the action on failures...
Read more >
Pull request merges fail with the "New changes were pushed ...
Pull request merges fail with the "New changes were pushed to <branch> in <project>/<repository> while the merge was being performed. Please retry the...
Read more >
A brand new website interface for an even better experience!
Retry on mergeableState : UNKNOWN.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found