@@ -34,10 +34,12 @@ const JENKINS_FAILURE = 'JENKINS_FAILURE';
34
34
const GIT_FAILURE = 'GIT_FAILURE' ;
35
35
const NCU_FAILURE = 'NCU_FAILURE' ;
36
36
const RESUME_FAILURE = 'RESUME_FAILURE' ;
37
+ const INFRA_FAILURE = 'INFRA_FAILURE' ;
37
38
38
39
const FAILURE_TYPES = {
39
40
BUILD_FAILURE , JS_TEST_FAILURE , CC_TEST_FAILURE ,
40
- JENKINS_FAILURE , GIT_FAILURE , NCU_FAILURE , RESUME_FAILURE
41
+ JENKINS_FAILURE , GIT_FAILURE , NCU_FAILURE , RESUME_FAILURE ,
42
+ INFRA_FAILURE
41
43
} ;
42
44
43
45
class CIResult {
@@ -60,6 +62,14 @@ class BuildFailure extends CIResult {
60
62
}
61
63
}
62
64
65
+ // Usually needs to fix something in the Jenkins agent (or just restart it)
66
+ class InfraFailure extends CIResult {
67
+ constructor ( ctx , reason ) {
68
+ super ( ctx , reason ) ;
69
+ this . type = INFRA_FAILURE ;
70
+ }
71
+ }
72
+
63
73
// Usually needs a fix in the test or the core
64
74
class JSTestFailure extends CIResult {
65
75
constructor ( ctx , reason ) {
@@ -126,6 +136,25 @@ function failureMatcher(Failure, patterns, ctx, text) {
126
136
127
137
// The elements are ranked by priority
128
138
const FAILURE_FILTERS = [ {
139
+ // NOTE(mmarchini): infra-related issues should have the highest priority, as
140
+ // they can cause other issues to happen.
141
+ filter ( ctx , text ) {
142
+ const patterns = [ {
143
+ pattern : / R e a d - o n l y f i l e s y s t e m / g,
144
+ context : { index : 0 , contextBefore : 1 , contextAfter : 0 }
145
+ } ,
146
+ {
147
+ pattern : / D e v i c e o r r e s o u r c e b u s y / g,
148
+ context : { index : 0 , contextBefore : 1 , contextAfter : 0 }
149
+ } ,
150
+ {
151
+ pattern : / T h e r e i s n o t e n o u g h s p a c e i n t h e f i l e s y s t e m ./ g,
152
+ context : { index : 0 , contextBefore : 1 , contextAfter : 0 }
153
+ }
154
+ ] ;
155
+ return failureMatcher ( InfraFailure , patterns , ctx , text ) ;
156
+ }
157
+ } , {
129
158
// TODO: match indentation to avoid skipping context with '...'
130
159
filter ( ctx , text ) {
131
160
const pattern = / n o t o k \d + [ \s \S ] + ? { 2 } \. \. \. \r ? \n / mg;
@@ -203,9 +232,6 @@ const FAILURE_FILTERS = [{
203
232
} , {
204
233
filter ( ctx , text ) {
205
234
const patterns = [ {
206
- pattern : / T h e r e i s n o t e n o u g h s p a c e i n t h e f i l e s y s t e m ./ g,
207
- context : { index : 0 , contextBefore : 0 , contextAfter : 5 }
208
- } , {
209
235
pattern : / s h : l i n e / g,
210
236
context : { index : 0 , contextBefore : 0 , contextAfter : 1 }
211
237
} , {
0 commit comments