Tooling and automation has been simplified dramatically with technologies like Docker and the Cloud. On top of this, continuous integration companies like Circle CI and Travis CI have added one more layer of simplicity.
Background
Goals
- Automate all the test runs and remove the manual steps burden of the contributors
- Forbid to push code that breaks tests
- Keep the overall runs below 10min and closer to 5min (the less friction, the better)
- Keep it simple
Picking up a CI infrastructure
- Build our own in Docker images and Jenkins
- Travis CI
- Circle CI
Integrating the CI to Github
- Protect master branch
- Require Circle CI check
- Require pushed branch to be up to date with master
On the Circle side:
For historical reason, traditional pip install
of requirements is not possible yet in Hue. For the record, this will be cleaner after the migration to Python 3 support HUE-8737. In the meantime, the Hue docker base image is pulled, the repository is checked out and the Python and JavaScript code changes are applied to the image. Here is the Circle CI configuration.
On the Hue side, here are the current checks:
Image may be NSFW.
Clik here to view.
Python tests
Ran 641 tests in 131.800s
JavaScript tests
2289 specs, 0 failures, 10 pending specsFinished in 5.627 seconds
JavaScript linting
15s
Pull requests
Image may be NSFW.
Clik here to view.
Automatic pushes
First the process required developers to push to a branch, then push again to the master branch. This was cumbersome as it was easy to forget to push to master, was a redundant steps and easier to get into conflicts as someone might push some other commits to master in the meantime.
Via Circle CI workflows, and only on some dedicated branches, the commits are now automatically pushed to master if the test passes. Regular test branches can still be used and we also took the opportunity to disable the duplicate re-run of the test on the master branch:
Results
So far the time invested (~1 week) is already paid back after less than a month. Developer likes the ease of use and the lead does not need to police and revert commits breaking the master branch. Accepting external contribution has been facilitated too. Developer are even asking for integrating more checks like linting and code coverage.
As the core is now there, it is easy to iteratively add more functionalities to save even more time going forward. For example by adding steps to build Docker images, check Python 2 and 3 compatibility, add Python test coverage checks, start having integration tests or publish documentation changes automatically. Also with some more tweaks on the image we could shave off 1 or 2 minutes of run time.
To finish, here is an example of a CI run. If you also want to play with SQL, just open-up demo.gethue.com.