[core-workflow] New Github Features

Matthias Bussonnier bussonniermatthias at gmail.com
Sat Apr 2 13:50:39 EDT 2016


> On Apr 1, 2016, at 22:07, Nick Coghlan <ncoghlan at gmail.com> wrote:
> 
> On 2 April 2016 at 06:59, Brett Cannon <brett at python.org> wrote:
>> So this support of squash merging may be useful. It really depends on how we
>> try and support porting changes between versions and Misc/NEWS.
> 
> Having the bot handle squashing is likely still desirable, since the
> flow you really want is:
> 
> - squash & rebase the PR
> - run the test suite/build the docs (depending on modified files)
> - commit if successful
> 
> Having what-you-commit and what-you-tested be different always loses
> some of the benefits of pre-commit CI (regardless of whether the
> differences arise from merging, rebasing, squashing, or some
> combination thereof)

Note that GitHub exposes the "future" merge commit as refs/pull/<pr-number>/merge
and Travis CI, for example, does test the merge commit and not the head of the PR.

   $ git fetch origin +refs/pull/1293/merge:
   ...
   * branch            refs/pull/1293/merge -> FETCH_HEAD
   ... 
   $ git checkout -qf FETCH_HEAD
   ...
   # run test suite.


Thus you are technically testing the "future" state of master, and clicking the merge button
will just move the master ref to this new commit – and this is why merge is often instantaneous, 
as the merge was already done. 

Just to contradict myself, I don't know if CI is re-triggered on PR X if PR Y get merged. 
And this is partially irrelevant if you want to get rid of merge commits.

I don't know how other CI works though, 
and I don't know if GitHub expose the (future) squashed commit, but that seem possible.

-- 
M

> There's still value in a "check" CI run to see whether a patch is even
> worth trying to commit, but it's a separate activity from actually
> gating commits on the test suite passing.
> 
> Cheers,
> Nick.
> 
> -- 
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
> _______________________________________________
> core-workflow mailing list
> core-workflow at python.org
> https://mail.python.org/mailman/listinfo/core-workflow
> This list is governed by the PSF Code of Conduct: https://www.python.org/psf/codeofconduct



More information about the core-workflow mailing list