Skip to content

feat: labs listing#1985

Draft
felipebergamin wants to merge 4 commits into
kernelci:mainfrom
profusion:feat/1966/labs-listing-page
Draft

feat: labs listing#1985
felipebergamin wants to merge 4 commits into
kernelci:mainfrom
profusion:feat/1966/labs-listing-page

Conversation

@felipebergamin

@felipebergamin felipebergamin commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Blocked by #1968

Visual reference

Screen.Recording.2026-07-20.at.09.55.25.mov
Screenshot 2026-07-20 at 09 52 21 Screenshot 2026-07-20 at 09 45 02

@felipebergamin
felipebergamin force-pushed the feat/1966/labs-listing-page branch from 48b98a2 to 017dd23 Compare July 10, 2026 17:02
Comment thread backend/kernelCI_app/queries/labs.py Outdated
}

query = """
WITH build_counts AS (

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 might be able to simplify those queries with something on the lines of

SELECT 
    COALESCE(labs.name, tests.misc->>'runtime') AS lab,
    CASE
        WHEN status IN ('PASS', 'FAIL') THEN status
        ELSE 'INCONCLUSIVE'
    END AS test_status,
    count(*) as test_count
FROM tests
left join labs on labs.id = tests.lab_id
WHERE COALESCE(labs.name, tests.misc->>'runtime') IS NOT null
GROUP BY 
    lab,
    test_status;

Comment thread dashboard/src/pages/Labs/LabsTable.tsx Outdated
import type { LabsListingRoutesMap } from '@/utils/constants/labsListing';

const statusCell = (
summary: LabListingItem['build_status_summary'],

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.

the type shouldnt be a ShortStatusCount here?

from kernelCI_app.queries.labs import get_lab_listing_data


class TestGetLabListingData:

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 dont know if this test aggregates much. Might be better to add Integration tests for database query tests.

end_date=ANY,
)
self.assertEqual(response.data["labs"][0]["lab_name"], "lab-collabora")
self.assertEqual(response.data["labs"][0]["build_status_summary"]["PASS"], 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.

might be worth it checking asserting response here

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.

*the full response

)


class LabListingQueryParams(BaseModel):

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.

Might be worth to checking if we can use ListingQueryParams, this way we would keep the same interface as similar listings.

Comment thread backend/kernelCI_app/views/labView.py Outdated
status_code=HTTPStatus.OK,
)
except ValidationError as e:
return Response(data=e.json(), status=HTTPStatus.INTERNAL_SERVER_ERROR)

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.

nit: there is a helper that other views are using create_error_reponse.

Comment thread dashboard/src/types/lab.ts Outdated
test_status_summary: ShortStatusCount;
};

export type LabListingApiItem = LabListingItem;

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.

Why are we exporting the same type twice here?

felipebergamin and others added 4 commits July 17, 2026 18:35
Part of kernelci#1966

Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
Closes kernelci#1966

Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi>
Signed-off-by: Felipe Bergamin <felipebergamin6@gmail.com>
Signed-off-by: Felipe Bergamin <felipebergamin6@gmail.com>
@felipebergamin
felipebergamin force-pushed the feat/1966/labs-listing-page branch from 017dd23 to 7d53fde Compare July 17, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants