fix(BA-6922): pluralize the app config allow-list REST v2 prefix#13034
Closed
jopemachine wants to merge 2 commits into
Closed
fix(BA-6922): pluralize the app config allow-list REST v2 prefix#13034jopemachine wants to merge 2 commits into
jopemachine wants to merge 2 commits into
Conversation
Every REST v2 entity collection is registered under a plural prefix — `app-config-definitions`, `app-config-fragments`, `resource-policies`, `model-cards` — except `app-config-allow-list`, which was singular. Rename it to `app-config-allow-lists` across the route registry, the SDK path and its tests. The CLI command name stays singular (`bai admin app-config-allow-list`), matching every other v2 admin group: `resource-policy`, `model-card`, `app-config-definition`. Also record why the allow-list and definition registries have no scoped search counterpart to `/search`. The convention pairs a superadmin `/search` with a scoped variant, and both omit it — deliberately, since they are admin-only entities that a non-admin reads through the app config resolve path rather than querying directly. Saying so keeps the omission from reading as an oversight. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jopemachine
marked this pull request as draft
July 22, 2026 07:58
Contributor
There was a problem hiding this comment.
Pull request overview
Pluralizes the REST v2 app-config allow-list collection prefix and updates consumers and documentation accordingly.
Changes:
- Renames the route to
/v2/app-config-allow-lists. - Updates the SDK, tests, OpenAPI specification, and changelog.
- Documents why scoped search is omitted for admin-only entities.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit/client_v2/test_app_config_allow_list.py |
Updates SDK path assertions. |
src/ai/backend/manager/api/rest/v2/app_config_definition/registry.py |
Documents scoped-search omission. |
src/ai/backend/manager/api/rest/v2/app_config_allow_list/registry.py |
Renames the route prefix and adds rationale. |
src/ai/backend/client/v2/domains_v2/app_config_allow_list.py |
Updates the SDK endpoint prefix. |
docs/manager/rest-reference/openapi.json |
Regenerates affected OpenAPI paths. |
changes/13034.breaking.md |
Records the breaking route rename. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+22
to
+24
| The allow-list is an admin-only entity — every route is ``superadmin_required`` — so | ||
| it carries no scoped search counterpart to ``/search``. A non-admin never queries the | ||
| allow-list directly; it is read through the app config resolve path. |
Comment on lines
+22
to
+24
| A config definition is an admin-only entity — every route is ``superadmin_required`` — | ||
| so it carries no scoped search counterpart to ``/search``. A non-admin never queries | ||
| definitions directly; they are read through the app config resolve path. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #12929 (BA-6922)
Summary
Two REST v2 convention gaps in the app config family, found while reviewing the fragment search surface.
1.
app-config-allow-listwas the only singular entity prefix. Every other v2 entity collection is plural:/v2/app-config-allow-list/v2/app-config-allow-listsapp-config-definitions,app-config-fragments,resource-policies,model-cards,runtime-variants, …Renamed across the route registry, the SDK
_PATH, its tests, andopenapi.json. The CLI command name stays singular (bai admin app-config-allow-list) — every v2 admin group is singular there (resource-policy,model-card,app-config-definition), so the CLI was already right.2. The missing scoped search on allow-list and definition is now stated, not implied.
api/rest/v2/AGENTS.mdsays a search always comes in two variants — a superadmin/searchand a scoped one — and both registries only have the first. That is correct here: both are admin-only entities (every route issuperadmin_required) and a non-admin reads them through the app config resolve path rather than querying them. The registry docstrings now say so, so the omission does not read as an oversight to the next person checking the convention.Breaking change
/v2/app-config-allow-list/*→/v2/app-config-allow-lists/*. The bundled SDK is updated in the same commit, sobaiand the Python client keep working; any caller hitting the raw path needs the new one.Not in this PR
POST /v2/app-config-fragments/scoped-searchdoes not match either documented form — the current/{entity}/{scope_type}/{scope_id}/searchor the forward/{entity}/scoped/search(cf.scheduling-history's/kernels/scoped/search). That route is added by #13020 and does not exist onmain, so it cannot be fixed from amain-based branch; it is corrected on that PR instead.Test plan
openapi.jsonregenerated with./backend.ai mgr api dump-openapi; the delta is exactly the three allow-list pathserrors/app_config.pykeepsprobs/app-config-allow-list-not-found, which is an error-type URN, not a route)🤖 Generated with Claude Code