Skip to content

Commit

Permalink
Merge pull request #172 from xueqzhan/sync-jira
Browse files Browse the repository at this point in the history
TRT-1475: Update Jira Component and map vsphere variant
  • Loading branch information
openshift-merge-bot[bot] authored Jan 24, 2025
2 parents 89288fa + 9bd18d4 commit eb7a2e2
Show file tree
Hide file tree
Showing 31 changed files with 933 additions and 2 deletions.
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions data/openshift-gce-devel/ci_analysis_us/variant_mapping.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
## 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

0 comments on commit eb7a2e2

Please sign in to comment.