feat(BA-5349): add GraphQL query for entity-operation combinations#10537
Open
feat(BA-5349): add GraphQL query for entity-operation combinations#10537
Conversation
fregataa
added a commit
that referenced
this pull request
Mar 26, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new RBAC-focused GraphQL query that exposes valid entity/action-name combinations derived from a centralized RBAC action registry, so the frontend can discover which actions are available per entity type.
Changes:
- Introduce
rbac_entity_operation_combinationsGraphQL root field and supporting GQL types/DTOs. - Extract shared
RBAC_ACTION_REGISTRYconstant and addbuild_operation_description()helper for human-readable action descriptions. - Add unit tests for the description builder and the new resolver (structure, sorting, and registry coverage).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/manager/api/gql/rbac/test_entity_operation_combinations.py | Adds unit tests for build_operation_description() and the new GraphQL resolver. |
| src/ai/backend/manager/services/factory.py | Switches permission controller wiring to use centralized RBAC_ACTION_REGISTRY. |
| src/ai/backend/manager/api/gql/schema.py | Registers the new rbac_entity_operation_combinations query in the main GraphQL schema. |
| src/ai/backend/manager/api/gql/rbac/types/permission.py | Adds GQL output types for operation info and entity-operation combinations. |
| src/ai/backend/manager/api/gql/rbac/types/init.py | Exposes the new RBAC GQL types via package exports. |
| src/ai/backend/manager/api/gql/rbac/resolver/permission.py | Implements the rbac_entity_operation_combinations resolver using RBAC_ACTION_REGISTRY. |
| src/ai/backend/manager/api/gql/rbac/resolver/init.py | Exports the new resolver. |
| src/ai/backend/manager/api/gql/rbac/init.py | Re-exports the new query field and types at the RBAC module level. |
| src/ai/backend/manager/actions/action/rbac.py | Adds build_operation_description() helper for action descriptions. |
| src/ai/backend/manager/actions/action/init.py | Introduces centralized RBAC_ACTION_REGISTRY constant and exports it. |
| src/ai/backend/common/dto/manager/v2/rbac/response.py | Adds DTOs for operation info and entity-operation combinations. |
| src/ai/backend/common/dto/manager/v2/rbac/init.py | Exposes the new DTOs via package exports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add rbac_entity_operation_combinations query that exposes valid entity-operation combinations from the RBAC action registry, enabling the frontend to discover available operations per entity. - Add build_operation_description() for human-readable descriptions - Add OperationInfo and EntityOperationCombinationInfo DTOs - Add OperationInfoGQL and EntityOperationCombinationGQL GQL types - Extract RBAC_ACTION_REGISTRY shared constant from factory.py - Register resolver on Query class - Add unit tests for description generation and resolver Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ations GQL query Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: octodog <mu001@lablup.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rbac_entity_operation_combinationsGraphQL query that exposes valid entity-operation combinations from the RBAC action registry, enabling the frontend to discover which operations are available per entity typeRBAC_ACTION_REGISTRYshared constant and addbuild_operation_description()for generating human-readable operation descriptionsOperationInfo,EntityOperationCombinationInfo), GQL types (OperationInfoGQL,EntityOperationCombinationGQL), and resolver following the existingrbac_scope_entity_combinationspatternTest plan
build_operation_description()covering all action names and underscored element typestests/unit/manager/api/gql/rbac::)pants fmt,pants fix,pants lintall passExample
Resolves BA-5349
🤖 Generated with Claude Code
📚 Documentation preview 📚: https://sorna--10537.org.readthedocs.build/en/10537/
📚 Documentation preview 📚: https://sorna-ko--10537.org.readthedocs.build/ko/10537/