|
| 1 | +******* |
| 2 | +Jenkins |
| 3 | +******* |
| 4 | + |
| 5 | +`Jenkins`_ is an open source continuous integration server. edX has a Jenkins |
| 6 | +installation specifically for testing pull requests to our open source software |
| 7 | +project, including edx-platform. Before a pull request can be merged, Jenkins |
| 8 | +must run all the tests for that pull request: this is known as a "build". |
| 9 | +If even one test in the build fails, then the entire build is considered a |
| 10 | +failure. Pull requests cannot be merged until they have a passing build. |
| 11 | + |
| 12 | +Kicking Off Builds |
| 13 | +================== |
| 14 | + |
| 15 | +Jenkins has the ability to automatically detect new pull requests and changed |
| 16 | +pull requests on Github, and it can automatically run builds in response to |
| 17 | +these events. We have Jenkins configured to automatically run builds for all |
| 18 | +pull requests from core committers; however, Jenkins will *not* automatically |
| 19 | +run builds for new contributors, so a community manager will need to manually |
| 20 | +kick off a build for a pull request from a new contributor. |
| 21 | + |
| 22 | +The reason for this distinction is a matter of trust. Running a build means that |
| 23 | +Jenkins will execute all the code in the pull request. A pull request can |
| 24 | +contain any code whatsoever: if we allowed Jenkins to automatically build every |
| 25 | +pull request, then a malicious developer could make our Jenkins server do whatever |
| 26 | +he or she wanted. Before kicking off a build, community managers look at the |
| 27 | +code changes to verify that they are not malicious; this protects us from nasty |
| 28 | +people. |
| 29 | + |
| 30 | +Once a contributor has submitted a few pull requests, they can request to be |
| 31 | +added to the Jenkins whitelist: this is a special list of people that Jenkins |
| 32 | +*will* kick off builds for automatically. If the community managers feel that |
| 33 | +the contributor is trustworthy, then they will grant the request, which will |
| 34 | +make future development faster and easier for both the contributor and edX. If |
| 35 | +a contibutor shows that they can not be trusted for some reason, they will be |
| 36 | +removed from this whitelist. |
| 37 | + |
| 38 | +Failed Builds |
| 39 | +============= |
| 40 | + |
| 41 | +Click on the build to be brought to the build page. You'll see a matrix of blue |
| 42 | +and red dots; the red dots indicate what section failing tests were present in. |
| 43 | +You can click on the test name to be brought to an error trace that explains |
| 44 | +why the tests fail. Please address the failing tests before requesting a new |
| 45 | +build on your branch. If the failures appear to not have anything to do with |
| 46 | +your code, it may be the case that the master branch is failing. You can ask |
| 47 | +your reviewers for advice in this scenario. |
| 48 | + |
| 49 | +If the build says "Unstable" but passes all tests, you have introduced too many |
| 50 | +pep8 and pylint violations. Please refer to the documentation for :doc:`code-quality` |
| 51 | +and clean up the code. |
| 52 | + |
| 53 | +Successful Builds |
| 54 | +================= |
| 55 | + |
| 56 | +If all the tests pass, the "Diff Coverage" and "Diff Quality" reports are |
| 57 | +generated. Click on the "View Reports" link on your pull request to be brought |
| 58 | +to the Jenkins report page. In a column on the left side of the page are a few |
| 59 | +links, including "Diff Coverage Report" and "Diff Quality Report". View each of |
| 60 | +these reports (making note that the Diff Quality report has two tabs - one for |
| 61 | +pep8, and one for Pylint). |
| 62 | + |
| 63 | +Make sure your quality coverage is 100% and your test coverage is at least 95%. |
| 64 | +Adjust your code appropriately if these metrics are not high enough. Be sure to |
| 65 | +ask your reviewers for advice if you need it. |
| 66 | + |
| 67 | + |
| 68 | +.. _Jenkins: http://jenkins-ci.org/ |
0 commit comments