GitHub protected branches

483 views
Skip to first unread message

Aaron Meurer

unread,
Mar 30, 2016, 12:57:49 PM3/30/16
to sy...@googlegroups.com
GitHub today announced a change to their protected branches feature
that allows to require status checks without requiring fast-forward
merges https://github.com/blog/2137-protected-branches-improvements.
Previously we had not enabled the feature that required Travis to pass
before merging because it also required fast-forward merges, which was
too restrictive (every pull request would have to be re-merged with
master and tested again).

So I have enabled required Travis testing on SymPy master. This means
that no pull request can be merged unless Travis passes.

The other benefit of this is that it's now impossible to accidentally
push to master. If you try, git will give you an error like

$ git push
Counting objects: 1, done.
Writing objects: 100% (1/1), 186 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: Required status check
"continuous-integration/travis-ci/push" is errored
To g...@github.com:asmeurer/GitHub-Issues-Test.git
! [remote rejected] master -> master (protected branch hook declined)
error: failed to push some refs to
'g...@github.com:asmeurer/GitHub-Issues-Test.git'

It's also impossible to edit files directly in master with the GitHub
editor, meaning accidental breakages like
https://github.com/sympy/sympy/pull/10902 are now impossible.

I hope this policy isn't too restrictive. Please let me know if there
are any issues with it.

Aaron Meurer

Ondřej Čertík

unread,
Mar 30, 2016, 3:09:22 PM3/30/16
to sympy
I like this. The only downside is that sometimes Travis fails
(internal error) but we know that the PR change couldn't have
triggered such a failure. Now we'll have to rerun the failed build.
But I think that's fine. The advantages outweigh this minor annoyance.

Ondrej
Reply all
Reply to author
Forward
0 new messages