Skip to content

Commit

Permalink
Update regressionallowances to use resolvedissues TriageMatchVariants…
Browse files Browse the repository at this point in the history
… list
  • Loading branch information
neisw committed Jul 9, 2024
1 parent 64ec7bb commit cc0ba0e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pkg/componentreadiness/resolvedissues/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/openshift/sippy/pkg/apis/api"
)

var triageMatchVariants = buildTriageMatchVariants([]string{variantregistry.VariantPlatform, variantregistry.VariantArch, variantregistry.VariantNetwork,
var TriageMatchVariants = buildTriageMatchVariants([]string{variantregistry.VariantPlatform, variantregistry.VariantArch, variantregistry.VariantNetwork,
variantregistry.VariantTopology, variantregistry.VariantFeatureSet, variantregistry.VariantUpgrade,
variantregistry.VariantSuite, variantregistry.VariantInstaller})

Expand All @@ -31,7 +31,7 @@ func TransformVariant(variant api.ComponentReportColumnIdentification) []api.Com
triagedVariants := []api.ComponentReportVariant{}
for name, value := range variant.Variants {
// For now, we only use the defined match variants
if triageMatchVariants.Has(name) {
if TriageMatchVariants.Has(name) {
triagedVariants = append(triagedVariants, api.ComponentReportVariant{Key: name, Value: value})
}
}
Expand All @@ -48,7 +48,7 @@ func KeyForTriagedIssue(testID string, variants []api.ComponentReportVariant) Tr

for _, v := range variants {
// currently we ignore variants that aren't in api.ComponentReportColumnIdentification
if triageMatchVariants.Has(v.Key) {
if TriageMatchVariants.Has(v.Key) {
newValue := v.Value
switch v.Key {
case "Upgrade":
Expand Down Expand Up @@ -86,7 +86,7 @@ func KeyForTriagedIssue(testID string, variants []api.ComponentReportVariant) Tr
newKey = variantregistry.VariantSuite
}

if triageMatchVariants.Has(newKey) {
if TriageMatchVariants.Has(newKey) {
triagedVariants[newKey] = newValue
}
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/regressionallowances/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import (
"fmt"
"net/url"

"github.com/openshift/sippy/pkg/componentreadiness/resolvedissues"

"github.com/openshift/sippy/pkg/apis/api"
log "github.com/sirupsen/logrus"
)

var requiredVariants = []string{"Architecture", "Network", "Platform", "Upgrade"}

type IntentionalRegression struct {
JiraComponent string
TestID string
Expand Down Expand Up @@ -104,7 +104,7 @@ func addIntentionalRegression(release release, in IntentionalRegression) error {
if _, err := url.ParseRequestURI(in.JiraBug); err != nil {
return fmt.Errorf("jiraBug must be a valid URL")
}
for _, v := range requiredVariants {
for _, v := range resolvedissues.TriageMatchVariants.List() {
if _, ok := in.Variant.Variants[v]; !ok {
return fmt.Errorf("%s must be specified", v)
}
Expand Down

0 comments on commit cc0ba0e

Please sign in to comment.