@@ -34,10 +34,12 @@ const JENKINS_FAILURE = 'JENKINS_FAILURE';
3434const GIT_FAILURE = 'GIT_FAILURE' ;
3535const NCU_FAILURE = 'NCU_FAILURE' ;
3636const RESUME_FAILURE = 'RESUME_FAILURE' ;
37+ const INFRA_FAILURE = 'INFRA_FAILURE' ;
3738
3839const FAILURE_TYPES = {
3940 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
4143} ;
4244
4345class CIResult {
@@ -60,6 +62,14 @@ class BuildFailure extends CIResult {
6062 }
6163}
6264
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+
6373// Usually needs a fix in the test or the core
6474class JSTestFailure extends CIResult {
6575 constructor ( ctx , reason ) {
@@ -126,6 +136,25 @@ function failureMatcher(Failure, patterns, ctx, text) {
126136
127137// The elements are ranked by priority
128138const 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+ } , {
129158 // TODO: match indentation to avoid skipping context with '...'
130159 filter ( ctx , text ) {
131160 const pattern = / n o t o k \d + [ \s \S ] + ? { 2 } \. \. \. \r ? \n / mg;
@@ -203,9 +232,6 @@ const FAILURE_FILTERS = [{
203232} , {
204233 filter ( ctx , text ) {
205234 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- } , {
209235 pattern : / s h : l i n e / g,
210236 context : { index : 0 , contextBefore : 0 , contextAfter : 1 }
211237 } , {
0 commit comments