You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"keywords": "Plone, continuous integration, best practices"
8
8
---
9
9
10
10
# Essential continuous integration practices
@@ -21,11 +21,8 @@ Though, there are some essential rules that needs to be followed in order to ach
21
21
Do not make things more complicated for the developer who is responsible for breaking the build.
22
22
23
23
If the build breaks, the developer has to identify the cause of the breakage as soon as possible and should fix it.
24
-
25
24
If we adopt this strategy, we will always be in the best position to find out what caused the breakage and fix it immediately.
26
-
27
25
If one of the developers has made a check-in and broken the build as a result, we have the best chance of fixing the build if we have a clear look at the problem.
28
-
29
26
Checking in further changes and triggering new builds will just lead to more problems.
30
27
31
28
If the build is broken over a longer period of time (more than a couple of hours) you should either notify the developer who is responsible for the breakage, fix the problem yourself, or just revert the commit in order to be able to continue to work.
@@ -34,16 +31,15 @@ If the build is broken over a longer period of time (more than a couple of hours
34
31
There is one exception to this rule.
35
32
Sometimes there are changes or tests that depend on changes in other packages.
36
33
If this is the case, there is no way around breaking a single build for a certain period of time.
37
-
In this case run the all tests locally with all the changes and commit them within a time frame of 10 minutes.
34
+
In this case run the all tests locally with all the changes and commit them within a time frame of ten minutes.
38
35
```
39
36
40
37
41
38
## 2) Always run all commit tests locally before committing
42
39
43
-
Following this practice ensures the build stays green and other developers can continue to work without breaking the first rule.
40
+
Following this practice ensures the build stays green, and other developers can continue to work without breaking the first rule.
44
41
45
42
There might be changes that have been checked in before your last update from the version control that might lead to a build failure in Jenkins in combination with your changes.
46
-
47
43
Therefore it is essential that you check out ({command}`git pull`) and run the tests again before you push your changes to GitHub.
48
44
49
45
Furthermore, a common source of errors on check-in is to forget to add some files to the repository.
@@ -53,16 +49,14 @@ If you follow this rule and your local build passes, you can be sure that this i
53
49
54
50
## 3) Wait for commit tests to pass before moving on
55
51
56
-
Always monitor the build's progress and fix the problem right away if it fails.
57
-
52
+
Always monitor the build's progress, and fix the problem right away if it fails.
58
53
You have a far better chance of fixing the build, if you just introduced a regression than later.
59
54
Also another developer might have committed in the meantime (by breaking rule 1), making things more complicated for yours.
60
55
61
56
62
57
## 4) Never go home on a broken build
63
58
64
59
Taking into account the first rule of CI ("Don't check in on a broken build"), breaking the build essentially stops all other developers from working on it.
65
-
66
60
Therefore going home on a broken build (or even on a build that has not finished yet) is **not** acceptable.
67
61
It will prevent all the other developers to stop working on the build or fixing the errors that you introduced.
68
62
@@ -82,7 +76,6 @@ This way you will allow other developers to continue to work.
82
76
## 7) Don't comment out failing tests
83
77
84
78
Once you begin to enforce the previous rule, the result is often that developers start commenting out failing tests in order to get the build passing again as quick as possible.
85
-
86
79
While this impulse is understandable, it is **wrong**.
87
80
88
81
The tests have been passing for a while and then start to fail.
@@ -95,7 +88,6 @@ You should always either fix the code (if a regression has been found), modify t
95
88
96
89
If you commit a change and all the tests you wrote pass, but others break, the build is still broken.
97
90
This also applies to tests that fail in `buildout.coredev` and don't belong directly to the package you worked on.
98
-
99
91
This means that you have introduced a regression bug into the application.
100
92
101
93
It is **your responsibility**—because you made the change—to fix all tests that are not passing as a result of your changes.
0 commit comments