@@ -242,7 +242,12 @@ function isJobExcludedByDeprecatedCommandName(job: Job, exclusions: JobToExclude
242
242
) ;
243
243
}
244
244
245
- function isJobExcludedByConfiguration ( job : Job , exclude : JobToExcludeFromFile , config : Config ) : boolean {
245
+ function isJobExcludedByConfiguration (
246
+ job : Job ,
247
+ exclude : JobToExcludeFromFile ,
248
+ config : Config ,
249
+ logger : Logger
250
+ ) : boolean {
246
251
const jobName = isJobFromTool ( job ) ? job . tool . name : job . name ;
247
252
248
253
if ( jobName !== exclude . name ) {
@@ -253,23 +258,35 @@ function isJobExcludedByConfiguration(job: Job, exclude: JobToExcludeFromFile, c
253
258
const dependenciesToExclude = exclude . dependencies ?? WILDCARD_ALIAS ;
254
259
255
260
if ( ! isAnyPhpVersionType ( phpVersionToExclude ) ) {
261
+ const nonExcludedPhpVersionDebugMessage = `Job with name ${ jobName } is not matching exclusion rule`
262
+ + ` with name ${ exclude . name } due to non-excluded php version.` ;
263
+
256
264
if ( isLowestPhpVersionType ( phpVersionToExclude ) && job . job . php !== config . minimumPhpVersion ) {
265
+ logger . debug ( nonExcludedPhpVersionDebugMessage ) ;
266
+
257
267
return false ;
258
268
}
259
269
260
270
if ( isLatestPhpVersionType ( phpVersionToExclude ) && job . job . php !== config . latestPhpVersion ) {
271
+ logger . debug ( nonExcludedPhpVersionDebugMessage ) ;
272
+
261
273
return false ;
262
274
}
263
275
264
276
if ( phpVersionToExclude !== job . job . php ) {
277
+ logger . debug ( nonExcludedPhpVersionDebugMessage ) ;
278
+
265
279
return false ;
266
280
}
267
281
}
268
282
269
- if ( ! isAnyComposerDependencySet ( dependenciesToExclude ) ) {
270
- if ( dependenciesToExclude !== job . job . composerDependencySet ) {
271
- return false ;
272
- }
283
+ if ( ! isAnyComposerDependencySet ( dependenciesToExclude ) && dependenciesToExclude !== job . job . composerDependencySet ) {
284
+ logger . debug (
285
+ `Job with name ${ jobName } is not matching exclusion rule`
286
+ + ` with name ${ exclude . name } due to non-excluded Composer dependencies.`
287
+ ) ;
288
+
289
+ return false ;
273
290
}
274
291
275
292
return true ;
@@ -280,7 +297,7 @@ function isJobExcluded(job: Job, exclusions: JobToExcludeFromFile[], config: Con
280
297
return false ;
281
298
}
282
299
283
- if ( exclusions . some ( ( exclude ) => isJobExcludedByConfiguration ( job , exclude , config ) ) ) {
300
+ if ( exclusions . some ( ( exclude ) => isJobExcludedByConfiguration ( job , exclude , config , logger ) ) ) {
284
301
logger . info ( `Job with name ${ job . name } is excluded due to application config.` ) ;
285
302
286
303
return true ;
0 commit comments