feat: add checkout selectors on hardware page#1904
Conversation
db1a452 to
d6051f2
Compare
e62fd2c to
4cb4128
Compare
4cb4128 to
8313347
Compare
There was a problem hiding this comment.
Pull request overview
Adds a hardware “revision selector” flow so the hardware listing can be filtered by a specific tree/repo/branch/commit, wiring new backend endpoints to a new selector UI and persisting the selection in URL search params.
Changes:
- Introduces backend APIs for (1) available hardware selectors (tree/branch/revision) and (2) hardware listing filtered by a selected revision.
- Adds frontend selection state/resolution utilities plus a new selector UI (comboboxes) integrated into the hardware table header.
- Extends router search schemas + querystring minification to persist tree/repo/branch/commit selection in the URL.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| dashboard/src/utils/search.ts | Adds minified query param keys for revision selection fields. |
| dashboard/src/types/hardware.ts | Adds selector/selection TypeScript types for the new APIs and UI state. |
| dashboard/src/types/general.ts | Extends SearchParamsKeys with selection-related search params. |
| dashboard/src/routes/_main/hardware/v2/route.tsx | Allows revision selection fields in the v2 hardware route search schema. |
| dashboard/src/routes/_main/hardware/route.tsx | Allows revision selection fields in the v1 hardware route search schema. |
| dashboard/src/pages/Hardware/hardwareTableUtils.ts | Extracts hardware-details link search-building logic (dropping selection params). |
| dashboard/src/pages/Hardware/HardwareTable.tsx | Integrates selector UI into table header and supports a configurable empty-state message id. |
| dashboard/src/pages/Hardware/hardwareSelection.ts | Adds selection encode/decode + “resolve latest valid selection” helper logic. |
| dashboard/src/pages/Hardware/HardwareRevisionSelectors.tsx | New tree/branch/revision combobox selector UI component. |
| dashboard/src/pages/Hardware/HardwareListingPageV2.tsx | Switches v2 listing to selector-driven fetching and URL-updating handlers. |
| dashboard/src/locales/messages/index.ts | Adds i18n strings for selector labels and revision-specific empty/reset messaging. |
| dashboard/src/components/ui/popover.tsx | Adds Radix popover UI primitive wrapper used by the combobox UI. |
| dashboard/src/components/ui/command.tsx | Adds cmdk-based command UI primitive wrapper used by the combobox UI. |
| dashboard/src/api/hardware.ts | Adds hooks to fetch selectors and fetch listing-by-revision. |
| dashboard/pnpm-lock.yaml | Locks newly added @radix-ui/react-popover and cmdk dependencies. |
| dashboard/package.json | Adds @radix-ui/react-popover and cmdk dependencies. |
| backend/kernelCI_app/views/hardwareSelectorsView.py | New selectors endpoint view (sanitizes raw DB rows into response model). |
| backend/kernelCI_app/views/hardwareByRevisionView.py | New listing-by-revision endpoint view. |
| backend/kernelCI_app/urls.py | Adds new API routes and extends cache wrapper to accept per-route timeout. |
| backend/kernelCI_app/typeModels/hardwareSelectors.py | Pydantic models for selectors endpoint params/response. |
| backend/kernelCI_app/typeModels/hardwareListingByRevision.py | Pydantic models for listing-by-revision endpoint params. |
| backend/kernelCI_app/tests/unitTests/url_patterns_test.py | Adds URL pattern test for the new selectors route. |
| backend/kernelCI_app/queries/hardware.py | Adds SQL queries for selectors and listing-by-revision. |
Files not reviewed (1)
- dashboard/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ORDER BY | ||
| qr.tree_name ASC, | ||
| branch_latest_start_time DESC, | ||
| qr.latest_start_time DESC | ||
| """ |
There was a problem hiding this comment.
Kind of a design decision for now, we may look into optimized approaches later on
8313347 to
6595cd4
Compare
…date hardware-by-revision path cache duration
6595cd4 to
ce60bfc
Compare
| return cursor.fetchall() | ||
|
|
||
|
|
||
| def get_hardware_selectors(origin: str) -> list[dict]: |
There was a problem hiding this comment.
Cant we make this faster, if we just fetch the list of trees associated with a single hardware?
And lazily fetch branches and revisions as needed?
There was a problem hiding this comment.
In worst case scenario, we could just return a list of all tree/branches, and let the filter do its job and return empty if the user selects a combination not available for the hardware listing.
| 'hardwareListing.branchSelectorLabel': 'Branch', | ||
| 'hardwareListing.description': 'List of hardware from kernel tests', | ||
| 'hardwareListing.notFound': 'No hardware information available', | ||
| 'hardwareListing.revisionCapNote': 'Showing latest 50 revisions', |
There was a problem hiding this comment.
are we limiting the list of revisions?
There was a problem hiding this comment.
We are not, forgot to remove after some changes
| ) | ||
| def get(self, request: Request): | ||
| try: | ||
| query_params = HardwareListingByRevisionQueryParams( |
There was a problem hiding this comment.
we might have similar endpoints here, from the #1902 , we will have to check if we can reuse them
Allows the user to select a specific tree/branch/commit on the hardware page to filter data