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

Fix rebase API race condition #173

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Apr 11, 2019

  1. Fix rebase API race condition

    Prior to this fix marge-bot would behave as follows, when trying to
    rebase a MR using GitLab's rebase API.
    
      1. Make API request to rebase.
      2. Immediately refetch MR info.
      3. Observe that the MR can still be rebased, immediately retry.
      4. Due to a race condition GitLab rebases again, this time
         skipping pipelines.
      5. Comment on the MR "Someone skipped the queue! Will have to
         try again...".
      6. Check the MR info again, see that the MR can be merged.
      7. Merge the MR without actually waiting for the tests to pass.
    
    This commit addresses 2 root causes with the following measures.
    
      1. Sleep a bit after rebasing a branch to avoid the rebase race
         condition. Polling is also done every 5 seconds vs the previous
         case of every 1 second.
      2. To prevent the comment "Someone skipped the queue! [...]", the
         bot does not compare locally computed SHA with GitLab's SHA after
         a rebase. This check was bogous from the start, because commits
         (including rebase'd commits) include a timestamp in them so it
         is unlikely that two different rebases result in the same SHA.
    kgilden committed Apr 11, 2019
    Configuration menu
    Copy the full SHA
    89207cb View commit details
    Browse the repository at this point in the history