@@ -16,7 +16,9 @@ func TestPurls(t *testing.T) {
1616 })
1717 i := NewInventory (o , nil , "" , "" )
1818 pkg := & models.PackageInsights {
19- Purl : "pkg:github/org/owner" ,
19+ Purl : "pkg:github/org/owner" ,
20+ SourceGitRepo : "org/owner" ,
21+ SourceGitRef : "main" ,
2022 }
2123 _ = pkg .NormalizePurl ()
2224 scannedPackage , err := i .ScanPackage (context .Background (), * pkg , "testdata" )
@@ -39,17 +41,16 @@ func TestPurls(t *testing.T) {
3941 "pkg:gitlabci/include/project?file_name=%2Ftemplates%2F.gitlab-ci-template.yml&project=my-group%2Fmy-project&ref=main" ,
4042 "pkg:gitlabci/include/remote?download_url=https%3A%2F%2Fexample.com%2F.gitlab-ci.yml" ,
4143 "pkg:gitlabci/include/component?project=my-org%2Fsecurity-components%2Fsecret-detection&ref=1.0&repository_url=gitlab.example.com" ,
42- // "pkg:gitlabci/include/local?file_name=%2F.local-ci-template.yml",
43- // "pkg:gitlabci/include/local?file_name=.gitlab-ci.yml",
4444 "pkg:githubactions/org/repo@main" ,
4545 "pkg:docker/debian%3Avuln" ,
4646 "pkg:githubactions/bridgecrewio/checkov-action@main" ,
4747 "pkg:githubactions/org/repo@main#.github/workflows/Reusable.yml" ,
4848 "pkg:azurepipelinestask/DownloadPipelineArtifact@2" ,
4949 "pkg:azurepipelinestask/Cache@2" ,
50+ "pkg:githubactions/org/owner@main#.github/workflows/ci.yml" ,
5051 }
5152 assert .ElementsMatch (t , i .Purls (* scannedPackage ), purls )
52- assert .Equal (t , 18 , len (scannedPackage .BuildDependencies ))
53+ assert .Equal (t , 19 , len (scannedPackage .BuildDependencies ))
5354 assert .Equal (t , 4 , len (scannedPackage .PackageDependencies ))
5455}
5556
@@ -60,7 +61,9 @@ func TestFindings(t *testing.T) {
6061 i := NewInventory (o , nil , "gitlab" , "" )
6162 purl := "pkg:github/org/owner"
6263 pkg := & models.PackageInsights {
63- Purl : purl ,
64+ Purl : purl ,
65+ SourceGitRepo : "org/owner" ,
66+ SourceGitRef : "main" ,
6467 }
6568 _ = pkg .NormalizePurl ()
6669
@@ -436,7 +439,9 @@ func TestSkipRule(t *testing.T) {
436439 purl := "pkg:github/org/owner"
437440 rule_id := "known_vulnerability_in_build_component"
438441 pkg := & models.PackageInsights {
439- Purl : purl ,
442+ Purl : purl ,
443+ SourceGitRepo : "org/owner" ,
444+ SourceGitRef : "main" ,
440445 }
441446 _ = pkg .NormalizePurl ()
442447
@@ -484,7 +489,9 @@ func TestRulesConfig(t *testing.T) {
484489 rule_id := "pr_runs_on_self_hosted"
485490 path := ".github/workflows/allowed_pr_runner.yml"
486491 pkg := & models.PackageInsights {
487- Purl : purl ,
492+ Purl : purl ,
493+ SourceGitRepo : "org/owner" ,
494+ SourceGitRef : "main" ,
488495 }
489496 _ = pkg .NormalizePurl ()
490497
0 commit comments