TRT-2741: fix duplicate rows on Tests page - #3792
Conversation
Remove the synthetic ID field from test API responses and structs, since it was misleading and no longer needed after the matview removal. Use a composite key (name + suite_name + variants) for DataGrid row identity in the frontend to prevent duplicate row rendering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: automatic mode |
|
Skipping CI for Draft Pull Request. |
|
@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. |
WalkthroughReport APIs and SQL queries no longer expose synthetic test IDs. PostgreSQL and BigQuery projections are updated accordingly, and the test table now derives row identity from test metadata. ChangesSynthetic test ID removal
Estimated code review effort: 3 (Moderate) | ~20 minutes 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 full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/api/tests.go (1)
465-472: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: Avoid relying on exact slice capacity when appending.
Both
collapsedColumnsandselectColumnsare created by appending totestMetadataColumns. This works safely only becausetestMetadataColumnsis initialized with a composite literal whose length equals its capacity, forcingappendto allocate a new backing array each time. IftestMetadataColumnsis ever refactored to have excess capacity (e.g., usingmakewith a larger capacity), the secondappendwill silently overwrite the results of the first. Consider explicitly copying the slice or constructing them independently to prevent future regression.♻️ Proposed refactor
- collapsedColumns := append(testMetadataColumns, query.QueryTestFields) + collapsedColumns := append(append([]string(nil), testMetadataColumns...), query.QueryTestFields) rawQuery := dbc.DB.WithContext(ctx). Table("(?) AS r", collapsedQuery). Select(strings.Join(collapsedColumns, ",")) // Collapsed path: inner query only has counts, so the outer layer computes // percentages and net improvements via QueryTestSummarizer. - selectColumns := append(testMetadataColumns, query.QueryTestSummarizer) + selectColumns := append(append([]string(nil), testMetadataColumns...), query.QueryTestSummarizer)🤖 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/tests.go` around lines 465 - 472, Update the construction of collapsedColumns and selectColumns so each append operates on an independent copy of testMetadataColumns, rather than relying on its current capacity. Preserve the existing column contents and query behavior while preventing the second append from overwriting the first if testMetadataColumns later has spare capacity.
🤖 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/tests.go`:
- Around line 465-472: Update the construction of collapsedColumns and
selectColumns so each append operates on an independent copy of
testMetadataColumns, rather than relying on its current capacity. Preserve the
existing column contents and query behavior while preventing the second append
from overwriting the first if testMetadataColumns later has spare capacity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 298c7c80-70ca-4cb6-ae55-28fd7270062f
📒 Files selected for processing (6)
pkg/api/tests.gopkg/apis/api/types.gopkg/db/query/cumulative_query.gopkg/db/query/test_queries.gopkg/flags/postgres_benchmarking_test.gosippy-ng/src/tests/TestTable.js
mstaeble
left a comment
There was a problem hiding this comment.
Re: nitpick on append(testMetadataColumns, ...) — dismissed.
testMetadataColumns is a 4-element composite literal (len == cap == 4), so both append calls always allocate fresh backing arrays. The defensive copy pattern adds verbosity for a low-probability future risk.
|
Scheduling required tests: |
|
[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 |
|
@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
idfield fromTestandTestBQstructs and all query paths (PG and BQ), since it was misleading and no longer needed after the matview removal in PR TRT-2741: Phase 2 - Replace prow_test_report matviews with cumulative summary queries #3769.getRowIdprop to the MUI DataGrid inTestTable.jsusing a composite key (name + suite_name + variants) with\x1f(Unit Separator) delimiter to prevent duplicate row rendering.test_queries.go) where the renamed column was not updated in a downstream subquery.ROW_NUMBER() OVER() as idfrom benchmark tests.Test plan
make lintpassesmake testpassesmake e2epasses🤖 Generated with Claude Code
Summary by CodeRabbit