Skip to content

Move release metadata from BigQuery to PostgreSQL#3679

Open
mstaeble wants to merge 1 commit into
openshift:mainfrom
mstaeble:TRT-2734-releases-to-postgres-minimal
Open

Move release metadata from BigQuery to PostgreSQL#3679
mstaeble wants to merge 1 commit into
openshift:mainfrom
mstaeble:TRT-2734-releases-to-postgres-minimal

Conversation

@mstaeble

@mstaeble mstaeble commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Creates a release_definitions table in PostgreSQL to store release metadata (GA dates, development start dates, previous release, capabilities, product, status) previously only available in BigQuery
  • Adds a release-definitions loader (--loader release-definitions) that fetches release rows from BQ and syncs them to PostgreSQL during the data load cycle
  • /api/releases and the PG data provider now read from the release_definitions table instead of BigQuery or the hardcoded releaseMetadata map
  • getReleases() in the server prefers PG, falls back to BQ
  • Seeds release definitions for the dev database
  • 9 files changed, +297/-80

A follow-up PR will replace v1.Release with models.ReleaseDefinition across all internal consumers, remove QueryReleases/QueryReleaseDates from the DataProvider interface, and eliminate the remaining BQ release functions.

Test plan

  • go build ./... passes
  • go vet ./... passes
  • make lint passes
  • go test ./pkg/... ./cmd/... passes
  • sippy serve with seed data serves /api/releases from PostgreSQL with correct GA dates, capabilities, and previous release chain

Staging verification

Deployed the branch to sippy-staging and ran the release-definitions loader as a one-off job:

sippy load --loader release-definitions --init-database

Synced 36 release definitions from BigQuery to staging PostgreSQL (all OCP releases 3.11 through 5.0, OKD, ROSA, ARO, HyperShift, and CAPI entries).

Verified the following endpoints on sippy-staging.dptools.openshift.org:

Endpoint Result
GET /api/releases 36 releases with correct GA dates, capabilities, previous release chain, product, and status
GET /api/releases/health?release=4.22 6 payload health reports
GET /api/component_readiness (4.21→4.22 with full params) 72 components, 38 columns
GET /api/component_readiness/regressions?release=4.22 4,545 regressions

All release data served from PostgreSQL with no BigQuery calls.

Ref: TRT-2734

@coderabbitai ignore

🤖 Generated with Claude Code

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

openshift-ci Bot commented Jun 24, 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 Jun 24, 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 deepsm007 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

@mstaeble mstaeble changed the title [WIP] Move release metadata from BigQuery to PostgreSQL (minimal) Move release metadata from BigQuery to PostgreSQL Jun 24, 2026
@mstaeble mstaeble force-pushed the TRT-2734-releases-to-postgres-minimal branch from eccf470 to c3dca6d Compare June 24, 2026 15:36
@mstaeble mstaeble marked this pull request as ready for review June 24, 2026 15:45
@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 Jun 24, 2026
@openshift-ci openshift-ci Bot requested review from dgoodwin and petr-muller June 24, 2026 15:45
Create a release_definitions table to store release metadata (GA dates,
development start dates, previous release, capabilities, product, status)
that was previously only available in BigQuery. This eliminates the BQ
dependency for the /api/releases endpoint and removes the hardcoded
releaseMetadata map from the PostgreSQL data provider, which required
manual updates for each new release.

Key changes:
- Add ReleaseDefinition model with capability constants and HasCapability
  method
- Add release-definitions loader (--loader release-definitions) that
  fetches from BQ and syncs to PG via upsert
- getReleases() in the server prefers PG, falls back to BQ
- PG data provider QueryReleases() reads from release_definitions instead
  of deriving from prow_jobs + hardcoded map
- Seed data populates release_definitions for local development
- Fix stale "from big query" error messages in server.go

Ref: TRT-2734

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mstaeble mstaeble force-pushed the TRT-2734-releases-to-postgres-minimal branch from c3dca6d to 23f283f Compare June 24, 2026 16:45
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e

@openshift-ci

openshift-ci Bot commented Jun 24, 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.

Comment thread pkg/sippyserver/server.go
Comment on lines -194 to +195
func (s *Server) getReleases(ctx context.Context, forceRefresh ...bool) ([]sippyv1.Release, error) {
if s.bigQueryClient != nil {
refresh := len(forceRefresh) > 0 && forceRefresh[0]
return api.GetReleases(ctx, s.bigQueryClient, refresh)
// getReleases returns release data from PostgreSQL.
func (s *Server) getReleases(ctx context.Context) ([]sippyv1.Release, error) {
if s.db != nil {
releases, err := api.GetReleasesFromDB(ctx, s.db)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this removes the cache. reading from a small postgres table is fast, but not nearly as fast as reading from redis, and this page gets called.... a lot. with React calling it several times per UI transition it may even be noticeable at a human timescale. consider whether we don't want caching here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants