Skip to content

Commit 104c0d9

Browse files
jopemachineclaude
andcommitted
feat(BA-5829): add AppConfigFragment + AppConfig GQL surface
Adds the GraphQL exposure for AppConfigFragment and the merged AppConfig view (BEP-1052 §2 / §5). Service / processor additions (only what the GQL layer needs that is not already in BA-5827): - Merged-view actions: get_user_app_config, search_user_app_configs, admin_search_app_configs (single-row + paginated reads of the computed AppConfig view). - Service methods + processor wiring + supported_actions for those three actions. Adapter additions: - Merged-view methods: get_user_app_config / my_app_configs / admin_search_app_configs / public_app_config_fragments. `my_*` pulls the user from current_user() inside the adapter. - Bulk-only `my` mutations: my_bulk_create / my_bulk_update — bulk admin variants are wired in BA-5827 already. DTO additions: - common/dto/manager/v2/app_config/* — AppConfigNode, GetUserAppConfigInput / Payload, SearchAppConfigsInput / Payload, SearchMyAppConfigsInput, BulkCreate/UpdateMyAppConfigFragmentsPayload (the my-bulk payloads live here because they carry AppConfigNode). GraphQL: - app_config package: AppConfigGQL, my/admin/public root resolvers. - app_config_fragment package: scope-bound + admin queries, bulk-only mutations (admin + my variants), AppConfigFragmentGQL + AppConfigScopeTypeGQL + filter/order/key inputs. - DataLoader: app_config_fragment_loader for N+1 batching. - schema.py: register the new root queries / mutations. Resolves BA-5829. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent df892f3 commit 104c0d9

24 files changed

Lines changed: 420 additions & 142 deletions

File tree

src/ai/backend/common/dto/manager/v2/app_config/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
AppConfig (merged view) DTOs v2 for Manager API.
2+
AppConfig (merged view) DTOs v2 for Manager API (BEP-1052 §5).
33
"""
44

55
from .request import (
@@ -11,9 +11,9 @@
1111
)
1212
from .response import (
1313
AppConfigNode,
14+
BulkCreateMyAppConfigFragmentsPayload,
15+
BulkUpdateMyAppConfigFragmentsPayload,
1416
GetUserAppConfigPayload,
15-
MyBulkCreateAppConfigFragmentsPayload,
16-
MyBulkUpdateAppConfigFragmentsPayload,
1717
SearchAppConfigsPayload,
1818
)
1919
from .types import (
@@ -28,8 +28,8 @@
2828
"AppConfigOrder",
2929
"AppConfigOrderField",
3030
"AppConfigScopeType",
31-
"MyBulkCreateAppConfigFragmentsPayload",
32-
"MyBulkUpdateAppConfigFragmentsPayload",
31+
"BulkCreateMyAppConfigFragmentsPayload",
32+
"BulkUpdateMyAppConfigFragmentsPayload",
3333
"GetUserAppConfigInput",
3434
"GetUserAppConfigPayload",
3535
"OrderDirection",

src/ai/backend/common/dto/manager/v2/app_config/request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Request DTOs for AppConfig (merged view) DTO v2.
2+
Request DTOs for AppConfig (merged view) DTO v2 (BEP-1052 §5).
33
"""
44

55
from __future__ import annotations
@@ -62,7 +62,7 @@ class SearchMyAppConfigsInput(_AppConfigSearchInputBase):
6262
"""Input for self-service merged-view search (`/v2/app-configs/my/search`).
6363
6464
The adapter pins the caller as the user scope; no `user_id` argument
65-
is accepted here.
65+
is accepted here (BEP-1052 §5 — `filter.userId` is ignored).
6666
"""
6767

6868

src/ai/backend/common/dto/manager/v2/app_config/response.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Response DTOs for AppConfig (merged view) DTO v2.
2+
Response DTOs for AppConfig (merged view) DTO v2 (BEP-1052 §5).
33
"""
44

55
from __future__ import annotations
@@ -17,15 +17,15 @@
1717

1818
__all__ = (
1919
"AppConfigNode",
20-
"MyBulkCreateAppConfigFragmentsPayload",
21-
"MyBulkUpdateAppConfigFragmentsPayload",
20+
"BulkCreateMyAppConfigFragmentsPayload",
21+
"BulkUpdateMyAppConfigFragmentsPayload",
2222
"GetUserAppConfigPayload",
2323
"SearchAppConfigsPayload",
2424
)
2525

2626

2727
class AppConfigNode(BaseResponseModel):
28-
"""Merged per-user AppConfig view.
28+
"""Merged per-user AppConfig view (BEP-1052 §5).
2929
3030
`fragments` are ordered low → high merge priority (matching the
3131
policy's `scope_sources`). `config` is the deep-merged result,
@@ -62,11 +62,11 @@ class SearchAppConfigsPayload(BaseResponseModel):
6262
has_previous_page: bool = Field(default=False, description="Whether there is a previous page.")
6363

6464

65-
class MyBulkCreateAppConfigFragmentsPayload(BaseResponseModel):
66-
"""Payload for `myBulkCreateAppConfigFragments`.
65+
class BulkCreateMyAppConfigFragmentsPayload(BaseResponseModel):
66+
"""Payload for `bulkCreateMyAppConfigFragments`.
6767
6868
Each successfully created row produces a recomputed merged
69-
`AppConfigNode`; failures are collected per-item.
69+
`AppConfigNode`; failures are collected per-item (BEP-1052 §3).
7070
"""
7171

7272
created: list[AppConfigNode] = Field(
@@ -75,8 +75,8 @@ class MyBulkCreateAppConfigFragmentsPayload(BaseResponseModel):
7575
failed: list[AppConfigFragmentBulkError] = Field(description="Per-item failures.")
7676

7777

78-
class MyBulkUpdateAppConfigFragmentsPayload(BaseResponseModel):
79-
"""Payload for `myBulkUpdateAppConfigFragments`."""
78+
class BulkUpdateMyAppConfigFragmentsPayload(BaseResponseModel):
79+
"""Payload for `bulkUpdateMyAppConfigFragments`."""
8080

8181
updated: list[AppConfigNode] = Field(
8282
description="Recomputed merged AppConfig views for each updated USER fragment.",

src/ai/backend/common/dto/manager/v2/app_config/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Common types for AppConfig (merged view) DTO v2.
2+
Common types for AppConfig (merged view) DTO v2 (BEP-1052 §5).
33
"""
44

55
from __future__ import annotations

0 commit comments

Comments
 (0)