Skip to content

fix: include builds from all matching checkouts in tree details queries#1870

Open
gustavobtflores wants to merge 1 commit intokernelci:mainfrom
gustavobtflores:fix/tree-summary-builds-data
Open

fix: include builds from all matching checkouts in tree details queries#1870
gustavobtflores wants to merge 1 commit intokernelci:mainfrom
gustavobtflores:fix/tree-summary-builds-data

Conversation

@gustavobtflores
Copy link
Copy Markdown
Contributor

Fixes an issue where the tree details page returns empty results when multiple checkout rows exist for the same commit hash. The query was previously limited to only the most recent checkout (LIMIT 1), potentially missing builds associated with other checkout rows.

Changes

  • Removed LIMIT 1 from the RELEVANT_CHECKOUTS CTE to return all matching checkouts
  • Changed the build join from b.checkout_id = rc.checkout_id to b.checkout_id IN (SELECT checkout_id FROM RELEVANT_CHECKOUTS) to aggregate builds from all matching checkout rows

Related Issue

Closes #1869

@gustavobtflores gustavobtflores self-assigned this Apr 22, 2026
@gustavobtflores gustavobtflores added the Queries Issue that involves modifying some DB query label Apr 22, 2026
@MarceloRobert MarceloRobert added the bug Something isn't working label Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Queries Issue that involves modifying some DB query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tree details page returns empty results when multiple checkout rows exist for the same commit

2 participants