From 4bc03a1ab7ed329b302ab2e9a56fa40f5d47aeb7 Mon Sep 17 00:00:00 2001 From: openshift-trt Date: Mon, 29 Jun 2026 11:30:13 +0000 Subject: [PATCH 1/2] TRT-2762: Fix variant filter inflating regression count in Component Readiness Two bugs caused adding a variant filter to inflate regression counts with unrelated results: 1. updateVarsFromView() did not sync test_filters (lifecycles, capabilities) from the view into React state. When "Generate Report" dropped the view param and built URL params from state, the lifecycle filter was lost, causing all lifecycle tests to appear in the sample query and producing hundreds of spurious regressions. 2. replaceIncludeVariantsCheckedItems() and replaceCompareVariantsCheckedItems() mutated the existing state object directly instead of creating a new one, preventing React from detecting the state change and potentially causing stale renders. Co-Authored-By: Claude Opus 4.6 --- .../src/component_readiness/CompReadyVars.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sippy-ng/src/component_readiness/CompReadyVars.js b/sippy-ng/src/component_readiness/CompReadyVars.js index 5c51b512d..8f6963237 100644 --- a/sippy-ng/src/component_readiness/CompReadyVars.js +++ b/sippy-ng/src/component_readiness/CompReadyVars.js @@ -189,15 +189,19 @@ export const CompReadyVarsProvider = ({ children }) => { const [includeVariantsCheckedItems, setIncludeVariantsCheckedItems] = useState({}) const replaceIncludeVariantsCheckedItems = (variant, checkedItems) => { - includeVariantsCheckedItems[variant] = checkedItems - setIncludeVariantsCheckedItems(includeVariantsCheckedItems) + setIncludeVariantsCheckedItems({ + ...includeVariantsCheckedItems, + [variant]: checkedItems, + }) } // The list of individual variants (e.g. "Architecture:arm64") that are checked for cross-variant comparison const [compareVariantsCheckedItems, setCompareVariantsCheckedItems] = useState([]) const replaceCompareVariantsCheckedItems = (variant, checkedItems) => { - compareVariantsCheckedItems[variant] = checkedItems - setCompareVariantsCheckedItems(compareVariantsCheckedItems) + setCompareVariantsCheckedItems({ + ...compareVariantsCheckedItems, + [variant]: checkedItems, + }) } // The list of variant groups (e.g. "Architecture") that have been selected for cross-variant comparison const [variantCrossCompare, setVariantCrossCompare] = useState([]) @@ -427,6 +431,13 @@ export const CompReadyVarsProvider = ({ children }) => { setVariantCrossCompare(view.variant_options.variant_cross_compare) if (view.variant_options.hasOwnProperty('compare_variants')) setCompareVariantsCheckedItems(view.variant_options.compare_variants) + if (view.test_filters) { + if (view.test_filters.lifecycles) + setTestLifecycles(view.test_filters.lifecycles) + if (view.test_filters.capabilities) + setTestCapabilities(view.test_filters.capabilities) + } + if (view.advanced_options.hasOwnProperty('confidence')) setConfidence(view.advanced_options.confidence) if (view.advanced_options.hasOwnProperty('pity_factor')) From 54c1db77bce2caecfdf524b8c2eb7b28cf719da6 Mon Sep 17 00:00:00 2001 From: openshift-trt Date: Tue, 30 Jun 2026 03:48:12 +0000 Subject: [PATCH 2/2] TRT-2762: Add capability filtering to PostgreSQL provider and improve seed data The PostgreSQL data provider was not filtering by testCapabilities, causing all capability types (e.g. cap1) to appear even when only specific capabilities (e.g. install) were requested. This adds capability intersection filtering to queryTestStatus(), matching the BigQuery provider's existing behavior. Also adds an azure Platform job and a networking-capability test to seed data so that variant and capability filtering can be tested against data not included in the default view. Co-Authored-By: Claude Opus 4.6 --- cmd/sippy/seed_data.go | 28 +++++++++++++++++-- .../dataprovider/postgres/provider.go | 22 ++++++++++++++- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/cmd/sippy/seed_data.go b/cmd/sippy/seed_data.go index adc6817ed..cf85b296e 100644 --- a/cmd/sippy/seed_data.go +++ b/cmd/sippy/seed_data.go @@ -176,12 +176,23 @@ var syntheticJobs = []syntheticJobDef{ "Suite": "unknown", "Upgrade": "micro", "LayeredProduct": "none", }, }, + // Azure job: Platform:azure is NOT in the default seed view, so results + // from this job should be filtered out when the default view is active. + { + nameTemplate: "periodic-ci-openshift-release-master-ci-%s-e2e-azure-ovn-amd64", + variants: map[string]string{ + "Platform": "azure", "Architecture": "amd64", "Network": "ovn", + "Topology": "ha", "Installer": "ipi", "FeatureSet": "default", + "Suite": "parallel", "Upgrade": "none", "LayeredProduct": "none", + }, + }, } // Job template constants for referencing specific jobs in test specs. const awsAmd64Parallel = "periodic-ci-openshift-release-master-ci-%s-e2e-aws-ovn-amd64" const awsArm64Parallel = "periodic-ci-openshift-release-master-ci-%s-e2e-aws-ovn-arm64" const gcpAmd64Parallel = "periodic-ci-openshift-release-master-ci-%s-e2e-gcp-ovn-amd64" +const azureAmd64Parallel = "periodic-ci-openshift-release-master-ci-%s-e2e-azure-ovn-amd64" // allJobTemplates returns name templates from syntheticJobs for use in test specs // that should run on every job (e.g. install tests). @@ -227,13 +238,15 @@ var syntheticTests = []syntheticTestSpec{ }, // --- ExtremeRegression: extreme on aws/amd64, significant on others --- + // Also runs on azure (not in default view) to test variant filtering. { testID: "test-extreme-regression", testName: "[sig-etcd] etcd leader changes are not excessive", component: "comp-ExtremeRegression", capabilities: []string{"cap1"}, jobCounts: map[string]map[string]testCount{ - awsAmd64Parallel: {"4.21": {200, 190, 0}, "4.22": {200, 140, 0}}, - awsArm64Parallel: {"4.21": {200, 190, 0}, "4.22": {200, 170, 0}}, - gcpAmd64Parallel: {"4.21": {200, 190, 0}, "4.22": {200, 170, 0}}, + awsAmd64Parallel: {"4.21": {200, 190, 0}, "4.22": {200, 140, 0}}, + awsArm64Parallel: {"4.21": {200, 190, 0}, "4.22": {200, 170, 0}}, + gcpAmd64Parallel: {"4.21": {200, 190, 0}, "4.22": {200, 170, 0}}, + azureAmd64Parallel: {"4.21": {200, 190, 0}, "4.22": {200, 140, 0}}, }, }, @@ -331,6 +344,15 @@ var syntheticTests = []syntheticTestSpec{ }, }, + // --- Tests on azure (Platform:azure not in the default view, used to test variant filtering) --- + { + testID: "test-azure-networking", testName: "[sig-network] Azure load balancer should distribute traffic", + component: "comp-AzureNetworking", capabilities: []string{"networking"}, + jobCounts: map[string]map[string]testCount{ + azureAmd64Parallel: {"4.21": {100, 95, 0}, "4.22": {100, 80, 0}}, + }, + }, + // --- Install / health indicator tests: run on every job, every release --- { testID: "test-install-overall", testName: "install should succeed: overall", diff --git a/pkg/api/componentreadiness/dataprovider/postgres/provider.go b/pkg/api/componentreadiness/dataprovider/postgres/provider.go index 3ef5e2281..982c7f3dc 100644 --- a/pkg/api/componentreadiness/dataprovider/postgres/provider.go +++ b/pkg/api/componentreadiness/dataprovider/postgres/provider.go @@ -97,6 +97,15 @@ func matchesIncludeVariants(variants map[string]string, includeVariants map[stri return true } +func hasCapabilityIntersection(testCaps []string, requestedCaps map[string]bool) bool { + for _, c := range testCaps { + if requestedCaps[c] { + return true + } + } + return false +} + // --- MetadataQuerier --- func (p *PostgresProvider) QueryJobVariants(ctx context.Context) (crtest.JobVariants, []error) { @@ -340,7 +349,7 @@ GROUP BY tow.unique_id, t.name, s.name, tow.component, tow.capabilities, d.prow_ func (p *PostgresProvider) queryTestStatus(ctx context.Context, release string, start, end time.Time, _ crtest.JobVariants, includeVariants map[string][]string, - dbGroupBy map[string]bool) (map[string]crstatus.TestStatus, []error) { + dbGroupBy map[string]bool, capabilities []string) (map[string]crstatus.TestStatus, []error) { var rows []testStatusRow if err := p.dbc.DB.WithContext(ctx).Raw(testStatusQuery, release, start, end, release, release, start, end).Scan(&rows).Error; err != nil { @@ -361,6 +370,11 @@ func (p *PostgresProvider) queryTestStatus(ctx context.Context, release string, return nil, []error{err} } + capSet := make(map[string]bool, len(capabilities)) + for _, c := range capabilities { + capSet[c] = true + } + result := map[string]crstatus.TestStatus{} for _, row := range rows { variants, ok := jobVariantMap[row.ProwJobID] @@ -372,6 +386,10 @@ func (p *PostgresProvider) queryTestStatus(ctx context.Context, release string, continue } + if len(capSet) > 0 && !hasCapabilityIntersection(row.Capabilities, capSet) { + continue + } + filtered := filterByDBGroupBy(variants, dbGroupBy) key := crtest.KeyWithVariants{ TestID: row.TestID, @@ -456,6 +474,7 @@ func (p *PostgresProvider) QueryBaseTestStatus(ctx context.Context, reqOptions r allJobVariants, includeVariants, dbGroupBy, + reqOptions.Capabilities, ) } @@ -480,6 +499,7 @@ func (p *PostgresProvider) QuerySampleTestStatus(ctx context.Context, reqOptions allJobVariants, includeVariants, dbGroupBy, + reqOptions.Capabilities, ) }