Eun / merge-with-label

A github bot for merging & updating pull requests with a label.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sometimes the bot returns `not merging: pull request is not mergeable`

Eun opened this issue · comments

I suspect this is because github is still in the process of checking whether or not this pull request is mergable.

Two fixes are possible:

  1. Add a retry when this error occurs. While this would fix the problem it would lead to an endless loop of retrying for pull requests that are indeed not mergable. So this would require adding a logic to the current retry logic to stop after X attempts - which would be good in general for this project
  2. The simpler solution would be to either find out if github is still processing or retry when the last update is only X seconds old (similar to the wait logic when a pull request was just updated
    if diff := time.Until(details.LastCommitTime.Add(worker.DurationToWaitAfterUpdateBranch)); diff > 0 {
    )

I am leaving this open to see if #27 fixed it or not