Go to file
Xavier Morel 6f68db15d6 [IMP] runbot_merge: sanity check when rebasing
Ensure that the commits we're creating are based on the commit we're
expecting.

This is the second cause (and really the biggest issue) of the "Great
Reset" of master on November 6: a previous commit explains the issue
with non-linear github operations (update a branch, get the branch
head, they don't match).

The second issue is why @awa-odoo's PR was merged with a reversion of
@tivisse's as part of its first commit.

The stage for this issues is based on the incoherence noted above:
having updated a branch, getting that branch's head afterward may
still return the old head. However either delays allow that update to
be visible *or* different operations can have different views of the
system. Regardless it's possible that `repos/merges` "sees" a
different branch head than a `git/refs/heads` which preceded it by a
few milliseconds. This is an issue because github's API does not
provide a generic "rebase" operation, and the operation is thus
implemented by hand:

1. get the head of the branch we're trying to rebase a PR on
2. for each commit of the PR (oldest to newest), *merge* commit on the
   base and associate the merge commit with the original
3. reset the branch to the head we stored previously
4. for each commit of the PR, create a new commit with:

   - the metadata of the original
   - the tree of the merge commit
   - the "current head" as parent

   then update the "current head" to that commit's ref'

If the head fetched at (1) and the one the first merge of (2) sees are
different, the first commit created during (4) will look like it has
not only its own changes but also all the changes between the two
heads, as github records not changes but snapshots of working
copies (that's what a git tree is, a complete snapshot of the entire
state of a working copy).

As a result, we end up not only with commits from a previous staging
but the first commit of the next PR rollbacks the changes of those
commits, making a mess of the entire thing twice over. And because the
commits of the previous staging get reverted, even if there was a good
reason for them to fail (not the case here it was a false positive)
the new staging might just go through.

As noted at the start, mitigate that by asserting that the merge
commits created at (2) have the "base parent" (left parent / parent
from the base branch) we were expecting, and cancel the staging if
that's not the case.

This can probably be removed if / when odoo/runbot#247 happens.
2019-11-12 07:44:01 +01:00
forwardport [FIX] forwardport: the fix 2019-10-18 12:01:47 +02:00
runbot [FIX] runbot: check support before adding auto-tags 2019-11-08 15:40:36 +01:00
runbot_cla [FIX] runbot: fix coverage since shared sources 2019-07-16 12:06:09 +02:00
runbot_merge [IMP] runbot_merge: sanity check when rebasing 2019-11-12 07:44:01 +01:00
.gitignore [IMP] runbot: share sources between builds 2019-07-12 14:50:59 +02:00
conftest.py [ADD] forwardport: automatic branch deleter 2019-10-17 11:55:20 +02:00
README.md [REF] README: update the readme file for the brand new repo 2018-03-08 16:59:39 +01:00

Odoo Runbot Repository

This repository contains the source code of Odoo testing bot runbot.odoo.com and related addons.

Runbot

The runbot/ directory holds the main runbot Odoo addon.

Runbot CLA addon

The runbot_cla/ directory contains an Odoo addon that checks CLA.