Skip to content

[WIP] TRT-2741: Add per-request BQ/PG toggle for Component Readiness#3797

Draft
mstaeble wants to merge 2 commits into
openshift:mainfrom
mstaeble:trt-2741-phase3
Draft

[WIP] TRT-2741: Add per-request BQ/PG toggle for Component Readiness#3797
mstaeble wants to merge 2 commits into
openshift:mainfrom
mstaeble:trt-2741-phase3

Conversation

@mstaeble

@mstaeble mstaeble commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a dataSource URL parameter (bigquery or postgres) to Component Readiness endpoints, allowing per-request selection of the data backend
  • Implements SQL push-down for PG sample and base queries using prefix-sum tables and pre-computed GA data, replacing the previous Go-side filtering approach
  • Introduces variant group mapping to aggregate results by DBGroupBy dimensions in SQL rather than in Go
  • Adds placeholder (existence) queries so grid cells with data but no failures show NotSignificant instead of being absent
  • Routes GA-aligned base queries to prow_ga_raw_test_data for performance, falling back to prefix-sum for non-GA windows (cross-compare views, custom date ranges)
  • Propagates dataSource through HATEOAS test details links so drill-down stays on the selected backend
  • Aligns frontend default base window to 30 days (matching ga-30d view config) so the PG GA optimization path is hit
  • Adds UI toggle (cookie-based) for switching between BigQuery and Postgres backends

Test plan

  • make lint passes
  • make test passes (Go + Jest)
  • make e2e passes
  • Validated standard views (e.g. 4.18) produce matching results between BQ and PG against staging DB
  • Validated cross-compare views (e.g. 4.18-ha-vs-single) work with dataSource=postgres
  • Verified GA optimization path is used for aligned base windows (check server logs)
  • Verified prefix-sum fallback is used for non-GA windows
  • Manual browser testing of the data source toggle in the UI
  • Verify HATEOAS links include dataSource when set

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Component Readiness now supports selecting BigQuery or PostgreSQL as the data source.
    • Data-source selection is preserved in report, test-details, and job-variant links.
    • PostgreSQL-backed readiness reports include variant-aware filtering and regression matching.
  • Bug Fixes

    • Improved consistency of test and variant identifiers across reports and links.
    • Regression lookups and report generation are more efficient and reliable.
  • UI Updates

    • Updated date presets from “Last 4 weeks” to “Last 30 days,” including revised GA-relative labels.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 21, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 21, 2026

Copy link
Copy Markdown

@mstaeble: This pull request references TRT-2741 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Adds a dataSource URL parameter (bigquery or postgres) to Component Readiness endpoints, allowing per-request selection of the data backend
  • Implements SQL push-down for PG sample and base queries using prefix-sum tables and pre-computed GA data, replacing the previous Go-side filtering approach
  • Introduces variant group mapping to aggregate results by DBGroupBy dimensions in SQL rather than in Go
  • Adds placeholder (existence) queries so grid cells with data but no failures show NotSignificant instead of being absent
  • Routes GA-aligned base queries to prow_ga_raw_test_data for performance, falling back to prefix-sum for non-GA windows (cross-compare views, custom date ranges)
  • Propagates dataSource through HATEOAS test details links so drill-down stays on the selected backend
  • Aligns frontend default base window to 30 days (matching ga-30d view config) so the PG GA optimization path is hit
  • Adds UI toggle (cookie-based) for switching between BigQuery and Postgres backends

Test plan

  • make lint passes
  • make test passes (Go + Jest)
  • make e2e passes
  • Validated standard views (e.g. 4.18) produce matching results between BQ and PG against staging DB
  • Validated cross-compare views (e.g. 4.18-ha-vs-single) work with dataSource=postgres
  • Verified GA optimization path is used for aligned base windows (check server logs)
  • Verified prefix-sum fallback is used for non-GA windows
  • Manual browser testing of the data source toggle in the UI
  • Verify HATEOAS links include dataSource when set

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 21, 2026
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mstaeble
Once this PR has been reviewed and has the lgtm label, please assign smg247 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@mstaeble, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: c4040d1c-bf1b-4b5a-864a-f7184c2992ac

📥 Commits

Reviewing files that changed from the base of the PR and between f4914b0 and 0ee6ce4.

📒 Files selected for processing (36)
  • cmd/sippy/annotatejobruns.go
  • cmd/sippy/automatejira.go
  • pkg/api/componentreadiness/component_report.go
  • pkg/api/componentreadiness/component_report_test.go
  • pkg/api/componentreadiness/dataprovider/bigquery/provider.go
  • pkg/api/componentreadiness/dataprovider/bigquery/querygenerators.go
  • pkg/api/componentreadiness/dataprovider/interface.go
  • pkg/api/componentreadiness/dataprovider/mixed/provider.go
  • pkg/api/componentreadiness/dataprovider/postgres/cr_queries.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
  • pkg/api/componentreadiness/dataprovider/postgres/variants.go
  • pkg/api/componentreadiness/middleware/linkinjector/linkinjector.go
  • pkg/api/componentreadiness/middleware/regressiontracker/regressiontracker.go
  • pkg/api/componentreadiness/middleware/regressiontracker/regressiontracker_test.go
  • pkg/api/componentreadiness/middleware/releasefallback/releasefallback.go
  • pkg/api/componentreadiness/middleware/releasefallback/releasefallback_test.go
  • pkg/api/componentreadiness/queryparamparser_test.go
  • pkg/api/componentreadiness/regressiontracker.go
  • pkg/api/componentreadiness/test_details.go
  • pkg/api/componentreadiness/triage.go
  • pkg/api/componentreadiness/utils/queryparamparser.go
  • pkg/api/componentreadiness/utils/utils.go
  • pkg/api/componentreadiness/utils/utils_test.go
  • pkg/apis/api/componentreport/crstatus/types.go
  • pkg/apis/api/componentreport/crtest/types.go
  • pkg/apis/api/componentreport/crtest/types_test.go
  • pkg/apis/api/componentreport/reqopts/types.go
  • pkg/dataloader/gateststatus/loader.go
  • pkg/db/models/prow.go
  • pkg/sippyserver/server.go
  • pkg/util/param/param.go
  • sippy-ng/src/component_readiness/CompReadyUtils.js
  • sippy-ng/src/component_readiness/CompReadyVars.js
  • sippy-ng/src/component_readiness/ComponentReadiness.js
  • sippy-ng/src/component_readiness/ComponentReadinessIndicator.js
  • sippy-ng/src/component_readiness/ReleaseSelector.js

Walkthrough

Component Readiness now supports deterministic identifier encoding, request-scoped BigQuery/PostgreSQL routing, PostgreSQL status aggregation, indexed regression matching, data-source-aware URLs, and 30-day frontend date presets.

Changes

Component Readiness data flow

Layer / File(s) Summary
Contracts and deterministic identifiers
pkg/apis/api/componentreport/..., pkg/api/componentreadiness/component_report.go, pkg/api/componentreadiness/utils/..., pkg/api/componentreadiness/middleware/releasefallback/...
TestStatus stores explicit test IDs and variant maps; key and column identifiers use deterministic encodings instead of JSON serialization.
Request-scoped provider routing
pkg/apis/api/componentreport/reqopts/..., pkg/api/componentreadiness/dataprovider/..., pkg/sippyserver/server.go, cmd/sippy/...
dataSource request options flow through job-variant queries, provider selection, HTTP handlers, and command callers.
PostgreSQL status aggregation
pkg/api/componentreadiness/dataprovider/postgres/*, pkg/dataloader/gateststatus/loader.go, pkg/db/models/prow.go
PostgreSQL queries add variant grouping, prefix-sum aggregation, GA-window handling, failure/existence merging, and cross-compare variant support.
Indexed regression matching
pkg/api/componentreadiness/middleware/regressiontracker/*, pkg/api/componentreadiness/regressiontracker.go
Open regressions are indexed by test ID and matched using release, cross-compare, and subset-variant criteria.
Frontend routing and date controls
sippy-ng/src/component_readiness/*, sippy-ng/src/component_readiness/ReleaseSelector.js
Frontend requests propagate cookie-selected data sources and update component-readiness date presets to 30-day windows.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ComponentReadiness as ComponentReadiness
  participant SippyServer as sippyserver
  participant MixedProvider as MixedProvider
  participant PostgresProvider as PostgresProvider
  ComponentReadiness->>SippyServer: send dataSource query parameter
  SippyServer->>MixedProvider: pass request options
  MixedProvider->>PostgresProvider: route PostgreSQL request
  PostgresProvider-->>SippyServer: return aggregated report data
  SippyServer-->>ComponentReadiness: return Component Readiness response
Loading

Suggested reviewers: sosiouxme, smg247, dgoodwin

🚥 Pre-merge checks | ✅ 17 | ❌ 4

❌ Failed checks (4 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Go Error Handling ⚠️ Warning server.go still drops GetJobVariants errs and rethrows failures with %v/no %w, so the underlying cause is lost. Join/propagate the returned errors and use fmt.Errorf(...: %w, err) (or errors.Join) so callers keep the original context.
Test Coverage For New Features ⚠️ Warning The new PG helper code has no package tests, and the new component-readiness UI logic is only covered by CompReadyUtils.test.js. Add unit tests for the pure postgres helpers/query builders and frontend tests for ComponentReadinessIndicator, CompReadyVars, and ReleaseSelector behavior.
Feature Documentation ⚠️ Warning No docs/features entry was added for the new Component Readiness dataSource/backend-routing changes; the only feature doc is unrelated. Add or update a docs/features Component Readiness doc covering dataSource routing, PG/BQ backend selection, and the 30-day GA behavior.
✅ Passed checks (17 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Sql Injection Prevention ✅ Passed Modified SQL paths use bind args for user values; concatenated fragments are static SQL templates or generated IDs, not raw input.
Excessive Css In React Should Use Styles ✅ Passed The PR’s React changes are request-routing/window updates; I found no new large inline style objects or expanded JSX style blobs in the touched files.
Single Responsibility And Clear Naming ✅ Passed Touched APIs stay cohesive: new helpers are narrowly named, core structs remain small, and the PR splits PG query logic into focused helper functions.
Stable And Deterministic Test Names ✅ Passed No Ginkgo-style titles were added in changed test files; all test names are static Go test functions or encode/decode tests.
Test Structure And Quality ✅ Passed No touched tests use Ginkgo/Gomega; the changed Go tests are ordinary unit tests with no cluster waits or cleanup issues.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e specs were added in the PR; changed test files are unit tests and contain no MicroShift-unsupported APIs/features.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Changed test files are plain Go unit tests; no Ginkgo e2e specs or SNO-sensitive assumptions were added.
Topology-Aware Scheduling Compatibility ✅ Passed No manifests/controllers were added; touched files are API/frontend code only, and searches found no pod-affinity, nodeSelector, or topology-specific scheduling logic.
Ote Binary Stdout Contract ✅ Passed No changed entrypoint/init/suite code writes to os.Stdout; the only fmt.Fprintf hit in server.go targets http.ResponseWriter.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the touched tests are unit tests, and I found no IPv4 or public-network assumptions in them.
No-Weak-Crypto ✅ Passed Changed code only adds string encoding/URL/variant matching; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB or secret-compare paths were introduced.
Container-Privileges ✅ Passed No changed files or repo manifests set privileged/hostPID/hostNetwork/hostIPC/SYS_ADMIN/allowPrivilegeEscalation or runAsUser:0.
No-Sensitive-Data-In-Logs ✅ Passed PASS: The touched code only threads dataSource and updates URL/key encoding; I found no newly added logs exposing secrets/PII, and the new error paths are generic.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: a per-request BigQuery/PostgreSQL toggle for Component Readiness.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
pkg/api/componentreadiness/dataprovider/postgres/provider.go (1)

224-245: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Silently swallowed DB error in baseMatchesGAWindow hides real failures.

Any error from the Pluck query (not just "no GA date yet") causes a silent return false, permanently falling back to the slower prefix-sum path with no log signal. Since this optimization is a core goal of this PR, a genuine query/connectivity failure here would be indistinguishable from "release isn't GA yet."

♻️ Suggested fix
 	var gaDate *time.Time
 	err := p.dbc.DB.WithContext(ctx).
 		Model(&models.ReleaseDefinition{}).
 		Where("release = ? AND ga_date < CURRENT_DATE", reqOptions.BaseRelease.Name).
 		Pluck("ga_date", &gaDate).Error
-	if err != nil || gaDate == nil {
+	if err != nil {
+		log.WithError(err).Warn("failed to query GA date for base release, falling back to prefix-sum query")
+		return false
+	}
+	if gaDate == nil {
 		return false
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/api/componentreadiness/dataprovider/postgres/provider.go` around lines
224 - 245, Update PostgresProvider.baseMatchesGAWindow to distinguish a genuine
database query failure from a missing GA date: log the Pluck error with relevant
release context before returning false, while retaining the existing false
result for nil gaDate and non-matching windows.
pkg/api/componentreadiness/middleware/regressiontracker/regressiontracker_test.go (1)

375-390: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Pull common tracker initialization out of the conditional branches.

Since both branches build the index and set the hasLoadedRegressions flag in the exact same way based on mw.openRegressions, you can pull those assignments out to simplify the setup.

♻️ Proposed refactor
 			if tt.hasOpenRegression {
 				openRegression := &models.TestRegression{
 					ID:       1,
 					Release:  sampleRelease,
 					TestID:   testKey.TestID,
 					TestName: testKey.TestName,
 					Variants: variantsStrSlice,
 					Opened:   time.Now().UTC().Add(-5 * 24 * time.Hour),
 					Closed:   sql.NullTime{Valid: false},
 				}
 				mw.openRegressions = []*models.TestRegression{openRegression}
-				mw.regressionsByTestID = BuildRegressionIndex(mw.openRegressions)
-				mw.hasLoadedRegressions = true
 			} else {
 				mw.openRegressions = []*models.TestRegression{}
-				mw.regressionsByTestID = BuildRegressionIndex(mw.openRegressions)
-				mw.hasLoadedRegressions = true
 			}
+			mw.regressionsByTestID = BuildRegressionIndex(mw.openRegressions)
+			mw.hasLoadedRegressions = true
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@pkg/api/componentreadiness/middleware/regressiontracker/regressiontracker_test.go`
around lines 375 - 390, Refactor the conditional setup around mw.openRegressions
so each branch only assigns the appropriate regression slice; after the
conditional, call BuildRegressionIndex once using mw.openRegressions and set
hasLoadedRegressions once.
pkg/api/componentreadiness/regressiontracker.go (1)

295-297: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Hoist loop-invariant crossCompare evaluation.

The crossCompare boolean is derived solely from view.VariantOptions, which does not change during the loop. Consider hoisting this check outside the loop to avoid redundant evaluations.

♻️ Proposed refactor
+	crossCompare := len(view.VariantOptions.VariantCrossCompare) > 0
 	for _, regTest := range allRegressedTests {
-		crossCompare := len(view.VariantOptions.VariantCrossCompare) > 0
 		if openReg := regressiontracker.FindOpenRegression(view.SampleRelease.Name, regTest.TestID, crossCompare, regTest.Variants, regressionIndex); openReg != nil {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/api/componentreadiness/regressiontracker.go` around lines 295 - 297, Move
the crossCompare assignment out of the allRegressedTests loop so
len(view.VariantOptions.VariantCrossCompare) is evaluated once before iteration.
Keep the existing value and pass the hoisted crossCompare variable unchanged to
regressiontracker.FindOpenRegression.
sippy-ng/src/component_readiness/CompReadyVars.js (1)

461-462: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

dataSource query param built via raw string concatenation in three places instead of the required URL-encoding helper. Path instructions for sippy-ng/**/*.js state that new Component Readiness query parameters like dataSource should be encoded via safeEncodeURIComponent/single/multiple/multiple_or, but all three sites manually splice the value into the URL string.

  • sippy-ng/src/component_readiness/CompReadyVars.js#L461-L462: replace `?dataSource=${dataSource}` with safeEncodeURIComponent(dataSource) (or route through the shared helper used elsewhere) before appending to the job-variants URL.
  • sippy-ng/src/component_readiness/ComponentReadiness.js#L313-L315: replace '&dataSource=' + varsContext.dataSource with an encoded equivalent, e.g. '&dataSource=' + safeEncodeURIComponent(varsContext.dataSource).
  • sippy-ng/src/component_readiness/ComponentReadinessIndicator.js#L61-L72: replace `&dataSource=${dataSource}` with an encoded equivalent, e.g. `&dataSource=${safeEncodeURIComponent(dataSource)}`.

Today dataSource only ever takes the value ''/'postgres' (from the cookie), so there's no live injection risk, but this deviates from the documented pattern for consistency.

As per path instructions, "When constructing query-string URLs/filters for Component Readiness (including any new parameters like dataSource), use the provided URL-encoding helpers (safeEncodeURIComponent, single, multiple, multiple_or) so values are encoded consistently."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@sippy-ng/src/component_readiness/CompReadyVars.js` around lines 461 - 462,
Encode the dataSource query parameter consistently at all three sites: in
sippy-ng/src/component_readiness/CompReadyVars.js lines 461-462, update the
job-variants URL construction to use safeEncodeURIComponent; in
sippy-ng/src/component_readiness/ComponentReadiness.js lines 313-315, encode
varsContext.dataSource before appending it; and in
sippy-ng/src/component_readiness/ComponentReadinessIndicator.js lines 61-72,
encode dataSource before interpolation. Use the existing URL-encoding helper and
preserve the surrounding URL construction.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/sippyserver/server.go`:
- Around line 1108-1112: The GetJobVariants error paths discard the returned
errs context. Update both error sites in pkg/sippyserver/server.go (lines
1108-1112 and 1161-1166): include errs in the fmt.Errorf message at the first
site and in the fmt.Errorf call inside failureResponseWithError at the second
site, preserving the existing error handling behavior.

In `@sippy-ng/src/component_readiness/ReleaseSelector.js`:
- Around line 335-339: The “Last 30 days” toggle still uses the numeric Filter4
icon, which conflicts with its label. Update the icon rendered in the
ToggleButton using set4Weeks to a non-numeric or generic calendar icon, while
leaving the internal fourWeeksStart/set4Weeks names unchanged.

---

Nitpick comments:
In `@pkg/api/componentreadiness/dataprovider/postgres/provider.go`:
- Around line 224-245: Update PostgresProvider.baseMatchesGAWindow to
distinguish a genuine database query failure from a missing GA date: log the
Pluck error with relevant release context before returning false, while
retaining the existing false result for nil gaDate and non-matching windows.

In
`@pkg/api/componentreadiness/middleware/regressiontracker/regressiontracker_test.go`:
- Around line 375-390: Refactor the conditional setup around mw.openRegressions
so each branch only assigns the appropriate regression slice; after the
conditional, call BuildRegressionIndex once using mw.openRegressions and set
hasLoadedRegressions once.

In `@pkg/api/componentreadiness/regressiontracker.go`:
- Around line 295-297: Move the crossCompare assignment out of the
allRegressedTests loop so len(view.VariantOptions.VariantCrossCompare) is
evaluated once before iteration. Keep the existing value and pass the hoisted
crossCompare variable unchanged to regressiontracker.FindOpenRegression.

In `@sippy-ng/src/component_readiness/CompReadyVars.js`:
- Around line 461-462: Encode the dataSource query parameter consistently at all
three sites: in sippy-ng/src/component_readiness/CompReadyVars.js lines 461-462,
update the job-variants URL construction to use safeEncodeURIComponent; in
sippy-ng/src/component_readiness/ComponentReadiness.js lines 313-315, encode
varsContext.dataSource before appending it; and in
sippy-ng/src/component_readiness/ComponentReadinessIndicator.js lines 61-72,
encode dataSource before interpolation. Use the existing URL-encoding helper and
preserve the surrounding URL construction.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: fbe2a5de-4b74-4eb1-b1d8-3e9fe1b03826

