TRT-2741: Expand variant keys and decouple daily summaries from variant_combination_id#3722
TRT-2741: Expand variant keys and decouple daily summaries from variant_combination_id#3722mstaeble wants to merge 2 commits into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
@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. 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. |
|
Tip For best results, initiate chat on the files or code changes.
|
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mstaeble The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1f14b2a to
c00b661
Compare
…nt_combination_id Cherry-pick from PR openshift#3722 with conflict resolution and fixes: - Add 8 variant keys to importantVariants (Aggregation, NetworkAccess, Scheduler, Suite, ContainerRuntime, CGroupMode, LayeredProduct, plus SpotCheckComponent/SpotCheckCapability excluded as unused in views) - Remove variant_combination_id from test_daily_summaries; matview pre_agg CTEs now join prow_jobs to resolve it at refresh time - Fix cr_test_status_matview to join prow_jobs for variant_combination_id - Remove duplicate Procedure entry from importantVariants - Add migration 000004 to drop the column Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
Warning Review limit reached
Next review available in: 56 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 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 configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (10)
WalkthroughAdds migration verification tooling, removes ChangesMigration Verification Tooling
Daily Summary Storage and Aggregation
Important Variants List Update
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
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 |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (3)
hack/verify-migrations.sh (2)
30-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueQuote
$expectedin printf per shellcheck.Static analysis flags unquoted
$expected; harmless here since it's always numeric, but quoting avoids relying on that invariant.🔧 Proposed fix
- echo "ERROR: Expected migration $(printf '%06d' $expected) but found $(printf '%06d' $num) (gap or duplicate)." + echo "ERROR: Expected migration $(printf '%06d' "$expected") but found $(printf '%06d' "$num") (gap or duplicate)."🤖 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 `@hack/verify-migrations.sh` at line 30, The shellcheck warning comes from the unquoted $expected used in the printf call inside verify-migrations.sh’s error message. Update the printf invocation in that echo statement to quote $expected consistently with the other variable expansions, keeping the same migration gap/duplicate message formatting while removing the lint issue.Source: Linters/SAST tools
47-47: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valuePrefer
findoverlsfor the file count, per shellcheck.
lsparsing is fragile with unusual filenames (newlines, spaces);find/fdis more robust, though migration filenames are controlled here so risk is low.🔧 Proposed fix
-actual_sql=$(ls "$MIGRATIONS_DIR"/*.sql 2>/dev/null | wc -l | tr -d ' ') +actual_sql=$(find "$MIGRATIONS_DIR" -maxdepth 1 -name '*.sql' | wc -l | tr -d ' ')🤖 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 `@hack/verify-migrations.sh` at line 47, The migration file count in verify-migrations.sh uses ls, which shellcheck flags as fragile for parsing filenames. Update the actual_sql count logic to use find instead of ls in the same migration-counting step, keeping the rest of the pipeline behavior unchanged and preserving the comparison against expected_sql.Source: Linters/SAST tools
pkg/testidentification/ocp_variants.go (1)
47-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExpanded key set matches canonical variant names.
The added keys (
Procedure,Aggregation,NetworkAccess,Scheduler,Suite,ContainerRuntime,CGroupMode,LayeredProduct) line up with the canonicalVariant*constants defined inpkg/variantregistry/ocp.go, sofilterVariantswill correctly retain them. No test coverage currently exercises this filter list; consider adding/updating a unit test assertingIdentifyVariants/filterVariantsreturns these new keys, since this list directly changes what gets persisted inprow_jobs.variantsand consumed by downstream BigQuery queries (e.g.jobrunannotator.go).As per path instructions,
**/*.{go,tsx,jsx}: "New or modified functionality should include test coverage: new Go functions and methods need unit tests, bug fixes need regression tests."🤖 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/testidentification/ocp_variants.go` around lines 47 - 54, The expanded variant key list in filterVariants/IdentifyVariants should be covered by tests, since it now changes which canonical Variant* names are retained and persisted. Add or update a unit test around IdentifyVariants or filterVariants in pkg/testidentification/ocp_variants.go that asserts the new keys (Procedure, Aggregation, NetworkAccess, Scheduler, Suite, ContainerRuntime, CGroupMode, LayeredProduct) are preserved, so regressions in prow_jobs.variants behavior are caught.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/db/migrations/000004_drop_daily_summary_variant_combination.down.sql`:
- Around line 1-2: Add an explanatory SQL comment in the down migration near the
TRUNCATE statement in 000004_drop_daily_summary_variant_combination.down.sql to
document why the rollback is destructive and what follow-up is required. Mention
that `test_daily_summaries` is intentionally wiped before re-adding
`variant_combination_id`, and note that a full daily-summary and
materialized-view refresh must be performed afterward; keep the comment adjacent
to the migration logic so the rationale is visible when running `migrate down`.
---
Nitpick comments:
In `@hack/verify-migrations.sh`:
- Line 30: The shellcheck warning comes from the unquoted $expected used in the
printf call inside verify-migrations.sh’s error message. Update the printf
invocation in that echo statement to quote $expected consistently with the other
variable expansions, keeping the same migration gap/duplicate message formatting
while removing the lint issue.
- Line 47: The migration file count in verify-migrations.sh uses ls, which
shellcheck flags as fragile for parsing filenames. Update the actual_sql count
logic to use find instead of ls in the same migration-counting step, keeping the
rest of the pipeline behavior unchanged and preserving the comparison against
expected_sql.
In `@pkg/testidentification/ocp_variants.go`:
- Around line 47-54: The expanded variant key list in
filterVariants/IdentifyVariants should be covered by tests, since it now changes
which canonical Variant* names are retained and persisted. Add or update a unit
test around IdentifyVariants or filterVariants in
pkg/testidentification/ocp_variants.go that asserts the new keys (Procedure,
Aggregation, NetworkAccess, Scheduler, Suite, ContainerRuntime, CGroupMode,
LayeredProduct) are preserved, so regressions in prow_jobs.variants behavior are
caught.
🪄 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: 09db481d-351a-47cb-b6d0-5a891b840ca3
📒 Files selected for processing (10)
Makefilehack/verify-migrations.shpkg/db/dailysummary/dailysummary.gopkg/db/db.gopkg/db/migrations/000004_drop_daily_summary_variant_combination.down.sqlpkg/db/migrations/000004_drop_daily_summary_variant_combination.up.sqlpkg/db/migrations/MANIFESTpkg/db/models/prow.gopkg/db/views.gopkg/testidentification/ocp_variants.go
c00b661 to
2357247
Compare
|
Scheduling required tests: |
…nt_combination_id Cherry-pick from PR openshift#3722 with conflict resolution and fixes: - Add 8 variant keys to importantVariants (Aggregation, NetworkAccess, Scheduler, Suite, ContainerRuntime, CGroupMode, LayeredProduct, plus SpotCheckComponent/SpotCheckCapability excluded as unused in views) - Remove variant_combination_id from test_daily_summaries; matview pre_agg CTEs now join prow_jobs to resolve it at refresh time - Fix cr_test_status_matview to join prow_jobs for variant_combination_id - Remove duplicate Procedure entry from importantVariants - Add migration 000004 to drop the column Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nt_combination_id Cherry-pick from PR openshift#3722 with conflict resolution and fixes: - Add 8 variant keys to importantVariants (Aggregation, NetworkAccess, Scheduler, Suite, ContainerRuntime, CGroupMode, LayeredProduct, plus SpotCheckComponent/SpotCheckCapability excluded as unused in views) - Remove variant_combination_id from test_daily_summaries; matview pre_agg CTEs now join prow_jobs to resolve it at refresh time - Fix cr_test_status_matview to join prow_jobs for variant_combination_id - Remove duplicate Procedure entry from importantVariants - Add migration 000004 to drop the column Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nt_combination_id Cherry-pick from PR openshift#3722 with conflict resolution and fixes: - Add 8 variant keys to importantVariants (Aggregation, NetworkAccess, Scheduler, Suite, ContainerRuntime, CGroupMode, LayeredProduct, plus SpotCheckComponent/SpotCheckCapability excluded as unused in views) - Remove variant_combination_id from test_daily_summaries; matview pre_agg CTEs now join prow_jobs to resolve it at refresh time - Fix cr_test_status_matview to join prow_jobs for variant_combination_id - Remove duplicate Procedure entry from importantVariants - Add migration 000004 to drop the column Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5d5ca33 to
ccd8ece
Compare
…nt_combination_id Add 8 variant keys to importantVariants (Procedure, Aggregation, NetworkAccess, Scheduler, Suite, ContainerRuntime, CGroupMode, LayeredProduct). Release-family keys remain excluded as they are redundant with prow_jobs.release and the Upgrade variant. Remove variant_combination_id from test_daily_summaries. The matview pre_agg CTE now joins prow_jobs to resolve the variant_combination_id at refresh time. This decouples daily summaries from variant changes, eliminating the need to rebuild 69M rows when variants are updated. Benchmarking shows <1% matview refresh overhead from the added join. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add LATEST manifest listing all migrations by version and name. Two PRs adding the same migration number will conflict on this file. Add hack/verify-migrations.sh and a make target to enforce sequential numbering, no gaps, and matching up/down files. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ccd8ece to
fa1cbef
Compare
|
/test security |
|
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. |
Summary
importantVariants(Procedure, Aggregation, NetworkAccess, Scheduler, Suite, ContainerRuntime, CGroupMode, LayeredProduct). Release-family keys remain excluded as they are redundant withprow_jobs.releaseand the Upgrade variant.variant_combination_idfromtest_daily_summaries. The matviewpre_aggCTE now joinsprow_jobsto resolve variant combinations at refresh time, decoupling daily summaries from variant changes.pkg/db/migrations/MANIFEST) andmake verify-migrationstarget to detect conflicting migration numbers across PRs.Benchmarking against staging-2 showed <1% matview refresh overhead from the added join (
prow_jobsfits in a 1.1MB in-memory hash table). Aggregate totals are identical; per-variant grouping improves because ~49% of storedvariant_combination_idvalues were stale.Rollback note
The down migration truncates
test_daily_summariesbefore re-adding the column. After rollback, a daily summary refresh + matview refresh cycle is needed before results are available.Test plan
go vet ./pkg/...passesmake lintpasses (0 issues)make testpasses (Go, JS, Python)make verify-migrationspasses; verified it catches gaps, duplicates, and unlisted filespre_aggCTE against staging-2 (92.4s vs 93.5s)🤖 Generated with Claude Code
Summary by CodeRabbit