-
Notifications
You must be signed in to change notification settings - Fork 846
feat(inspect): adds pagination to all collection endpoints #3182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(inspect): adds pagination to all collection endpoints #3182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds pagination support to all collection endpoints in the application, allowing clients to retrieve large datasets in manageable chunks. The implementation includes offset-based pagination with configurable limits and metadata about total counts.
Key Changes:
- Added pagination parameters (
limitandoffset) to all list endpoints - Introduced
Paginationmodel to track offset, limit, count, and total items - Implemented streaming capability for internal use cases where pagination isn't needed
- Added comprehensive pagination tests for the job service
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
application/backend/src/pydantic_models/base.py |
Added Pagination model with offset, limit, count, and total fields |
application/backend/src/pydantic_models/*.py |
Added pagination field to all list response models (JobList, ProjectList, ModelList, etc.) |
application/backend/src/repositories/base.py |
Implemented get_all_count, get_all_pagination, and get_all_streaming methods in base repository |
application/backend/src/services/*.py |
Updated all service list methods to accept limit/offset and return paginated responses |
application/backend/src/api/endpoints/*.py |
Added limit/offset query parameters to all collection endpoints |
application/backend/src/api/dependencies/pagination_limit.py |
Created PaginationLimit dependency with default limit of 20 and max of 50 |
application/backend/tests/unit/services/test_job_service_pagination.py |
Added comprehensive pagination tests covering edge cases |
application/backend/tests/unit/**/*.py |
Updated all existing tests to work with new paginated responses |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 47 out of 47 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
application/backend/src/repositories/base.py:1
- This change is in the wrong file. The diff shows this is in
base.pybut the code creates a PyArrow table which belongs indataset_snapshot_service.py. This appears to be a diff presentation issue.
# Copyright (C) 2025 Intel Corporation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
application/ui/src/features/inspect/toolbar/sources/source-actions.component.tsx
Show resolved
Hide resolved
5cb5ffa to
fc3dc22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 40 out of 40 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e1c45db to
fc3dc22
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 40 out of 40 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>
Signed-off-by: Ma, Xiangxiang <xiangxiang.ma@intel.com>
Signed-off-by: Max Xiang <xiangxiang.ma@intel.com>
fc3dc22 to
7b8ebf7
Compare
Signed-off-by: Colorado, Camilo <camilo.colorado@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 47 out of 48 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
application/ui/src/features/inspect/toolbar/sources/source-actions.component.tsx
Show resolved
Hide resolved
application/ui/src/features/inspect/toolbar/sinks/sink-actions.component.tsx
Show resolved
Hide resolved
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Signed-off-by: Max Xiang <xiangxiang.ma@intel.com>
51a89b7
into
open-edge-platform:feature/geti-inspect
📝 Description
Affected endpoints:
GET /jobsGET /imagesGET /modelsGET /projectsGET /sinksGET /sourcesGET /snapshotsExample response with pagination:
curl -X GET 'http://localhost:8000/api/jobs?limit=3&offset=10' | jq .{ "jobs": [ { "id": "e0e10d3d-94b1-4038-abac-dba5db0b4fef", "project_id": "c9f94915-39bf-4f1d-846f-d157759d43dc", "type": "training", "progress": 100, "status": "failed", "payload": { "model_name": "padim", "device": "mps", "dataset_snapshot_id": null }, "message": "Job aborted due to application shutdown", "start_time": "2025-12-01T14:45:50", "end_time": "2025-12-02T13:49:29.896859" }, { "id": "9ffea121-88bb-4131-a603-67328eea987c", "project_id": "c9f94915-39bf-4f1d-846f-d157759d43dc", "type": "training", "progress": 100, "status": "failed", "payload": { "model_name": "padim", "device": "mps", "dataset_snapshot_id": null }, "message": "Job aborted due to application shutdown", "start_time": "2025-12-01T14:47:13", "end_time": "2025-12-02T13:49:29.899600" }, { "id": "1cdceca6-ed08-404b-bfc9-662732919419", "project_id": "c9f94915-39bf-4f1d-846f-d157759d43dc", "type": "training", "progress": 100, "status": "completed", "payload": { "model_name": "padim", "device": "mps", "dataset_snapshot_id": null }, "message": "Training completed successfully", "start_time": "2025-12-01T14:48:48", "end_time": "2025-12-01T14:49:35.513296" } ], "pagination": { "offset": 10, "limit": 3, "count": 3, "total": 16 } }Example
✨ Changes
Select what type of change your PR is:
✅ Checklist
Before you submit your pull request, please make sure you have completed the following steps:
For more information about code review checklists, see the Code Review Checklist.