Skip to content

feat: split the "full" tree details data fetch into three separate queries#1770

Open
gustavobtflores wants to merge 2 commits intokernelci:mainfrom
gustavobtflores:feat/split-tree-details-queries
Open

feat: split the "full" tree details data fetch into three separate queries#1770
gustavobtflores wants to merge 2 commits intokernelci:mainfrom
gustavobtflores:feat/split-tree-details-queries

Conversation

@gustavobtflores
Copy link
Contributor

Description

Split the "full" tree details data fetch into three separate, tab-specific queries (builds, boots, tests). Previously, a single heavy query fetched all builds, boots, and tests data at once after the summary loaded. Now each tab triggers only its own query when the user navigates to it, reducing unnecessary data transfer and backend load.

Changes

  • Added get_tree_data() query function in queries/tree.py that accepts a data_type literal ("builds", "boots", "tests") and builds the appropriate SQL join (filtering test paths for boots/tests, or omitting test columns entirely for builds)
  • Added get_current_row_data_builds() helper in treeDetails.py that maps build-only query rows while stubbing out test fields so existing filter/aggregation logic remains unchanged
  • Updated treeDetailsBuildsView.py, treeDetailsBootsView.py, and treeDetailsTestsView.py to use the new get_tree_data() and get_current_row_data_builds() instead of the generic full-data equivalents
  • Replaced the single full query in useTreeDetailsLazyLoadQuery with three separate builds, boots, and tests queries, each gated behind both summary availability and the currently active tab
  • Updated BuildTab, BootsTab, TestsTab, and TreeDetails components to consume the new per-tab query results

How to test

  1. Start the full stack (docker compose up --build -d)
  2. Navigate to a tree details page and open the Builds tab, verify builds load correctly and no boots/tests requests fire
  3. Switch to the Boots tab, verify only the boots query fires
  4. Switch to the Tests tab, verify only the tests query fires
  5. Confirm filters and issue categorization still work as expected on each tab

@MarceloRobert MarceloRobert added Backend Most or all of the changes for this issue will be in the backend code. Frontend Most or all of the changes for this issue will be in the frontend code. labels Mar 2, 2026
@gustavobtflores gustavobtflores force-pushed the feat/split-tree-details-queries branch 3 times, most recently from 02219c7 to a4cbb69 Compare March 2, 2026 20:47
@gustavobtflores gustavobtflores force-pushed the feat/split-tree-details-queries branch from a4cbb69 to 40c3163 Compare March 2, 2026 21:15
status_code=HTTPStatus.OK,
)

if len(rows) == 1:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we really remove this condition?

status_code=HTTPStatus.OK,
)

if len(rows) == 1:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@gustavobtflores
Copy link
Contributor Author

We'll hold this PR until the Grafana dashboard is available again, since it's currently broken due to changes in the deploy pipeline and we can't verify endpoint usage

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

Labels

Backend Most or all of the changes for this issue will be in the backend code. Frontend Most or all of the changes for this issue will be in the frontend code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants