@@ -368,6 +368,41 @@ describe('workers/repository/init/vulnerability', () => {
368
368
expect ( res . packageRules ) . toHaveLength ( 1 ) ;
369
369
} ) ;
370
370
371
+ it ( 'returns pip alerts with normalized name' , async ( ) => {
372
+ // TODO #22198
373
+ delete config . vulnerabilityAlerts ! . enabled ;
374
+ platform . getVulnerabilityAlerts . mockResolvedValue ( [
375
+ {
376
+ dismissReason : null ,
377
+ vulnerableManifestFilename : 'requirements.txt' ,
378
+ vulnerableManifestPath : 'requirements.txt' ,
379
+ vulnerableRequirements : '= 1.6.7' ,
380
+ securityAdvisory : {
381
+ description : 'Description' ,
382
+ identifiers : [
383
+ { type : 'GHSA' , value : 'GHSA-m956-frf4-m2wr' } ,
384
+ { type : 'CVE' , value : 'CVE-2016-2137' } ,
385
+ ] ,
386
+ references : [
387
+ { url : 'https://nvd.nist.gov/vuln/detail/CVE-2016-9587' } ,
388
+ ] ,
389
+ severity : 'MODERATE' ,
390
+ } ,
391
+ securityVulnerability : {
392
+ package : { name : 'Pillow' , ecosystem : 'PIP' } ,
393
+ firstPatchedVersion : { identifier : '2.1.4' } ,
394
+ vulnerableVersionRange : '< 2.1.4' ,
395
+ } ,
396
+ } ,
397
+ ] ) ;
398
+ const res = await detectVulnerabilityAlerts ( config ) ;
399
+ expect ( res . packageRules ) . toHaveLength ( 1 ) ;
400
+ expect ( res . packageRules ! [ 0 ] . matchPackageNames ) . toEqual ( [
401
+ 'Pillow' ,
402
+ 'pillow' ,
403
+ ] ) ;
404
+ } ) ;
405
+
371
406
it ( 'returns remediations' , async ( ) => {
372
407
config . transitiveRemediation = true ;
373
408
// TODO #22198
0 commit comments