Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRT-1475: Update Jira Component and map vsphere variant #172

Merged
merged 6 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,20 @@ You'll need to set the env var `JIRA_TOKEN` to your personal API token
1. Move any configuration for renamed components
2. Delete the obsolete `pkg/components/<component>` directory
3. Remove references to removed components from `pkg/registry`.

# Component Readiness Variant Mapping

Variant mapping maps a particular job variant to a Jira component. This helps us map
a column on Component Readiness dashboard to its proper owners. Variant mapping is not
enabled by default. One can use ```--map-variant=true``` (or simply ```--map-variant```) to enable it.

## Add Variant Mapping to components

To add variant mapping to one particular component, all you need to do is to initialize
Variants slice in your component definition. For example, the following was added to
pkg/components/cloudcompute/vsphereprovider/component.go to map Platform:vsphere to
component "Cloud Compute / vSphere Provider"

```
Variants: []string{"Platform:vsphere"},
```
20 changes: 20 additions & 0 deletions data/openshift-gce-devel/ci_analysis_qe/variant_mapping.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"APIVersion": "v1",
"Kind": "VariantOwnership",
"Product": "OpenShift",
"JiraProject": "OCPBUGS",
"JiraComponent": "Cloud Compute / vSphere Provider",
"VariantName": "Platform",
"VariantValue": "vsphere"
},
{
"APIVersion": "v1",
"Kind": "VariantOwnership",
"Product": "OpenShift",
"JiraProject": "OCPBUGS",
"JiraComponent": "Bare Metal Hardware Provisioning",
"VariantName": "Platform",
"VariantValue": "metal"
}
]
9 changes: 9 additions & 0 deletions data/openshift-gce-devel/ci_analysis_us/variant_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,14 @@
"JiraComponent": "Bare Metal Hardware Provisioning",
"VariantName": "Platform",
"VariantValue": "metal"
},
{
"APIVersion": "v1",
"Kind": "VariantOwnership",
"Product": "OpenShift",
"JiraProject": "OCPBUGS",
"JiraComponent": "Cloud Compute / vSphere Provider",
"VariantName": "Platform",
"VariantValue": "vsphere"
}
]
4 changes: 2 additions & 2 deletions hack/cronjob-update-mapping.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ git checkout -b update

# Generate and push mapping
## OCP Engineering Mappings
ci-test-mapping map --mode=bigquery --push-to-bigquery
ci-test-mapping map --mode=bigquery --push-to-bigquery --map-variant
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also produce this data for QE? Even if it's empty I want to make sure the tables, etc get created (line #21)

## QE Mappings
ci-test-mapping map --mode=bigquery --push-to-bigquery \
--bigquery-dataset ci_analysis_qe --bigquery-project openshift-gce-devel \
--table-junit junit --table-mapping component_mapping --config ""
--table-junit junit --table-mapping component_mapping --config "" --map-variant

if git diff --quiet
then
Expand Down
12 changes: 12 additions & 0 deletions pkg/components/bpfman/capabilities.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package bpfman

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
}
54 changes: 54 additions & 0 deletions pkg/components/bpfman/component.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package bpfman

import (
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 BpfmanComponent = Component{
Component: &config.Component{
Name: "bpfman",
Operators: []string{},
DefaultJiraComponent: "bpfman",
Matchers: []config.ComponentMatcher{},
},
}

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 {
// Look up the stable name for our test in our renamed tests map.
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
}
12 changes: 12 additions & 0 deletions pkg/components/cloudcompute/vsphereprovider/capabilities.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package cloudcomputevsphereprovider

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
}
55 changes: 55 additions & 0 deletions pkg/components/cloudcompute/vsphereprovider/component.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package cloudcomputevsphereprovider

import (
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 VSphereProviderComponent = Component{
Component: &config.Component{
Name: "Cloud Compute / vSphere Provider",
Operators: []string{},
DefaultJiraComponent: "Cloud Compute / vSphere Provider",
Variants: []string{"Platform:vsphere"},
Matchers: []config.ComponentMatcher{},
},
}

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 {
// Look up the stable name for our test in our renamed tests map.
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
}
12 changes: 12 additions & 0 deletions pkg/components/hypershift/aro/capabilities.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package hypershiftaro

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
}
54 changes: 54 additions & 0 deletions pkg/components/hypershift/aro/component.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package hypershiftaro

import (
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 AROComponent = Component{
Component: &config.Component{
Name: "HyperShift / ARO",
Operators: []string{},
DefaultJiraComponent: "HyperShift / ARO",
Matchers: []config.ComponentMatcher{},
},
}

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 {
// Look up the stable name for our test in our renamed tests map.
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
}
12 changes: 12 additions & 0 deletions pkg/components/hypershift/openstack/capabilities.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package hypershiftopenstack

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
}
54 changes: 54 additions & 0 deletions pkg/components/hypershift/openstack/component.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package hypershiftopenstack

import (
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 OpenStackComponent = Component{
Component: &config.Component{
Name: "HyperShift / OpenStack",
Operators: []string{},
DefaultJiraComponent: "HyperShift / OpenStack",
Matchers: []config.ComponentMatcher{},
},
}

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 {
// Look up the stable name for our test in our renamed tests map.
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
}
12 changes: 12 additions & 0 deletions pkg/components/hypershift/rosa/capabilities.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package hypershiftrosa

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
}
Loading