rfc:travis_ci

This is an old revision of the document!


PHP RFC: Keeping Unit Tests Green

Introduction

We have a setup on Travis CI which automatically runs unit tests for our active branches. This is very convenient for evaluating pull request and status of the branches and keeping us from making changes that break something without us noticing. However, there's a problem with this setup, and the problem is that CI build is never kept in the green for more than a a few days, the “normal” state of it is always failing. I think this situation is not normal and embarrassing for the project, and propose to institute a policy to change it.

Proposal

The start would be recognizing that the goal is to keep the CI tests green and have it officially stated. Once the tests are green, and somebody commits a change that makes them fail, we need to have an accepted policy of what to do. There are a number of ways to approach it, which may be combined and modified as needed and as common sense dictates. This RFC is meant to find out which way of handling it is the most appropriate and accepted by the comminity.

Notifications

It is proposed to have the email notifications enabled for Travis CI to inform the internals list members about the tests going from green to red.

Releases

It is proposed that the main responsibility of keeping the CI tests green will rest with the RM of the particular branch, in case of version branch. One of the responsibilities is that the release should not be made unless the CI tests are green, and the RM is primarily responsible for bringing it to green in one of the ways described below.

Fixing tests

The RM also can ask anybody to act on his behalf in fixing the tests, or consent to anybody volunteering to do it. For master, any of the core developers may serve the same role. The following proposal will use “RM” as the designator of the person taking the action, with understanding from the above that this may be any core dev acting with approval of the RM on version branches, or any core dev on master unless there is a significant disagreement about how to proceed.

Then the following choices proposed for handling of bad commits (with any commit breaking CI tests presumed to be bad), which are as follows:

  1. RM will revert the change as soon as possible, and ask the submitter to fix the pull (since the pulls are tested on CI too) and re-submit it when it's green. The assumption is that pulls that are not green on CI should never be merged. Exceptions to that may be critical security fixes, and if the submitter fixes the commit within short time frame (limited by 2 days) after notifying the RM ASAP on the intention to fix.
  2. RM will wait for the change developer for a (longer) reasonable time to fix the tests, if that does not happen, RM will revert the change. Reasonable time is limited by 1 week but can be extended if circumstances warrant it.
  3. RM will put the failing tests into XFAIL until they are fixed by somebody, instead of reverting the change as per above.
  4. RM will modify the failing test to reflect the new results, after ensuring this is the intended behavior.

These policies would also apply to any future CI system we may introduce, such as Jenkins.

For the changes committed to multiple branches, the RM of the lowest branch is considered responsible, but if he is unable to resolve the problem, the RMs for other branches can step in.

Proposed PHP Version(s)

The policy would apply for all branches in active development or maintenance, starting with PHP 5.5.

Proposed Voting Choices

Proposed votes are as follows:

  1. Accept the description in this RFC as an official policy of the PHP project with regard to unit tests.
  2. Choose one or more of the four options above of handling bad commits, keeping in mind that choosing particular option would be the decision of the RM.

The RFC will be considered accepted if over 50% vote for the acceptance, and any option having the vote of more than 50% of the voters will be considered approved. If none of the options get 50% acceptance but the first item will, the exact handling of the bad commits will be considered to be defined and in the meantime be the decision of the RMs.

References

Changelog

  • 1.0 2014-04-13 Created the RFC
rfc/travis_ci.1397381846.txt.gz · Last modified: 2017/09/22 13:28 (external edit)