mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 00:43:20 +01:00
Merge pull request #404 from anchore/add-more-jenkins-plugin-group-ids
Add additional cases for categorizing jenkins package type by group id
This commit is contained in:
commit
c34060d188
@ -1,6 +1,8 @@
|
||||
package pkg
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/anchore/syft/internal"
|
||||
"github.com/package-url/packageurl-go"
|
||||
)
|
||||
@ -35,7 +37,7 @@ type PomProperties struct {
|
||||
|
||||
// PkgTypeIndicated returns the package Type indicated by the data contained in the PomProperties.
|
||||
func (p PomProperties) PkgTypeIndicated() Type {
|
||||
if internal.HasAnyOfPrefixes(p.GroupID, JenkinsPluginPomPropertiesGroupIDs...) {
|
||||
if internal.HasAnyOfPrefixes(p.GroupID, JenkinsPluginPomPropertiesGroupIDs...) || strings.Contains(p.GroupID, ".jenkins.plugin") {
|
||||
return JenkinsPluginPkg
|
||||
}
|
||||
|
||||
|
||||
@ -90,6 +90,17 @@ func TestPomProperties_PkgTypeIndicated(t *testing.T) {
|
||||
},
|
||||
expectedType: JenkinsPluginPkg,
|
||||
},
|
||||
{
|
||||
name: "jenkins.plugin somewhere in group id",
|
||||
pomProperties: PomProperties{
|
||||
Path: "some path",
|
||||
Name: "some name",
|
||||
GroupID: "org.wagoodman.jenkins.plugins.something",
|
||||
ArtifactID: "some artifact ID",
|
||||
Version: "1",
|
||||
},
|
||||
expectedType: JenkinsPluginPkg,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user