Skip to content

Conversation

@maxxgx
Copy link
Contributor

@maxxgx maxxgx commented Dec 2, 2025

📝 Description

Affected endpoints:

  • GET /jobs
  • GET /images
  • GET /models
  • GET /projects
  • GET /sinks
  • GET /sources
  • GET /snapshots

Example 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:

  • 🚀 New feature (non-breaking change which adds functionality)
  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🔄 Refactor (non-breaking change which refactors the code base)
  • ⚡ Performance improvements
  • 🎨 Style changes (code style/formatting)
  • 🧪 Tests (adding/modifying tests)
  • 📚 Documentation update
  • 📦 Build system changes
  • 🚧 CI/CD configuration
  • 🔧 Chore (general maintenance)
  • 🔒 Security update
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)

✅ Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • 📚 I have made the necessary updates to the documentation (if applicable).
  • 🧪 I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).
  • 🏷️ My PR title follows conventional commit format.

For more information about code review checklists, see the Code Review Checklist.

Copilot AI review requested due to automatic review settings December 2, 2025 14:58
Copy link
Contributor

Copilot AI left a 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 (limit and offset) to all list endpoints
  • Introduced Pagination model 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.

@maxxgx maxxgx linked an issue Dec 2, 2025 that may be closed by this pull request
Copilot AI review requested due to automatic review settings December 3, 2025 11:10
Copy link
Contributor

Copilot AI left a 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.py but the code creates a PyArrow table which belongs in dataset_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.

@maxxgx maxxgx force-pushed the max/pagination branch 2 times, most recently from 5cb5ffa to fc3dc22 Compare December 3, 2025 12:13
Copilot AI review requested due to automatic review settings December 3, 2025 12:13
Copy link
Contributor

Copilot AI left a 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.

Copilot AI review requested due to automatic review settings December 3, 2025 12:28
Copy link
Contributor

Copilot AI left a 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: Ma, Xiangxiang <xiangxiang.ma@intel.com>
Signed-off-by: Max Xiang <xiangxiang.ma@intel.com>
Signed-off-by: Colorado, Camilo <camilo.colorado@intel.com>
Copilot AI review requested due to automatic review settings December 3, 2025 12:58
Copy link
Contributor

Copilot AI left a 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.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

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>
@maxxgx maxxgx merged commit 51a89b7 into open-edge-platform:feature/geti-inspect Dec 4, 2025
21 checks passed
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.

📋 [TASK] Add pagination to all collection endpoints

3 participants