Skip to content

TRT-2734: switch release consumers from BigQuery to PostgreSQL - #3736

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
mstaeble:TRT-2734-switch-release-consumers
Jul 14, 2026
Merged

TRT-2734: switch release consumers from BigQuery to PostgreSQL#3736
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
mstaeble:TRT-2734-switch-release-consumers

Conversation

@mstaeble

@mstaeble mstaeble commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 2 of TRT-2734. Depends on #3679 (merged). Switches release data consumers from BigQuery to PostgreSQL using a new MixedProvider that routes release queries to PG and everything else to BQ.

What changed

  • Introduce MixedProvider in pkg/api/componentreadiness/dataprovider/mixed/provider.go that deterministically routes: release queries go to PG, everything else to BQ
  • Change --data-provider flag default from "bigquery" to "default" across serve, automate-jira, and component-readiness commands
  • Add shared newDataProvider() factory in cmd/sippy/serve.go that selects the provider based on available backends:
    • Both BQ + PG available: MixedProvider
    • BQ only (e.g., QE component readiness deployment): BigQueryProvider
    • PG only: PostgresProvider
  • Add GetReleaseDatesFromDB to derive CR time ranges from PG GA dates
  • Simplify getReleases() in server.go to s.crDataProvider.QueryReleases(ctx)
  • Remove hardcoded releaseMetadata map from PG provider
  • Switch automatejira, MCP releases tool, and job_runs to use GetReleasesFromDB with BQ fallback
  • Delete dead code: GetReleases(), releaseGenerator from utils.go, TestTransformRelease
  • Drop forceRefresh query parameter parsing from /api/releases (was only used for BQ Redis cache)
  • Fix error messages that referenced specific backends

What stays unchanged

  • BQ provider code (releasedates.go, provider.go) unchanged from main
  • QueryReleases and QueryReleaseDates remain on the DataProvider interface for BQ-only deployments
  • Load command (load.go) unchanged from main

13 files changed, +435/-239

Test plan

  • go build ./... passes
  • go vet ./... passes
  • make lint passes
  • go test ./pkg/... ./cmd/... passes
  • make e2e passes locally (108 tests, 0 failures)
  • CI e2e passes
  • Verified release_definitions table is populated (36 rows in prod since Phase 1 merged)
  • Deployed to staging and verified /api/releases, /api/component_readiness, and /api/component_readiness/regressions endpoints
  • Unit tests for DefinitionToRelease, ReleaseRowToDefinition, nil DB guards, and GetReleaseDatesFromDB

Ref: TRT-2734

Summary by CodeRabbit

  • New Features
    • Added a configurable --data-provider option for release and component-readiness queries, with a new default mode.
    • Enabled automatic “mixed backend” routing where release metadata is served from the most appropriate source.
  • Bug Fixes
    • Standardized release/date retrieval to prefer database-backed queries, with BigQuery fallback where applicable.
    • Simplified/neutralized several endpoint error messages and removed reliance on forced refresh parameters.
  • Tests
    • Added/updated tests for release definition mapping and nil-database error handling.

@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 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 6, 2026
@openshift-ci

openshift-ci Bot commented Jul 6, 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

@mstaeble
mstaeble force-pushed the TRT-2734-switch-release-consumers branch 10 times, most recently from cf40d96 to fbaaf38 Compare July 7, 2026 20:09
@mstaeble

mstaeble commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Release metadata retrieval now uses shared PostgreSQL-backed helpers and configurable data providers. A mixed provider routes release queries to PostgreSQL and component-readiness queries to BigQuery. CLI, server, MCP, job-run, and test paths are updated accordingly.

Changes

Release provider migration

Layer / File(s) Summary
Configurable provider selection
cmd/sippy/automatejira.go, cmd/sippy/component_readiness.go, cmd/sippy/serve.go
Adds --data-provider support and centralizes default, BigQuery, PostgreSQL, and mixed provider selection.
Mixed provider routing
pkg/api/componentreadiness/dataprovider/mixed/provider.go
Routes release metadata to PostgreSQL and other component-readiness queries to BigQuery.
Shared DB release helpers
pkg/api/releases.go, pkg/api/utils.go, pkg/api/componentreadiness/dataprovider/postgres/provider.go
Adds DB-backed release-date conversion, removes the old release retrieval helper, and delegates PostgreSQL provider methods to shared helpers.
Caller and server integration
pkg/api/job_runs.go, pkg/mcp/tools/releases.go, pkg/sippyserver/server.go, test/e2e/componentreadiness/componentreadiness_test.go
Updates release lookup paths, provider-based server handling, fallback behavior, and end-to-end setup.
Release validation
pkg/api/releases_test.go, pkg/dataloader/releasedefloader/releasedefloader_test.go
Adds coverage for release mapping, optional dates and capabilities, and nil database errors.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ServeCommand
  participant newDataProvider
  participant MixedProvider
  participant PostgresProvider
  participant PostgreSQL
  participant BigQueryProvider
  ServeCommand->>newDataProvider: provider configuration
  newDataProvider->>MixedProvider: construct mixed provider
  MixedProvider->>PostgresProvider: QueryReleases
  PostgresProvider->>PostgreSQL: load release metadata
  MixedProvider->>BigQueryProvider: component-readiness queries
Loading

Possibly related PRs

Suggested labels: lgtm

Suggested reviewers: deepsm007, neisw, petr-muller, sosiouxme

🚥 Pre-merge checks | ✅ 18 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Coverage For New Features ⚠️ Warning MixedProvider/newDataProvider lack tests, and GetReleaseDatesFromDB only has nil-DB coverage, not its release-range logic. Add unit tests for MixedProvider routing/newDataProvider selection and a DB-backed GetReleaseDatesFromDB regression test.
Feature Documentation ⚠️ Warning PR changes component-readiness release flow and /api/releases, but no docs/features/ docs were added or updated; only an unrelated job-analysis doc exists. Add/update a feature doc in docs/features/ for the release-data source switch, MixedProvider routing, and endpoint behavior changes.
✅ Passed checks (18 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: release queries are moved from BigQuery to PostgreSQL.
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.
Go Error Handling ✅ Passed New DB-backed release paths add nil guards and wrap query failures; provider selection now returns explicit config errors instead of silently proceeding.
Sql Injection Prevention ✅ Passed Changed DB queries use placeholders/GORM binding; no user input is concatenated into SQL, and the only fmt.Sprintf SQL uses configured table names.
Excessive Css In React Should Use Styles ✅ Passed No React/JSX files or inline style objects were changed; the PR only touches Go code and tests, so this CSS rule is not applicable.
Single Responsibility And Clear Naming ✅ Passed New provider and release helpers are narrowly scoped and clearly named; generic GetReleases/releaseGenerator code was removed.
Stable And Deterministic Test Names ✅ Passed Touched tests use static names only; no Ginkgo titles or dynamic t.Run labels were found.
Test Structure And Quality ✅ Passed No Ginkgo tests were changed; the modified tests are plain Go tests with focused subtests and explicit error messages/skip handling.
Microshift Test Compatibility ✅ Passed PASS: The changed e2e test uses plain testing.T, adds no Ginkgo cases, and references no MicroShift-unsupported OpenShift APIs/features.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the changed e2e test uses testing.T and only API/DB/cache flows, with no multi-node or HA assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed Only release/data-provider and CLI plumbing changed; no manifests, controllers, affinities, node selectors, replicas, or PDBs were introduced.
Ote Binary Stdout Contract ✅ Passed Touched startup paths only use logrus/stderr; no new fmt.Print/os.Stdout writes were added in process-level code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the modified e2e helper uses net.JoinHostPort and cluster-local endpoints, with no hardcoded IPv4 assumptions.
No-Weak-Crypto ✅ Passed No touched files add weak crypto, custom crypto, or secret comparisons; exact-token search over PR files found none.
Container-Privileges ✅ Passed PR touches only Go files; no container/K8s manifests or privilege/securityContext settings were introduced.
No-Sensitive-Data-In-Logs ✅ Passed Changed logging is generic (provider selection and error messages); I found no new logs printing secrets, tokens, PII, hostnames, or customer data.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/sippyserver/metrics/metrics.go (1)

122-129: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Release list should not depend on dbc alone

RefreshMetricsDB still runs with crProvider/bqc enabled when dbc is nil in the component-readiness path, so releases stays empty and CR/disruption metrics lose release metadata. Keep the old trigger or ensure these callers never pass a nil dbc.

🤖 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/sippyserver/metrics/metrics.go` around lines 122 - 129, RefreshMetricsDB
currently gates release loading only on dbc, which leaves releases empty in the
component-readiness path even when crProvider or bqc are enabled. Update the
release-fetching logic in RefreshMetricsDB/GetReleasesFromDB flow so release
metadata is still populated for those callers, either by restoring the previous
trigger condition or by guaranteeing that the readiness callers always supply a
non-nil dbc; use the dbc check, crProvider, bqc, and releases symbols to locate
the fix.
🧹 Nitpick comments (2)
pkg/api/releases.go (1)

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

Magic string "30" for days adjustment.

util.AdjustReleaseTime(*release.GADate, true, "30", ...) hardcodes the day-adjustment as a string that gets re-parsed internally via strconv.ParseInt. Consider a named constant for readability, though this mirrors the existing AdjustReleaseTime signature elsewhere.

🤖 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/releases.go` at line 503, The `AdjustReleaseTime` call in
`releases.go` uses a hardcoded "30" day-adjustment string, which should be
replaced with a named constant for readability and maintainability. Update the
`prior := util.AdjustReleaseTime(...)` usage to reference a descriptive constant
defined near the release-time logic or shared with other callers, while keeping
the existing `AdjustReleaseTime` signature unchanged.
cmd/sippy/automatejira.go (1)

155-162: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

DB client now created before option validation and other client setup.

dbc is now acquired at Line 155, ahead of jiraClient (Line 164), GetJobVariants (Line 173), GetVariantJiraMap (Line 177), and f.Validate (Line 181). If any of these later steps fail, a Postgres connection was opened unnecessarily. Low impact since the process exits shortly after via return/panic, but worth noting as the DB client acquisition moved earlier in the flow compared to before.

🤖 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 `@cmd/sippy/automatejira.go` around lines 155 - 162, The Postgres client in the
automateJira flow is being opened too early in the setup sequence, before
validation and the other client/map initialization steps. Move the dbc
acquisition in automateJira so it happens after jiraClient, GetJobVariants,
GetVariantJiraMap, and f.Validate succeed, and keep the existing error handling
around GetDBClient and GetReleasesFromDB intact.
🤖 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/api/componentreadiness/component_report.go`:
- Around line 281-283: `NewReleaseFallbackMiddleware` is being registered even
when `c.dbc` is nil, which leaves `QueryTestDetails()` able to hit
`GetReleaseDatesFromDB()` and panic via `GetReleasesFromDB()` on `dbc.DB`.
Update the middleware setup in `component_report.go` so the `releasefallback`
path is only added when `c.dbc` is non-nil, matching the existing
`regressiontracker` guard; alternatively, ensure the multi-release analysis
branch is skipped when `dbc` is unavailable.

In `@pkg/api/componentreadiness/middleware/releasefallback/releasefallback.go`:
- Around line 200-202: Guard the fallback DB lookup in ReleaseFallback when dbc
may be nil, since api.GetReleaseDatesFromDB and its call path into
GetReleasesFromDB dereference dbc.DB directly and can panic. Update the
ReleaseFallback middleware flow to either skip the DB-backed fallback path when
r.dbc is nil or enforce a non-nil DB in the ReleaseFallback constructor, and
make sure the handling around GetReleaseDatesFromDB uses the chosen safeguard
consistently.

In `@pkg/sippyserver/server.go`:
- Around line 903-906: The error handling in the BigQuery-backed handler uses
misleading “database” wording even though this path still calls
api.GetTestRunsAndOutputsFromBigQuery with s.bigQueryClient. Update the log and
failure response in this branch to consistently mention BigQuery instead of
database so the messages match the actual data source and are easier to debug.

---

Outside diff comments:
In `@pkg/sippyserver/metrics/metrics.go`:
- Around line 122-129: RefreshMetricsDB currently gates release loading only on
dbc, which leaves releases empty in the component-readiness path even when
crProvider or bqc are enabled. Update the release-fetching logic in
RefreshMetricsDB/GetReleasesFromDB flow so release metadata is still populated
for those callers, either by restoring the previous trigger condition or by
guaranteeing that the readiness callers always supply a non-nil dbc; use the dbc
check, crProvider, bqc, and releases symbols to locate the fix.

---

Nitpick comments:
In `@cmd/sippy/automatejira.go`:
- Around line 155-162: The Postgres client in the automateJira flow is being
opened too early in the setup sequence, before validation and the other
client/map initialization steps. Move the dbc acquisition in automateJira so it
happens after jiraClient, GetJobVariants, GetVariantJiraMap, and f.Validate
succeed, and keep the existing error handling around GetDBClient and
GetReleasesFromDB intact.

In `@pkg/api/releases.go`:
- Line 503: The `AdjustReleaseTime` call in `releases.go` uses a hardcoded "30"
day-adjustment string, which should be replaced with a named constant for
readability and maintainability. Update the `prior :=
util.AdjustReleaseTime(...)` usage to reference a descriptive constant defined
near the release-time logic or shared with other callers, while keeping the
existing `AdjustReleaseTime` signature unchanged.
🪄 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: 14a3eb5d-fa70-446a-a9a6-3563023e2dc0

📥 Commits

Reviewing files that changed from the base of the PR and between 801c5d3 and fbaaf38.

📒 Files selected for processing (18)
  • cmd/sippy/automatejira.go
  • cmd/sippy/load.go
  • cmd/sippy/seed_data.go
  • pkg/api/componentreadiness/component_report.go
  • pkg/api/componentreadiness/dataprovider/bigquery/provider.go
  • pkg/api/componentreadiness/dataprovider/bigquery/releasedates.go
  • pkg/api/componentreadiness/dataprovider/interface.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
  • pkg/api/componentreadiness/middleware/releasefallback/releasefallback.go
  • pkg/api/componentreadiness/middleware/releasefallback/releasefallback_test.go
  • pkg/api/componentreadiness/test_details.go
  • pkg/api/job_runs.go
  • pkg/api/releases.go
  • pkg/api/releases_test.go
  • pkg/api/utils.go
  • pkg/mcp/tools/releases.go
  • pkg/sippyserver/metrics/metrics.go
  • pkg/sippyserver/server.go
💤 Files with no reviewable changes (6)
  • pkg/api/componentreadiness/dataprovider/bigquery/releasedates.go
  • pkg/api/componentreadiness/dataprovider/interface.go
  • pkg/api/releases_test.go
  • pkg/api/componentreadiness/dataprovider/bigquery/provider.go
  • pkg/api/utils.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go

Comment thread pkg/api/componentreadiness/component_report.go Outdated
Comment thread pkg/api/componentreadiness/middleware/releasefallback/releasefallback.go Outdated
Comment thread pkg/sippyserver/server.go Outdated
@mstaeble
mstaeble force-pushed the TRT-2734-switch-release-consumers branch 2 times, most recently from f99e94d to d260205 Compare July 7, 2026 21:17
@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 7, 2026
@mstaeble mstaeble changed the title [WIP] Switch release consumers from BigQuery to PostgreSQL TRT-2734: switch release consumers from BigQuery to PostgreSQL Jul 7, 2026
@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 7, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 7, 2026

Copy link
Copy Markdown

@mstaeble: This pull request references TRT-2734 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

Depends on #3679 (merged). Switch all release data consumers to read from the release_definitions table in PostgreSQL.

  • getReleases() in server.go reads exclusively from PG
  • Remove QueryReleases and QueryReleaseDates from the DataProvider interface and both implementations
  • GetComponentReport, RefreshMetricsDB, and syncRegressions call GetReleasesFromDB directly
  • Add GetReleaseDatesFromDB to derive CR time ranges from PG GA dates
  • Update releasefallback and test_details to use GetReleaseDatesFromDB
  • Switch automatejira, MCP releases tool, and job_runs to use PG
  • Delete BQ releasedates.go
  • Remove hardcoded releaseMetadata map from PG provider
  • Fix stale "from big query" error messages in server.go
  • 15 files changed, +81/-212

Test plan

  • go build ./... passes
  • go test ./pkg/... ./cmd/... passes
  • Verify release_definitions table is populated before deploying (Phase 1 must have run at least one load cycle)
  • Verify /api/releases returns data from PostgreSQL after deployment

Ref: TRT-2734

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

  • Release-related views and tools now load data from the database more consistently, improving stability and reducing reliance on alternate sources.

  • Bug Fixes

  • Fixed several report and analysis paths so release dates and fallback behavior are computed from the same data source.

  • Updated error messages in some report flows to better reflect database-based lookups.

  • Improved handling for release queries in metrics, test details, job risk analysis, and release reports.

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.

@mstaeble
mstaeble marked this pull request as ready for review July 7, 2026 21:28
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 7, 2026
@openshift-ci
openshift-ci Bot requested review from deepsm007 and sosiouxme July 7, 2026 21:31
@mstaeble
mstaeble force-pushed the TRT-2734-switch-release-consumers branch from d260205 to afe29a0 Compare July 7, 2026 23:20
@mstaeble mstaeble changed the title [WIP] TRT-2734: switch release consumers from BigQuery to PostgreSQL TRT-2734: switch release consumers from BigQuery to PostgreSQL Jul 13, 2026
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 13, 2026
@openshift-ci
openshift-ci Bot requested review from neisw and petr-muller July 13, 2026 12:40
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@mstaeble

Copy link
Copy Markdown
Contributor Author

/test e2e

@mstaeble
mstaeble force-pushed the TRT-2734-switch-release-consumers branch from 71baa65 to 9a59c4e Compare July 14, 2026 03:11
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@mstaeble
mstaeble force-pushed the TRT-2734-switch-release-consumers branch from 9a59c4e to 393e724 Compare July 14, 2026 04:19
@mstaeble

Copy link
Copy Markdown
Contributor Author

/test security

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@mstaeble

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

@neisw

neisw commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jul 14, 2026
mstaeble and others added 2 commits July 14, 2026 16:51
Switch release data consumers to prefer PostgreSQL when available,
falling back to BigQuery for deployments without a database (e.g., the
QE component readiness deployment).

Key changes:
- getReleases() in server.go prefers PG, falls back to BQ
- GetComponentReport and RefreshMetricsDB try GetReleasesFromDB first,
  fall back to provider.QueryReleases for BQ-only deployments
- QueryReleases stays on the DataProvider interface for BQ-only
  deployments; PG provider delegates to GetReleasesFromDB, BQ provider
  converts via ReleaseRowToDefinition
- Remove hardcoded releaseMetadata map from PG provider
- Add GetReleaseDatesFromDB to derive CR time ranges from PG
- Update releasefallback and test_details to use GetReleaseDatesFromDB
- Switch automatejira, MCP releases tool, and job_runs to use PG
- Delete BQ releasedates.go
- Remove QueryReleaseDates from the DataProvider interface
- Fix stale error messages referencing specific backends

Ref: TRT-2734

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mstaeble
mstaeble force-pushed the TRT-2734-switch-release-consumers branch from 393e724 to deccd39 Compare July 14, 2026 20:52
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2026
@mstaeble

Copy link
Copy Markdown
Contributor Author

Had to rebase to resolve merge conflicts from #3773.

@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.

🧹 Nitpick comments (1)
pkg/api/releases.go (1)

41-42: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add missing return statements for nil DB checks.

While you are updating the error handling in these functions, please fix an existing bug: the dbClient == nil || dbClient.DB == nil guard clauses at the top of these functions are missing a return statement. If the database client is nil, the functions will write an empty response but then fall through and panic when dbClient.DB is dereferenced a few lines later.

  • pkg/api/releases.go#L41-L42: Add a return statement after RespondWithJSON(http.StatusOK, w, []struct{}{}) at line 35 in PrintPullRequestsReport.
  • pkg/api/releases.go#L337-L338: Add a return statement after RespondWithJSON(http.StatusOK, w, []struct{}{}) at line 333 in PrintReleasesReport.
🤖 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/releases.go` around lines 41 - 42, The nil database guards in
PrintPullRequestsReport and PrintReleasesReport must stop execution after
sending the empty successful response. Add a return immediately after each
RespondWithJSON(http.StatusOK, w, []struct{}{}) call; apply this at
pkg/api/releases.go lines 41-42 and 337-338.
🤖 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.

Nitpick comments:
In `@pkg/api/releases.go`:
- Around line 41-42: The nil database guards in PrintPullRequestsReport and
PrintReleasesReport must stop execution after sending the empty successful
response. Add a return immediately after each RespondWithJSON(http.StatusOK, w,
[]struct{}{}) call; apply this at pkg/api/releases.go lines 41-42 and 337-338.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 637bc2a6-2d20-47d4-a1cb-d5335bb40b5e

📥 Commits

Reviewing files that changed from the base of the PR and between ac48a8c and deccd39.

📒 Files selected for processing (13)
  • cmd/sippy/automatejira.go
  • cmd/sippy/component_readiness.go
  • cmd/sippy/serve.go
  • pkg/api/componentreadiness/dataprovider/mixed/provider.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
  • pkg/api/job_runs.go
  • pkg/api/releases.go
  • pkg/api/releases_test.go
  • pkg/api/utils.go
  • pkg/dataloader/releasedefloader/releasedefloader_test.go
  • pkg/mcp/tools/releases.go
  • pkg/sippyserver/server.go
  • test/e2e/componentreadiness/componentreadiness_test.go
💤 Files with no reviewable changes (1)
  • pkg/api/utils.go
🚧 Files skipped from review as they are similar to previous changes (10)
  • pkg/dataloader/releasedefloader/releasedefloader_test.go
  • pkg/mcp/tools/releases.go
  • pkg/api/componentreadiness/dataprovider/mixed/provider.go
  • test/e2e/componentreadiness/componentreadiness_test.go
  • pkg/api/job_runs.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
  • cmd/sippy/automatejira.go
  • pkg/sippyserver/server.go
  • pkg/api/releases_test.go
  • cmd/sippy/component_readiness.go

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@neisw

neisw commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2026
@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mstaeble, neisw

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

The pull request process is described 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

@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@mstaeble: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 3eab169 into openshift:main Jul 14, 2026
10 checks passed
@mstaeble
mstaeble deleted the TRT-2734-switch-release-consumers branch July 14, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. 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.

3 participants