Skip to content

refactor: Unversion pages/endpoints for tree/hardware listing#1923

Open
alanpeixinho wants to merge 1 commit into
kernelci:mainfrom
profusion:refactor/coalesce-v1-v2-endpoints
Open

refactor: Unversion pages/endpoints for tree/hardware listing#1923
alanpeixinho wants to merge 1 commit into
kernelci:mainfrom
profusion:refactor/coalesce-v1-v2-endpoints

Conversation

@alanpeixinho

@alanpeixinho alanpeixinho commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

What it is

  • Unify the v1/v2 pages and endpoints for tree/pages listing.
  • Remove CheckoutsCache.

How to test

  • Start backend server and frontend
  • make a request for the unversioned pages (as the examples):
    • /tree?origin=maestro&intervalInDays=7
    • /hardware?origin=maestro&intervalInDays=7
  • make a request for backend endpoints (as the examples):
    • /api/tree/?origin=maestro&interval_in_days=7
    • /api/hardware/?origin=maestro&startTimestampInSeconds=1741192200&endTimestampInSeconds=1741624200
  • make sure older versioning no longer exists (as the examples):
    • /api/tree-v2/
    • /api/hardware-v2/

Closes #1917

@alanpeixinho alanpeixinho force-pushed the refactor/coalesce-v1-v2-endpoints branch from 620cb1b to 0786a63 Compare June 3, 2026 19:12
@alanpeixinho alanpeixinho marked this pull request as ready for review June 3, 2026 19:13
@alanpeixinho alanpeixinho force-pushed the refactor/coalesce-v1-v2-endpoints branch 2 times, most recently from 354b201 to 8dadd28 Compare June 5, 2026 18:56

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.

We could use HardwareListingResponse instead of HardwareListingByRevisionResponse here, AFAIK the frontend just uses PASS, FAIL and INCONCLUSIVE

Comment on lines 48 to 65
const normalizeStatusCount = (
statusSummary: ListingStatusSummary,
inconclusiveTarget: 'NULL' | 'SKIP',
): RequiredStatusCount => {
const inconclusive = statusSummary.INCONCLUSIVE ?? 0;

return { startTimestampInSeconds, endTimestampInSeconds };
return {
PASS: statusSummary.PASS ?? 0,
FAIL: statusSummary.FAIL ?? 0,
NULL:
statusSummary.NULL ?? (inconclusiveTarget === 'NULL' ? inconclusive : 0),
ERROR: statusSummary.ERROR ?? 0,
MISS: statusSummary.MISS ?? 0,
DONE: statusSummary.DONE ?? 0,
SKIP:
statusSummary.SKIP ?? (inconclusiveTarget === 'SKIP' ? inconclusive : 0),
};
};

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.

We really need to normalize? We couldn't just return PASS, FAIL, INCONCLUSIVE directly from the backend and use here?

Comment on lines +203 to +214
build_status_summary: normalizeStatusCount(
hardware.build_status_summary,
'SKIP',
),
test_status_summary: normalizeStatusCount(
hardware.test_status_summary,
'NULL',
),
boot_status_summary: normalizeStatusCount(
hardware.boot_status_summary,
'NULL',
),

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.

ditto

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.

We need to use PASS in uppercase so ordering works correctly

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.

this line hasn't changed, but now that you mentioned, the sorting is indeed not working, i will fix in this PR anyway. Thanks

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.

Same here: PASS

@gustavobtflores gustavobtflores added Frontend Most or all of the changes for this issue will be in the frontend code. Backend Most or all of the changes for this issue will be in the backend code. labels Jun 8, 2026
  * Promote the v2 tree and hardware listing implementations to unversioned routes and APIs
  * Remove legacy v1 endpoints, pages, feature flags.
  * Remove orphaned checkout-cache code.

 Closes kernelci#1917

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@alanpeixinho alanpeixinho force-pushed the refactor/coalesce-v1-v2-endpoints branch from 8dadd28 to 5c5d881 Compare June 8, 2026 14:34
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.

Unify V1 and V2 from hardware and trees pages

2 participants