Skip to content

Commit 4b6a1a5

Browse files
jopemachineclaude
andcommitted
refactor(BA-5836): rename extra_config -> config across DTOs / service / adapter
Propagate the BA-5827 column rename through the service vertical: the bulk-mutation DTOs, the service's bulk methods, the bulk-item data classes, the adapter's data-to-DTO mapping, and the bulk-error field all now reference `config` instead of `extra_config`. Tracks the underlying JSONB column name for naming consistency end-to-end. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b568101 commit 4b6a1a5

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class AdminAppConfigFragmentItemInput(BaseRequestModel):
6363
"""Per-item input for admin bulk create / update (natural key + payload)."""
6464

6565
key: AppConfigFragmentKeyInput = Field(description="Natural-key identifier.")
66-
extra_config: dict[str, Any] = Field(
66+
config: dict[str, Any] = Field(
6767
default_factory=dict,
6868
description="Raw configuration payload (empty dict clears the row).",
6969
)
@@ -87,7 +87,7 @@ class MyAppConfigFragmentItemInput(BaseRequestModel):
8787
"""
8888

8989
name: str = Field(description="Policy name.")
90-
extra_config: dict[str, Any] = Field(
90+
config: dict[str, Any] = Field(
9191
default_factory=dict,
9292
description="Raw configuration payload (empty dict clears the row).",
9393
)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AppConfigFragmentNode(BaseResponseModel):
3333
scope_type: AppConfigScopeType = Field(description="Scope type.")
3434
scope_id: str = Field(description="Scope id.")
3535
name: str = Field(description="Policy name (FK target).")
36-
extra_config: dict[str, Any] | None = Field(
36+
config: dict[str, Any] | None = Field(
3737
default=None, description="Raw configuration payload, or null."
3838
)
3939
created_at: datetime = Field(description="Creation timestamp.")

src/ai/backend/manager/api/adapters/app_config_fragment.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def _data_to_dto(data: AppConfigFragmentData) -> AppConfigFragmentNode:
217217
scope_type=DTOAppConfigScopeType(data.scope_type.value),
218218
scope_id=data.scope_id,
219219
name=data.name,
220-
extra_config=dict(data.extra_config) if data.extra_config is not None else None,
220+
config=dict(data.config) if data.config is not None else None,
221221
created_at=data.created_at,
222222
updated_at=data.updated_at,
223223
)
@@ -235,7 +235,7 @@ async def admin_bulk_create(
235235
items = [
236236
AppConfigFragmentBulkItem(
237237
key=self._input_to_key(item.key),
238-
extra_config=dict(item.extra_config),
238+
config=dict(item.config),
239239
)
240240
for item in input.items
241241
]
@@ -254,7 +254,7 @@ async def admin_bulk_update(
254254
items = [
255255
AppConfigFragmentBulkItem(
256256
key=self._input_to_key(item.key),
257-
extra_config=dict(item.extra_config),
257+
config=dict(item.config),
258258
)
259259
for item in input.items
260260
]

src/ai/backend/manager/data/app_config_fragment/bulk_types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AppConfigFragmentBulkItem:
1414
"""One item for `adminBulkCreate/Update` — natural key + payload."""
1515

1616
key: AppConfigFragmentKey
17-
extra_config: Mapping[str, Any]
17+
config: Mapping[str, Any]
1818

1919

2020
@dataclass(frozen=True)
@@ -26,7 +26,7 @@ class MyAppConfigFragmentBulkItem:
2626
"""
2727

2828
name: str
29-
extra_config: Mapping[str, Any]
29+
config: Mapping[str, Any]
3030

3131

3232
@dataclass(frozen=True)

src/ai/backend/manager/services/app_config_fragment/service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ async def admin_bulk_create(
101101
failed: list[AppConfigFragmentBulkItemError] = []
102102
for index, item in enumerate(action.items):
103103
try:
104-
fragment = await self._admin_repository.create(item.key, item.extra_config)
104+
fragment = await self._admin_repository.create(item.key, item.config)
105105
created.append(fragment)
106106
except Exception as e:
107107
log.warning("admin_bulk_create item {} failed: {}", index, e)
@@ -125,7 +125,7 @@ async def admin_bulk_update(
125125
failed: list[AppConfigFragmentBulkItemError] = []
126126
for index, item in enumerate(action.items):
127127
try:
128-
fragment = await self._admin_repository.update(item.key, item.extra_config)
128+
fragment = await self._admin_repository.update(item.key, item.config)
129129
updated.append(fragment)
130130
except Exception as e:
131131
log.warning("admin_bulk_update item {} failed: {}", index, e)
@@ -185,7 +185,7 @@ async def my_bulk_create(
185185
name=item.name,
186186
)
187187
try:
188-
await self._admin_repository.create(key, item.extra_config)
188+
await self._admin_repository.create(key, item.config)
189189
merged = await self._repository.app_config(user_id, item.name)
190190
created.append(merged)
191191
except Exception as e:
@@ -219,7 +219,7 @@ async def my_bulk_update(
219219
name=item.name,
220220
)
221221
try:
222-
await self._admin_repository.update(key, item.extra_config)
222+
await self._admin_repository.update(key, item.config)
223223
merged = await self._repository.app_config(user_id, item.name)
224224
updated.append(merged)
225225
except Exception as e:

0 commit comments

Comments
 (0)