Skip to content

Remove unused columns from CR BigQuery queries#3687

Open
mstaeble wants to merge 1 commit into
openshift:mainfrom
mstaeble:worktree-TRT-2746-remove-unused-bq-columns
Open

Remove unused columns from CR BigQuery queries#3687
mstaeble wants to merge 1 commit into
openshift:mainfrom
mstaeble:worktree-TRT-2746-remove-unused-bq-columns

Conversation

@mstaeble

@mstaeble mstaeble commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove 3 unused columns from the Component Readiness test details BigQuery query (test_suite, file_path, capabilities) that are selected but never consumed in deserialization
  • Remove capabilities from the PostgreSQL test details query for parity
  • Clean up stale TODOs and debug comments referencing jira_component/jira_component_id in the component report query (they were never in the SELECT clause)

Reduces bytes scanned per CR query, directly lowering BigQuery cost. The capabilities removal is the most impactful since it eliminates reading that column from the latest_component_mapping table. file_path is kept in the GROUP BY to preserve correct aggregation semantics.

Closes: https://issues.redhat.com/browse/TRT-2746

Test plan

  • gofmt clean
  • go vet ./pkg/api/componentreadiness/... passes
  • go test ./pkg/api/componentreadiness/... passes
  • make test passes
  • golangci-lint run ./... reports 0 issues
  • e2e tests pass in CI

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved component readiness and test detail reporting so the returned data matches what the app now expects.
    • Removed a few unnecessary fields from test detail results, helping prevent mismatches and parsing issues.
    • Clarified internal guidance around report columns to reduce the risk of future display or data-loading errors.

Remove columns selected but never consumed downstream in the component
readiness test details query (both BigQuery and PostgreSQL providers):

- test_suite: not parsed in deserializeRowToJobRunTestReportStatus
- file_path: not parsed (kept in GROUP BY for correct aggregation)
- capabilities: not parsed, saves reading from latest_component_mapping

Also clean up stale TODOs and debug comments referencing jira_component
and jira_component_id in the component report query, where those columns
were never actually selected.

Closes: https://issues.redhat.com/browse/TRT-2746

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@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 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 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

[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 sosiouxme 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] Remove unused columns from CR BigQuery queries Remove unused columns from CR BigQuery queries Jun 24, 2026
@mstaeble mstaeble marked this pull request as ready for review June 24, 2026 19:12
@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 deads2k and petr-muller June 24, 2026 19:12
@mstaeble

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 24, 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 Jun 24, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 0e93f2ea-097c-470e-b892-17d84b69897b

📥 Commits

Reviewing files that changed from the base of the PR and between 09af781 and 0d400af.

📒 Files selected for processing (2)
  • pkg/api/componentreadiness/dataprovider/bigquery/querygenerators.go
  • pkg/api/componentreadiness/dataprovider/postgres/provider.go
💤 Files with no reviewable changes (1)
  • pkg/api/componentreadiness/dataprovider/bigquery/querygenerators.go

Walkthrough

The PR removes unused test-detail columns from the BigQuery and PostgreSQL component-readiness queries and updates the related row-shape comments and struct fields to match the remaining selected data.

Changes

Component readiness query shape cleanup

Layer / File(s) Summary
BigQuery test-detail projection
pkg/api/componentreadiness/dataprovider/bigquery/querygenerators.go
The BigQuery component report and test-detail queries stop selecting unused columns, and the nearby comments describing returned columns and row parsing are updated.
PostgreSQL test-detail row shape
pkg/api/componentreadiness/dataprovider/postgres/provider.go
The PostgreSQL test-detail row struct drops Capabilities, and the test-detail SELECT list keeps jira_component_id without selecting tow.capabilities.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

jira/valid-reference, ready-for-human-review

Suggested reviewers

  • petr-muller
  • xueqzhan
🚥 Pre-merge checks | ✅ 21
✅ Passed checks (21 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: removing unused columns from Component Readiness queries.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 PASS: The PR only changes query projections and a row struct; no new ignored errors, panics, or nil-deref risks were introduced, and existing query errors stay wrapped.
Sql Injection Prevention ✅ Passed The PR only removes static SELECT columns/comments; the queries still use placeholders for inputs, with no new raw user-input SQL concatenation.
Excessive Css In React Should Use Styles ✅ Passed PR only changes Go BigQuery/Postgres query code; no React components or inline CSS styles are introduced, so this check is not applicable.
Test Coverage For New Features ✅ Passed Only unused SQL columns/comments were removed; no new functions or behavior, so this is a trivial refactor exempt from new tests.
Single Responsibility And Clear Naming ✅ Passed Touched code stays within cohesive dataprovider/query-builder packages; it only trims SQL projections/comments and adds no broad types or vague methods.
Feature Documentation ✅ Passed PASS: docs/features only has job-analysis-symptoms.md, unrelated to component readiness; no feature doc exists to update for these internal query tweaks.
Stable And Deterministic Test Names ✅ Passed PR touches only non-test query/provider code; no Ginkgo titles were added or changed, and no dynamic/brittle test names were found.
Test Structure And Quality ✅ Passed No Ginkgo test code was changed; the affected componentreadiness tests are standard testing-based, so this checklist is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the PR only changes CR query/provider SQL and comments, so MicroShift compatibility is not implicated.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR only changes CR query code; no new Ginkgo e2e tests or SNO-sensitive node assumptions were added.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: Commit only changes component-readiness query/provider code; no manifests, controllers, or operator scheduling logic were modified.
Ote Binary Stdout Contract ✅ Passed Touched files only alter SQL/struct fields; no process-level stdout writes or logging setup were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Changed files are query/provider code only; no Ginkgo tests or IPv4/public-network assumptions were introduced.
No-Weak-Crypto ✅ Passed Touched files only adjust SQL projections/comments; no MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret comparisons were added.
Container-Privileges ✅ Passed No privileged/hostPID/hostNetwork/hostIPC/allowPrivilegeEscalation/SYS_ADMIN settings appear in the touched manifests; Dockerfiles switch to non-root users after setup.
No-Sensitive-Data-In-Logs ✅ Passed PR only trims query columns/comments; it adds no new logging of secrets/PII/internal hostnames, and existing row logs are unchanged.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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

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

Labels

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.

1 participant