diff --git a/pkg/components/lpocp/capabilities.go b/pkg/components/lpocp/capabilities.go new file mode 100644 index 00000000..1ee5d41b --- /dev/null +++ b/pkg/components/lpocp/capabilities.go @@ -0,0 +1,11 @@ +package lpocp + +import ( + v1 "github.com/openshift-eng/ci-test-mapping/pkg/api/types/v1" + "github.com/openshift-eng/ci-test-mapping/pkg/util" +) + +func identifyCapabilities(test *v1.TestInfo) []string { + capabilities := util.DefaultCapabilities(test) + return capabilities +} diff --git a/pkg/components/lpocp/component.go b/pkg/components/lpocp/component.go new file mode 100644 index 00000000..fc942354 --- /dev/null +++ b/pkg/components/lpocp/component.go @@ -0,0 +1,57 @@ +package lpocp + +import ( + "regexp" + + v1 "github.com/openshift-eng/ci-test-mapping/pkg/api/types/v1" + "github.com/openshift-eng/ci-test-mapping/pkg/config" +) + +type Component struct { + *config.Component +} + +var LPocpComponent = Component{ + Component: &config.Component{ + Name: "LP--OCP", + Operators: []string{}, + DefaultJiraComponent: "LP--OCP", + Matchers: []config.ComponentMatcher{ + {SuiteRegEx: regexp.MustCompile(`^lp-chaos--OCP--`)}, + }, + }, +} + +func (c *Component) IdentifyTest(test *v1.TestInfo) (*v1.TestOwnership, error) { + if matcher := c.FindMatch(test); matcher != nil { + jira := matcher.JiraComponent + if jira == "" { + jira = c.DefaultJiraComponent + } + return &v1.TestOwnership{ + Name: test.Name, + Component: c.Name, + JIRAComponent: jira, + Priority: matcher.Priority, + Capabilities: append(matcher.Capabilities, identifyCapabilities(test)...), + }, nil + } + + return nil, nil +} + +func (c *Component) StableID(test *v1.TestInfo) string { + if stableName, ok := c.TestRenames[test.Name]; ok { + return stableName + } + return test.Name +} + +func (c *Component) JiraComponents() (components []string) { + components = []string{c.DefaultJiraComponent} + for _, m := range c.Matchers { + components = append(components, m.JiraComponent) + } + + return components +} diff --git a/pkg/registry/registry.go b/pkg/registry/registry.go index 09f3c1b7..6ef2af20 100644 --- a/pkg/registry/registry.go +++ b/pkg/registry/registry.go @@ -102,6 +102,7 @@ import ( "github.com/openshift-eng/ci-test-mapping/pkg/components/lpgitops" "github.com/openshift-eng/ci-test-mapping/pkg/components/lpmta" "github.com/openshift-eng/ci-test-mapping/pkg/components/lpoadp" + "github.com/openshift-eng/ci-test-mapping/pkg/components/lpocp" "github.com/openshift-eng/ci-test-mapping/pkg/components/lpodf" "github.com/openshift-eng/ci-test-mapping/pkg/components/lpopenshiftpipelines" "github.com/openshift-eng/ci-test-mapping/pkg/components/lpquay" @@ -448,6 +449,7 @@ func NewComponentRegistry() *Registry { r.Register("service-ca", &serviceca.ServiceCaComponent) r.Register("spire-operator", &spireoperator.SpireOperatorComponent) r.Register("LP--CNV", &lpcnv.LPcnvComponent) + r.Register("LP--OCP", &lpocp.LPocpComponent) r.Register("eBPF Manager", &ebpfmanager.EBPFManagerComponent) r.Register("External Secrets Operator", &externalsecretsoperator.ExternalSecretsOperatorComponent) r.Register("JobSet", &jobset.JobSetComponent)