Skip to content

feat(BA-5590): add paginated REST v2 project scoped search endpoints#10787

Closed
hhoikoo wants to merge 2 commits intomainfrom
feat/BA-5590/project-scoped-search-endpoints
Closed

feat(BA-5590): add paginated REST v2 project scoped search endpoints#10787
hhoikoo wants to merge 2 commits intomainfrom
feat/BA-5590/project-scoped-search-endpoints

Conversation

@hhoikoo
Copy link
Copy Markdown
Member

@hhoikoo hhoikoo commented Apr 4, 2026

resolves #10785 (BA-5590)

Add two new paginated REST v2 endpoints for project-scoped search:

  • POST /v2/projects/domains/{domain_name}/search -- search projects within a domain
  • POST /v2/projects/users/{user_id}/search -- search projects a user belongs to

Both endpoints accept offset-based pagination (limit/offset), filters, and ordering via SearchProjectsRequest. The implementation adds:

  • ProjectAdapter.domain_search() and ProjectAdapter.user_search() adapter methods, plus a shared _build_search_querier() helper that converts the request DTO into a BatchQuerier with OffsetPagination.
  • V2ProjectHandler.domain_search() and V2ProjectHandler.user_search() REST handler methods.
  • Route registrations in the project registry (both guarded by auth_required).

The underlying processor actions (SearchProjectsByDomainAction, SearchProjectsByUserAction) already exist on the epic branch; this PR wires them to the REST v2 surface.

Checklist: (if applicable)

  • Mention to the original issue
  • Test case(s) to:
    • Demonstrate the difference of before/after
    • Demonstrate the flow of abstract/conceptual models with a concrete implementation

@hhoikoo hhoikoo self-assigned this Apr 4, 2026
Copilot AI review requested due to automatic review settings April 4, 2026 09:36
Copy link
Copy Markdown
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

Note

Copilot was unable to run its full agentic suite in this review.

Adds REST v2 handlers and routes for paginated “scoped” project search, enabling clients to search projects within a domain or within a user’s memberships.

Changes:

  • Register two new POST routes under /v2/projects for domain-scoped and user-scoped search.
  • Add REST handlers that forward requests to the project adapter.
  • Implement adapter methods that convert request DTOs into offset pagination queries and return paginated payloads.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

File Description
src/ai/backend/manager/api/rest/v2/project/registry.py Registers the new scoped search endpoints and wires them to handlers.
src/ai/backend/manager/api/rest/v2/project/handler.py Adds REST handlers for domain/user scoped project search.
src/ai/backend/manager/api/adapters/project.py Implements adapter-side scoped search logic and pagination payload mapping.
changes/10787.feature.md Adds changelog entry for the new paginated scoped search endpoints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hhoikoo hhoikoo force-pushed the feat/BA-5590/project-scoped-search-endpoints branch from 5092cc3 to c83f7b9 Compare April 4, 2026 10:04
@github-actions github-actions bot added size:M 30~100 LoC comp:manager Related to Manager component labels Apr 4, 2026
@hhoikoo
Copy link
Copy Markdown
Member Author

hhoikoo commented Apr 5, 2026

redundant. bridge holds superadmin credentials anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:manager Related to Manager component size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add paginated REST v2 project scoped search endpoints

2 participants