Skip to content

fix(hardware): use hardware_status window for listing and details trees#1990

Open
alanpeixinho wants to merge 3 commits into
kernelci:mainfrom
profusion:fix/hardware-list-search
Open

fix(hardware): use hardware_status window for listing and details trees#1990
alanpeixinho wants to merge 3 commits into
kernelci:mainfrom
profusion:fix/hardware-list-search

Conversation

@alanpeixinho

@alanpeixinho alanpeixinho commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What it is

  • Hardware listing no longer joins latest_checkout, so boards tested inside the selected time window still appear even when they were not on the newest tip.
  • Hardware details tree heads no longer use absolute tree tips. get_hardware_trees_head_commits / get_hardware_trees_data resolve the latest checkout per tree from hardware_status in the window, so boards with tests on older checkouts still show data.
  • Expands the hardcoded Hardware TEST_ORIGINS list so origins such as linaro_pull_labs (and other active pull-lab origins) show in the origin dropdown.

How to test

Closes #1983
Closes #1264
Closes #1705

@alanpeixinho
alanpeixinho force-pushed the fix/hardware-list-search branch from 0f1dc3f to b017271 Compare July 14, 2026 18:45
…hardware_status

* Non longer limiting hardware listing to latest checkout.
* Hardcoded TEST_ORIGINS also omitted origins from the Hardware dropdown.
* Expand hardcoded test origins list.

Closes kernelci#1983

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@alanpeixinho
alanpeixinho force-pushed the fix/hardware-list-search branch from b017271 to 8e04ba5 Compare July 15, 2026 17:15
@alanpeixinho
alanpeixinho marked this pull request as ready for review July 15, 2026 17:57
@alanpeixinho alanpeixinho changed the title [WIP] fix/hardware_list_search fix/hardware_list_search Jul 15, 2026
@alanpeixinho alanpeixinho changed the title fix/hardware_list_search fix(hardware): use hardware_status window for listing and details trees Jul 15, 2026
@alanpeixinho
alanpeixinho force-pushed the fix/hardware-list-search branch from d39e3ec to 49879db Compare July 15, 2026 22:26
Stop selecting absolute tree tips for hardware details. Use hardware_status
to pick the latest checkout per tree that actually ran the board, so older
checkouts with tests still appear.

Closes kernelci#1264

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>

@mentonin mentonin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we might need to iterate a little more on what should be counted as "current" for a given hardware platform or tree.

Deciding which builds and tests to show for a given platform should be the "easier" part, but deciding which hardwares, builds and tests to show for a given tree is complex

Example complications

Consider the following commit graph, where commits are marked according to the key:

  • #: checkout with tests on platform X
  • *: checkout with tests on platform Y
  • $: checkout with tests on platform Z
  • branch names in parentheses
  G  (dog)
 /
A#*$ ---------B#*  (cat)
 \
  C#*$ --- D* --- E  (cow)
            \
             F#$ --- H#  (elk)

Assuming every checkout has at least one test, latest_checkouts maps: cat -> B, elk -> F and cow -> D (no checkout on E yet). dog points to nothing (checkout on A declared cat for its branch)

Old implementation:

Only tests at latest_checkouts. Tests shown:

By platform:

  • X: cat@B, elk@H
  • Y: cat@B, cow@D
  • Z: none

By tree:

  • cat: X@B, Y@B
  • cow: Y@D
  • elk: X@H

New implementation:

Gets all tests in range. Tests shown:

By platform:

  • X: cat@(A,B), cow@C, elk@(F,H)
  • Y: cat@(A,B), cow@(C,D), `elk@F
  • Z: cat@A, cow@C, elk@F

By tree:

  • cat: X@(A,B), Y@(A,B), Z@A
  • cow: X@C, Y@(C,D), Z@F
  • elk: X@(F,H), Z@F

My expectation:

Gets latest checkout per (branch, platform) pair:

By platform:

  • X in cat@B, cow@C, elk@H
  • Y in cat@B, cow@D
  • Z in cat@A, cow@C, elk@F

By tree:

  • cat: (X,Y)@B, Z@A
  • cow: Y@D, (X,Z)@C
  • hawk: X@H, Y@F

Optionally, also fall back to checkouts at git topological (first) parents (would require major changes):

  • dog would show (X,Y,Z)@A
  • hawk would show Z@D

Some questions:

  1. When looking at/aggregating a platform, which builds/tests should be included?
    a) in the latest checked out commit per tree (current)
    b) in any commit (this PR)
    d) in the latest checked out commit with at least one build in that platform
    c) in the latest checked out commit per {tree, identifier} (my suggestion)

  2. When looking at/aggregating a tree, which builds/tests should be included?
    a) in the latest checked out commit (current)
    b) in the latest commit and same tree
    c) latest by identifier
    d) latest by platform by identifier

Comment thread backend/kernelCI_app/queries/hardware.py
Comment on lines -373 to 371
INNER JOIN
latest_checkout
ON
hardware_status.checkout_id = latest_checkout.checkout_id
AND
latest_checkout.start_time >= %(start_date)s
AND
latest_checkout.start_time <= %(end_date)s
WHERE
hardware_status.test_origin = %(origin)s
AND hardware_status.start_time >= %(start_date)s
AND hardware_status.start_time <= %(end_date)s
GROUP BY

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think this will overcount tests (getting all builds tests in the time range, including repeats/redos).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You have a good point here.
We might need to go for the latest checkout where that hardware is present. What you think?
I think this is another point in favor of #1947.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have changed so we get the latest checkout on that hardware, without overcounting tests made in multiple checkouts within the time window.

…indow

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@alanpeixinho

Copy link
Copy Markdown
Contributor Author

I think we might need to iterate a little more on what should be counted as "current" for a given hardware platform or tree.

Deciding which builds and tests to show for a given platform should be the "easier" part, but deciding which hardwares, builds and tests to show for a given tree is complex

Example complications
Consider the following commit graph, where commits are marked according to the key:

  • #: checkout with tests on platform X
  • *: checkout with tests on platform Y
  • $: checkout with tests on platform Z
  • branch names in parentheses
  G  (dog)
 /
A#*$ ---------B#*  (cat)
 \
  C#*$ --- D* --- E  (cow)
            \
             F#$ --- H#  (elk)

Assuming every checkout has at least one test, latest_checkouts maps: cat -> B, elk -> F and cow -> D (no checkout on E yet). dog points to nothing (checkout on A declared cat for its branch)

Old implementation:

Only tests at latest_checkouts. Tests shown:

By platform:

  • X: cat@B, elk@H
  • Y: cat@B, cow@D
  • Z: none

By tree:

  • cat: X@B, Y@B
  • cow: Y@D
  • elk: X@H

New implementation:

Gets all tests in range. Tests shown:

By platform:

  • X: cat@(A,B), cow@C, elk@(F,H)
  • Y: cat@(A,B), cow@(C,D), `elk@F
  • Z: cat@A, cow@C, elk@F

By tree:

  • cat: X@(A,B), Y@(A,B), Z@A
  • cow: X@C, Y@(C,D), Z@F
  • elk: X@(F,H), Z@F

My expectation:

Gets latest checkout per (branch, platform) pair:

By platform:

  • X in cat@B, cow@C, elk@H
  • Y in cat@B, cow@D
  • Z in cat@A, cow@C, elk@F

By tree:

  • cat: (X,Y)@B, Z@A
  • cow: Y@D, (X,Z)@C
  • hawk: X@H, Y@F

Optionally, also fall back to checkouts at git topological (first) parents (would require major changes):

  • dog would show (X,Y,Z)@A
  • hawk would show Z@D

Some questions:

  1. When looking at/aggregating a platform, which builds/tests should be included?
    a) in the latest checked out commit per tree (current)
    b) in any commit (this PR)
    d) in the latest checked out commit with at least one build in that platform
    c) in the latest checked out commit per {tree, identifier} (my suggestion)
  2. When looking at/aggregating a tree, which builds/tests should be included?
    a) in the latest checked out commit (current)
    b) in the latest commit and same tree
    c) latest by identifier
    d) latest by platform by identifier

Good points.
Updated it here, so we are now using the (c) strategy for 1.
The point on 2 is a little bit more tricky.
Because would affect the tree page.
It might be safer to open a new ticket to discuss that. What you think?

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

Labels

None yet

Projects

None yet

2 participants