1
1
'use strict'
2
2
3
+ const ciNeededFolderRx = / ^ ( d e p s | l i b | s r c | t e s t ) \/ /
3
4
// order of entries in this map *does* matter for the resolved labels
4
5
// earlier entries override later entries
5
6
const subSystemLabelsMap = new Map ( [
@@ -37,10 +38,10 @@ const subSystemLabelsMap = new Map([
37
38
[ / ^ s r c \/ n o d e _ b o b * / , [ 'c++' , 'quic' , 'dont-land-on-v14.x' , 'dont-land-on-v12.x' ] ] ,
38
39
39
40
// don't label python files as c++
40
- [ / ^ s r c \/ .+ \. p y $ / , 'lib / src' ] ,
41
+ [ / ^ s r c \/ .+ \. p y $ / , [ 'lib / src' , 'needs-ci' ] ] ,
41
42
42
43
// properly label changes to v8 inspector integration-related files
43
- [ / ^ s r c \/ i n s p e c t o r _ / , [ 'c++' , 'inspector' ] ] ,
44
+ [ / ^ s r c \/ i n s p e c t o r _ / , [ 'c++' , 'inspector' , 'needs-ci' ] ] ,
44
45
45
46
// don't want to label it a c++ update when we're "only" bumping the Node.js version
46
47
[ / ^ s r c \/ (? ! n o d e _ v e r s i o n \. h ) / , 'c++' ] ,
@@ -51,22 +52,24 @@ const subSystemLabelsMap = new Map([
51
52
// things that edit top-level .md files are always a doc change
52
53
[ / ^ \w + \. m d $ / , 'doc' ] ,
53
54
// different variants of *Makefile and build files
54
- [ / ^ ( t o o l s \/ ) ? ( M a k e f i l e | B S D m a k e f i l e | c r e a t e _ a n d r o i d _ m a k e f i l e s | \. t r a v i s \. y m l ) $ / , 'build' ] ,
55
- [ / ^ t o o l s \/ ( i n s t a l l \. p y | g e n v 8 c o n s t a n t s \. p y | g e t n o d e v e r s i o n \. p y | j s 2 c \. p y | u t i l s \. p y | c o n f i g u r e \. d \/ .* ) $ / , 'build' ] ,
56
- [ / ^ v c b u i l d \. b a t $ / , [ 'build' , 'windows' ] ] ,
57
- [ / ^ ( a n d r o i d - ) ? c o n f i g u r e | n o d e \. g y p | c o m m o n \. g y p i $ / , 'build' ] ,
55
+ [ / ^ ( t o o l s \/ ) ? ( M a k e f i l e | B S D m a k e f i l e | c r e a t e _ a n d r o i d _ m a k e f i l e s | \. t r a v i s \. y m l ) $ / , [ 'build' , 'needs-ci' ] ] ,
56
+ [ / ^ t o o l s \/ ( i n s t a l l \. p y | g e n v 8 c o n s t a n t s \. p y | g e t n o d e v e r s i o n \. p y | j s 2 c \. p y | u t i l s \. p y | c o n f i g u r e \. d \/ .* ) $ / , [ 'build' , 'needs-ci' ] ] ,
57
+ [ / ^ v c b u i l d \. b a t $ / , [ 'build' , 'windows' , 'needs-ci' ] ] ,
58
+ [ / ^ ( a n d r o i d - ) ? c o n f i g u r e | n o d e \. g y p | c o m m o n \. g y p i $ / , [ 'build' , 'needs-ci' ] ] ,
58
59
// more specific tools
59
- [ / ^ t o o l s \/ g y p / , [ 'tools' , 'build' ] ] ,
60
+ [ / ^ t o o l s \/ g y p / , [ 'tools' , 'build' , 'needs-ci' ] ] ,
60
61
[ / ^ t o o l s \/ d o c \/ / , [ 'tools' , 'doc' ] ] ,
61
- [ / ^ t o o l s \/ i c u \/ / , [ 'tools' , 'intl' ] ] ,
62
+ [ / ^ t o o l s \/ i c u \/ / , [ 'tools' , 'intl' , 'needs-ci' ] ] ,
62
63
[ / ^ t o o l s \/ (?: o s x - p k g \. p m d o c | p k g s r c ) \/ / , [ 'tools' , 'macos' , 'install' ] ] ,
63
64
[ / ^ t o o l s \/ (?: (?: m a c ) ? o s x - ) / , [ 'tools' , 'macos' ] ] ,
64
65
[ / ^ t o o l s \/ t e s t - n p m / , [ 'tools' , 'test' , 'npm' ] ] ,
65
66
[ / ^ t o o l s \/ t e s t / , [ 'tools' , 'test' ] ] ,
66
67
[ / ^ t o o l s \/ (?: c e r t d a t a | m k s s l d e f | m k - c a - b u n d l e ) / , [ 'tools' , 'openssl' , 'tls' ] ] ,
67
- [ / ^ t o o l s \/ m s v s \/ / , [ 'tools' , 'windows' , 'install' ] ] ,
68
- [ / ^ t o o l s \/ [ ^ / ] + \. b a t $ / , [ 'tools' , 'windows' ] ] ,
69
- [ / ^ t o o l s \/ m a k e - v 8 / , [ 'tools' , 'V8 Engine' ] ] ,
68
+ [ / ^ t o o l s \/ m s v s \/ / , [ 'tools' , 'windows' , 'install' , 'needs-ci' ] ] ,
69
+ [ / ^ t o o l s \/ [ ^ / ] + \. b a t $ / , [ 'tools' , 'windows' , 'needs-ci' ] ] ,
70
+ [ / ^ t o o l s \/ m a k e - v 8 / , [ 'tools' , 'V8 Engine' , 'needs-ci' ] ] ,
71
+ [ / ^ t o o l s \/ ( c o d e _ c a c h e | s n a p s h o t | v 8 _ g y p f i l e s ) / , 'needs-ci' ] ,
72
+ [ / ^ t o o l s \/ b u i l d - a d d o n s .j s / , 'needs-ci' ] ,
70
73
// all other tool changes should be marked as such
71
74
[ / ^ t o o l s \/ / , 'tools' ] ,
72
75
[ / ^ \. e s l i n t | \. r e m a r k | \. e d i t o r c o n f i g / , 'tools' ] ,
@@ -239,6 +242,10 @@ function matchSubSystemsByRegex (rxLabelsMap, filepathsChanged, limitLabels) {
239
242
const labelCount = [ ]
240
243
// by putting matched labels into a map, we avoid duplicate labels
241
244
const labelsMap = filepathsChanged . reduce ( ( map , filepath ) => {
245
+ if ( ciNeededFolderRx . test ( filepath ) && ! map [ 'needs-ci' ] ) {
246
+ map [ 'needs-ci' ] = true
247
+ }
248
+
242
249
const mappedSubSystems = mappedSubSystemsForFile ( rxLabelsMap , filepath )
243
250
244
251
if ( ! mappedSubSystems ) {
@@ -251,8 +258,8 @@ function matchSubSystemsByRegex (rxLabelsMap, filepathsChanged, limitLabels) {
251
258
if ( limitLabels && hasLibOrSrcChanges ( filepathsChanged ) ) {
252
259
if ( labelCount . length >= 4 ) {
253
260
for ( const label of labelCount ) {
254
- // don't delete the c++ label as we always want that if it has matched
255
- if ( label !== 'c++' ) delete map [ label ]
261
+ // don't delete the ` c++` or `needs-ci` labels as we always want those if they have matched
262
+ if ( label !== 'c++' && label !== 'needs-ci' ) delete map [ label ]
256
263
}
257
264
map [ 'lib / src' ] = true
258
265
// short-circuit
0 commit comments