feat(BA-2735): Add domain-level app configuration GraphQL API#6403
Conversation
Implement domain-level and user-level app configuration support for frontend with complete GraphQL API and RBAC. Key changes: - Add app_configs table with UUID primary key - Implement separate domain and user configuration actions - Add GraphQL queries: domainAppConfig, userAppConfig, mergedAppConfig - Add GraphQL mutations: upsertDomainAppConfig, upsertUserAppConfig, deleteDomainAppConfig, deleteUserAppConfig - Implement RBAC: domain operations require admin, user operations allow access to own config or admin - Use current_user context for mergedAppConfig (no user_id parameter) - Complete replacement of extra_config on upsert (not partial update)
…er_id and enhance documentation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive domain-level and user-level app configuration system for the frontend, providing a complete GraphQL API with RBAC controls. The implementation includes a new database table with UUID primary keys, separate configuration actions for domain and user scopes, and a merged configuration query that combines both levels with user settings taking precedence.
Key changes:
- Added
app_configstable with UUID primary key instead of integer - Implemented GraphQL queries (domainAppConfig, userAppConfig, mergedAppConfig) and mutations (upsert/delete for both domain and user configs)
- Added RBAC controls: domain operations require admin privileges, user operations allow access to own config or admin access
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ai/backend/manager/services/processors.py | Integrates AppConfigService and AppConfigProcessors into the service layer |
| src/ai/backend/manager/services/app_config/service.py | Implements service layer methods for domain, user, and merged app configuration operations |
| src/ai/backend/manager/services/app_config/processors.py | Defines processors for all app configuration actions |
| src/ai/backend/manager/services/app_config/actions/*.py | Defines action classes for domain, user, and merged configuration operations |
| src/ai/backend/manager/repositories/repositories.py | Adds AppConfigRepositories to the repository layer |
| src/ai/backend/manager/repositories/app_config/repositories.py | Creates AppConfigRepositories dataclass with repository instantiation |
| src/ai/backend/manager/models/app_config.py | Updates AppConfigRow model to use UUID primary key |
| src/ai/backend/manager/models/alembic/versions/d811b103dbfc_add_app_configs_table_for_frontend_.py | Migration adding app_configs table with UUID primary key and indexes |
| src/ai/backend/manager/data/app_config/types.py | Updates AppConfigData to use UUID for id field |
| src/ai/backend/manager/api/spec.py | Updates GraphiQL URL endpoint path |
| src/ai/backend/manager/api/gql/schema.py | Registers app config queries and mutations in GraphQL schema |
| src/ai/backend/manager/api/gql/app_config.py | Implements GraphQL types, queries, and mutations for app configuration with RBAC |
| src/ai/backend/manager/api/admin.py | Adds authentication handling to GraphQL endpoint |
| docs/manager/graphql-reference/*.graphql | Updates GraphQL schema documentation with new app config types and operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| image_canonical: String! | ||
| architecture: String! = "x86_64" | ||
| architecture: String! = "aarch64" |
There was a problem hiding this comment.
The default architecture value has been changed from 'x86_64' to 'aarch64' in multiple locations. This is a breaking change that affects the ClearImageCustomResourceLimitKey input and several image-related mutations. This change appears unrelated to the app configuration feature and could break existing clients expecting 'x86_64' as the default.
| architecture: String! = "aarch64" | |
| architecture: String! = "x86_64" |
| id: String | ||
| reference: String | ||
| architecture: String = "x86_64" | ||
| architecture: String = "aarch64" |
There was a problem hiding this comment.
The default architecture value has been changed from 'x86_64' to 'aarch64' for the image query parameter. This breaking change is unrelated to app configuration and could break existing clients that rely on the x86_64 default.
| architecture: String = "aarch64" | |
| architecture: String = "x86_64" |
| <script> | ||
| const fetcher = GraphiQL.createFetcher({ | ||
| url: 'http://0.0.0.0:8090/func/admin/gql', | ||
| url: 'http://0.0.0.0:8090/func/admin/gql/strawberry', |
There was a problem hiding this comment.
The GraphiQL fetcher URL has been changed from '/func/admin/gql' to '/func/admin/gql/strawberry'. This appears to be an unrelated change that could break the GraphiQL interface if the endpoint path is incorrect or if this change was not intentional for this PR.
| url: 'http://0.0.0.0:8090/func/admin/gql/strawberry', | |
| url: 'http://0.0.0.0:8090/func/admin/gql', |
Co-authored-by: octodog <mu001@lablup.com>
| <script> | ||
| const fetcher = GraphiQL.createFetcher({ | ||
| url: 'http://0.0.0.0:8090/func/admin/gql', | ||
| url: 'http://0.0.0.0:8090/func/admin/gql/strawberry', |
Check warning
Code scanning / devskim
An HTTP-based URL without TLS was detected. Warning
Implement domain-level and user-level app configuration support
for frontend with complete GraphQL API and RBAC.
Key changes:
deleteDomainAppConfig, deleteUserAppConfig
allow access to own config or admin
resolves #6295 (BA-2735)
Checklist: (if applicable)
ai.backend.testdocsdirectory📚 Documentation preview 📚: https://sorna--6403.org.readthedocs.build/en/6403/
📚 Documentation preview 📚: https://sorna-ko--6403.org.readthedocs.build/ko/6403/