Skip to content

Commit 42db4d6

Browse files
jopemachineclaude
andcommitted
refactor(BA-5837): rename user_domain_name -> get_user_domain_name
The lookup is a single-column fetch helper (not an entity getter), so the explicit `get_` prefix matches sister DB-source helpers and reads naturally at the call site. Update the only caller in `AppConfigFragmentRepository.app_config` accordingly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 16b8400 commit 42db4d6

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/ai/backend/manager/repositories/app_config_fragment/db_source/db_source.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,18 @@ async def get_by_id(self, id: uuid.UUID) -> AppConfigFragmentData | None:
104104
return row.to_data() if row is not None else None
105105

106106
@app_config_fragment_db_source_resilience.apply()
107-
async def user_domain_name(self, user_id: uuid.UUID) -> str | None:
107+
async def get_user_domain_name(self, user_id: uuid.UUID) -> str | None:
108108
"""Single-column lookup of a user's `domain_name`.
109109
110110
Used by the cache layer to tag merged-view entries with their
111111
owning domain so domain-scoped fragment writes can target a
112112
bounded user set during invalidation.
113113
"""
114114
async with self._db.begin_readonly_session() as db_sess:
115-
return await db_sess.scalar(
115+
domain_name: str | None = await db_sess.scalar(
116116
sa.select(UserRow.domain_name).where(UserRow.uuid == user_id)
117117
)
118+
return domain_name
118119

119120
@app_config_fragment_db_source_resilience.apply()
120121
async def create(self, creator: Creator[AppConfigFragmentRow]) -> AppConfigFragmentData:

src/ai/backend/manager/repositories/app_config_fragment/repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ async def app_config(
116116

117117
merged = await self._db_source.get_user_app_config(user_id, config_name)
118118
if self._cache_source is not None:
119-
domain_name = await self._db_source.user_domain_name(user_id)
119+
domain_name = await self._db_source.get_user_domain_name(user_id)
120120
await self._cache_source.set_merged_config(merged, domain_name=domain_name)
121121
return merged
122122

0 commit comments

Comments
 (0)