refactor: Unversion pages/endpoints for tree/hardware listing#1923
Open
alanpeixinho wants to merge 1 commit into
Open
refactor: Unversion pages/endpoints for tree/hardware listing#1923alanpeixinho wants to merge 1 commit into
alanpeixinho wants to merge 1 commit into
Conversation
620cb1b to
0786a63
Compare
354b201 to
8dadd28
Compare
Contributor
There was a problem hiding this comment.
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), | ||
| }; | ||
| }; |
Contributor
There was a problem hiding this comment.
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', | ||
| ), |
Contributor
There was a problem hiding this comment.
We need to use PASS in uppercase so ordering works correctly
Contributor
Author
There was a problem hiding this comment.
this line hasn't changed, but now that you mentioned, the sorting is indeed not working, i will fix in this PR anyway. Thanks
* 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>
8dadd28 to
5c5d881
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it is
How to test
/tree?origin=maestro&intervalInDays=7/hardware?origin=maestro&intervalInDays=7/api/tree/?origin=maestro&interval_in_days=7/api/hardware/?origin=maestro&startTimestampInSeconds=1741192200&endTimestampInSeconds=1741624200/api/tree-v2//api/hardware-v2/Closes #1917