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