📥 Commits

Reviewing files that changed from the base of the PR and between de6d177 and f4914b0.

📒 Files selected for processing (36)
  • cmd/sippy/annotatejobruns.go
  • cmd/sippy/automatejira.go
  • pkg/api/componentreadiness/component_report.go
  • pkg/api/componentreadiness/component_report_test.go
  • pkg/api/componentreadiness/dataprovider/bigquery/provider.go
  • pkg/api/componentreadiness/dataprovider/bigquery/querygenerators.go
  • pkg/api/componentreadiness/dataprovider/interface.go
  • pkg/api/componentreadiness/dataprovider/mixed/provider.go
  • pkg/api/componentreadiness/dataprovider/postgres/cr_queries.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
  • pkg/api/componentreadiness/dataprovider/postgres/variants.go
  • pkg/api/componentreadiness/middleware/linkinjector/linkinjector.go
  • pkg/api/componentreadiness/middleware/regressiontracker/regressiontracker.go
  • pkg/api/componentreadiness/middleware/regressiontracker/regressiontracker_test.go
  • pkg/api/componentreadiness/middleware/releasefallback/releasefallback.go
  • pkg/api/componentreadiness/middleware/releasefallback/releasefallback_test.go
  • pkg/api/componentreadiness/queryparamparser_test.go
  • pkg/api/componentreadiness/regressiontracker.go
  • pkg/api/componentreadiness/test_details.go
  • pkg/api/componentreadiness/triage.go
  • pkg/api/componentreadiness/utils/queryparamparser.go
  • pkg/api/componentreadiness/utils/utils.go
  • pkg/api/componentreadiness/utils/utils_test.go
  • pkg/apis/api/componentreport/crstatus/types.go
  • pkg/apis/api/componentreport/crtest/types.go
  • pkg/apis/api/componentreport/crtest/types_test.go
  • pkg/apis/api/componentreport/reqopts/types.go
  • pkg/dataloader/gateststatus/loader.go
  • pkg/db/models/prow.go
  • pkg/sippyserver/server.go
  • pkg/util/param/param.go
  • sippy-ng/src/component_readiness/CompReadyUtils.js
  • sippy-ng/src/component_readiness/CompReadyVars.js
  • sippy-ng/src/component_readiness/ComponentReadiness.js
  • sippy-ng/src/component_readiness/ComponentReadinessIndicator.js
  • sippy-ng/src/component_readiness/ReleaseSelector.js

Comment thread pkg/sippyserver/server.go
Comment thread sippy-ng/src/component_readiness/ReleaseSelector.js Outdated
@mstaeble mstaeble changed the title TRT-2741: Add per-request BQ/PG toggle for Component Readiness [WIP] TRT-2741: Add per-request BQ/PG toggle for Component Readiness Jul 21, 2026
@mstaeble
mstaeble force-pushed the trt-2741-phase3 branch 2 times, most recently from 520e911 to a5e464f Compare July 21, 2026 16:43
@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Jul 21, 2026
Add a dataSource URL parameter that lets users switch Component
Readiness between BigQuery and PostgreSQL on a per-request basis.
The PostgreSQL path uses prefix-sum queries on test_cumulative_summaries
for the sample period and query-time aggregation of prow_ga_raw_test_data
for the GA base period.

Key changes:
- Wire dataSource parameter through API to select BigQuery or Postgres provider
- Implement prefix-sum sample queries and GA base queries in Postgres
- Optimize Go-side processing: replace JSON key serialization with fast
  null-byte encoding, add regression index for O(1) lookups
- Remove unused prow_ga_test_statuses_matview (sample query dominates
  wall-clock time, so matview provides no visible speedup)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ested runs

The modified_time partition-pruning filter on the junit table was using
the exact @From/@to range, excluding test runs where BQ ingestion
lagged behind prowjob_start by up to a day. Add a 1-day buffer on each
side so the prowjob_start JOIN remains the authoritative date gate while
partition pruning still limits scanned data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants