Skip to content

feat(BA-2735): Add domain-level app configuration GraphQL API#6403

Merged
HyeockJinKim merged 4 commits into
mainfrom
feat/add-domain-level-config-gql
Oct 26, 2025
Merged

feat(BA-2735): Add domain-level app configuration GraphQL API#6403
HyeockJinKim merged 4 commits into
mainfrom
feat/add-domain-level-config-gql

Conversation

@HyeockJinKim
Copy link
Copy Markdown
Collaborator

@HyeockJinKim HyeockJinKim commented Oct 26, 2025

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)

resolves #6295 (BA-2735)

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version
  • Mention to the original issue
  • Installer updates including:
    • Fixtures for db schema changes
    • New mandatory config options
  • Update of end-to-end CLI integration tests in ai.backend.test
  • API server-client counterparts (e.g., manager API -> client SDK)
  • Test case(s) to:
    • Demonstrate the difference of before/after
    • Demonstrate the flow of abstract/conceptual models with a concrete implementation
  • Documentation
    • Contents in the docs directory
    • docstrings in public interfaces and type annotations

📚 Documentation preview 📚: https://sorna--6403.org.readthedocs.build/en/6403/


📚 Documentation preview 📚: https://sorna-ko--6403.org.readthedocs.build/ko/6403/

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)
Copilot AI review requested due to automatic review settings October 26, 2025 07:04
@github-actions github-actions Bot added the size:XL 500~ LoC label Oct 26, 2025
@github-actions github-actions Bot added area:docs Documentations comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated labels Oct 26, 2025
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

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_configs table 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"
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
architecture: String! = "aarch64"
architecture: String! = "x86_64"

Copilot uses AI. Check for mistakes.
id: String
reference: String
architecture: String = "x86_64"
architecture: String = "aarch64"
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
architecture: String = "aarch64"
architecture: String = "x86_64"

Copilot uses AI. Check for mistakes.
<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',
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
url: 'http://0.0.0.0:8090/func/admin/gql/strawberry',
url: 'http://0.0.0.0:8090/func/admin/gql',

Copilot uses AI. Check for mistakes.
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

Insecure URL
@HyeockJinKim HyeockJinKim added this pull request to the merge queue Oct 26, 2025
Merged via the queue into main with commit 147ce90 Oct 26, 2025
31 checks passed
@HyeockJinKim HyeockJinKim deleted the feat/add-domain-level-config-gql branch October 26, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentations comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GraphQL API for domain-level configuration management

3 participants