Skip to content

feat(BA-5427): define VFolder filter and order-by GQL types#10604

Open
seedspirit wants to merge 4 commits intomainfrom
BA-5427
Open

feat(BA-5427): define VFolder filter and order-by GQL types#10604
seedspirit wants to merge 4 commits intomainfrom
BA-5427

Conversation

@seedspirit
Copy link
Contributor

Summary

  • Add VFolderFilter and VFolderOrder DTO classes to common/dto/manager/v2/vfolder/request.py with enum filter types for status and usage mode
  • Create gql/vfolder_v2/types/filters.py with VFolderV2FilterGQL (name, host, status, usage_mode, created_at + AND/OR/NOT operators), VFolderV2OrderFieldGQL enum, and VFolderV2OrderByGQL input
  • Update package-level __init__.py re-exports for both common DTO and manager GQL packages

Test plan

  • pants fmt passes
  • pants fix passes
  • pants lint --changed-since=origin/main passes
  • pants check passes in CI
  • Filter and order types are importable from package top-level

Resolves BA-5427

Copilot AI review requested due to automatic review settings March 26, 2026 22:04
@github-actions github-actions bot added size:L 100~500 LoC comp:manager Related to Manager component comp:common Related to Common component labels Mar 26, 2026
seedspirit added a commit that referenced this pull request Mar 26, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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

Adds DTO and GraphQL input types to support filtering and ordering of VFolder v2 queries (including AND/OR/NOT combinators).

Changes:

  • Introduce VFolderFilter / VFolderOrder request DTOs and enum filter DTOs (VFolderStatusFilter, VFolderUsageModeFilter)
  • Add Strawberry GraphQL filter/order-by inputs for VFolder v2 (VFolderV2FilterGQL, VFolderV2OrderByGQL, related enums/enum-filters)
  • Re-export new types from package-level __init__.py modules and add a changelog entry

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/ai/backend/manager/api/gql/vfolder_v2/types/filters.py Adds VFolder v2 GraphQL filter inputs, enum filters, and order-by types.
src/ai/backend/manager/api/gql/vfolder_v2/types/init.py Re-exports newly added GraphQL types from the types package.
src/ai/backend/manager/api/gql/vfolder_v2/init.py Re-exports GraphQL types from the vfolder_v2 package top-level.
src/ai/backend/common/dto/manager/v2/vfolder/types.py Adds DTO models for status/usage-mode enum filtering.
src/ai/backend/common/dto/manager/v2/vfolder/request.py Adds DTO models for VFolder filtering and ordering (AND/OR/NOT support).
src/ai/backend/common/dto/manager/v2/vfolder/init.py Re-exports new common DTOs from the vfolder package top-level.
changes/10604.feature.md Documents the new VFolder v2 filter/order-by GraphQL types.

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

@seedspirit seedspirit requested a review from a team March 27, 2026 00:54
@github-actions github-actions bot added size:XL 500~ LoC and removed size:L 100~500 LoC labels Mar 27, 2026
@jopemachine
Copy link
Member

How is the change to ScopeChainPermissionCheckInput related to adding VFolder filter and order? It would be better to handle it in a separate PR from the type addition.

- Add VFolderFilter and VFolderOrder DTO classes to common/dto/v2/vfolder/request.py
- Add VFolderV2FilterGQL with StringFilter, DateTimeFilter, enum filters, AND/OR/NOT
- Add VFolderOperationStatusEnumGQL (9 statuses) and VFolderUsageModeEnumGQL (3 modes)
- Add VFolderV2OrderFieldGQL enum and VFolderV2OrderByGQL input
- Add gql_field with description to all not_in filter fields
- Default order direction: DESC (aligned across DTO and GQL layers)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added size:L 100~500 LoC and removed size:XL 500~ LoC labels Mar 27, 2026
@seedspirit seedspirit added this to the 26.4 milestone Mar 27, 2026
…olderV2Order

Append V2 suffix to follow the v2 DTO naming convention, as pointed
out in code review.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:common Related to Common component comp:manager Related to Manager component size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants