Fix cross-provider variant cache contamination - #3773
Conversation
The Postgres provider was priming a shared Redis cache key (TestAllVariants~) that the BigQuery provider then read, causing Unrecognized name: jv_Release errors because Postgres variants lack the Release column BigQuery expects. Move variant caching inside the BigQuery provider with a provider-specific cache key (BQJobVariants~), remove the allJobVariants parameter from the DataProvider interface (it was a BigQuery implementation detail the Postgres provider ignored), and simplify GetJobVariants to a pass-through. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
@mstaeble: This pull request references TRT-2779 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. DetailsIn response to this:
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. |
|
Skipping CI for Draft Pull Request. |
WalkthroughJob variant retrieval is centralized in data providers, with BigQuery adding cached access. Report, test-detail, middleware, fallback, and provider interfaces no longer pass pre-fetched variants through query paths. ChangesJob variant query flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 19 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (19 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@mstaeble: No Jira issue is referenced in the title of this pull request. DetailsIn response to this:
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. |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pkg/api/componentreadiness/component_report.go (2)
338-338: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse structured logging for
includeVariants.As per coding guidelines, prefer structured logging with
WithFieldover formatting values into strings.♻️ Proposed refactor
- fLog.Infof("running sample query with includeVariants: %+v", c.ReqOptions.VariantOption.IncludeVariants) + fLog.WithField("includeVariants", c.ReqOptions.VariantOption.IncludeVariants).Info("running sample query")🤖 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/component_report.go` at line 338, Update the sample-query log in the component report flow to use structured logging via WithField for includeVariants instead of embedding the value with formatted string interpolation. Preserve the existing log message and value semantics while attaching includeVariants as a dedicated field.Source: Coding guidelines
70-70: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider dropping this wrapper.
GetJobVariantsonly forwards toprovider.QueryJobVariants(ctx), so removing it would simplify the package API if this helper isn’t meant to stay as a stable entrypoint.🤖 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/component_report.go` at line 70, Remove the redundant GetJobVariants wrapper that only delegates to provider.QueryJobVariants(ctx), and update its callers to invoke the provider method directly. Preserve the existing behavior unless GetJobVariants is intentionally required as a stable public entrypoint.
🤖 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/componentreadiness/component_report.go`:
- Line 338: Update the sample-query log in the component report flow to use
structured logging via WithField for includeVariants instead of embedding the
value with formatted string interpolation. Preserve the existing log message and
value semantics while attaching includeVariants as a dedicated field.
- Line 70: Remove the redundant GetJobVariants wrapper that only delegates to
provider.QueryJobVariants(ctx), and update its callers to invoke the provider
method directly. Preserve the existing behavior unless GetJobVariants is
intentionally required as a stable public entrypoint.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 299002c6-a91c-4a97-8038-f1686aa7dbc3
📒 Files selected for processing (11)
pkg/api/componentreadiness/component_report.gopkg/api/componentreadiness/dataprovider/bigquery/provider.gopkg/api/componentreadiness/dataprovider/interface.gopkg/api/componentreadiness/dataprovider/postgres/provider.gopkg/api/componentreadiness/middleware/interface.gopkg/api/componentreadiness/middleware/linkinjector/linkinjector.gopkg/api/componentreadiness/middleware/list.gopkg/api/componentreadiness/middleware/regressionallowances/regressionallowances.gopkg/api/componentreadiness/middleware/regressiontracker/regressiontracker.gopkg/api/componentreadiness/middleware/releasefallback/releasefallback.gopkg/api/componentreadiness/test_details.go
|
Scheduling required tests: |
|
@mstaeble: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mstaeble, smg247 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Summary
BQJobVariants~), eliminating the sharedTestAllVariants~key that caused cross-provider cache contaminationallJobVariantsparameter from theDataProviderinterface and middleware since it was a BigQuery implementation detail the Postgres provider always ignoredGetJobVariantsfrom a cache-wrapping generator to a direct pass-through toprovider.QueryJobVariantsTest plan
go vet ./pkg/... ./test/...passesgo test ./pkg/...passesmake e2e(the originally failingTestRegressionCacheLoaderrequiresGCS_SA_JSON_PATH; verified it is no longer affected by the shared cache key)🤖 Generated with Claude Code
Summary by CodeRabbit
Performance
Reliability