feat(BA-5832): AppConfig v2 SDK + CLI (BEP-1052)#11295
Draft
jopemachine wants to merge 8 commits intoBA-5830from
Draft
feat(BA-5832): AppConfig v2 SDK + CLI (BEP-1052)#11295jopemachine wants to merge 8 commits intoBA-5830from
jopemachine wants to merge 8 commits intoBA-5830from
Conversation
jopemachine
added a commit
that referenced
this pull request
Apr 25, 2026
jopemachine
commented
Apr 25, 2026
jopemachine
commented
Apr 25, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 25, 2026
jopemachine
commented
Apr 25, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 25, 2026
Extends the legacy-AppConfig drop to the client side: - `client/v2/domains_v2/app_config.py` — `V2AppConfigClient` with `upsert_domain_config` / `delete_user_config` / etc. is removed alongside its `v2_registry` `@cached_property` wiring. - `client/cli/v2/app_config/` — legacy `./bai app-config get-domain`, `upsert-user`, etc. are removed from the CLI tree. - `common/dto/manager/v2/app_config/` — legacy DTO module (`UpsertDomainConfigInput`, `DeleteUserConfigPayload`, ...) is deleted. Per #11295 review: BEP-1052's new SDK / CLI / DTO surfaces will land in their own PRs and should not also have to repeal the legacy versions there.
jopemachine
added a commit
that referenced
this pull request
Apr 25, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 25, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 25, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 25, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 25, 2026
jopemachine
commented
Apr 26, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 26, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 26, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 26, 2026
3 tasks
jopemachine
added a commit
that referenced
this pull request
Apr 26, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 27, 2026
jopemachine
added a commit
that referenced
this pull request
Apr 27, 2026
…ed AppConfig SDK (`client/v2/domains_v2/`): - New `V2AppConfigPolicyClient` — `get`, `search`, `admin_bulk_create / update / purge` (BEP-1052 §3, bulk-only writes). - New `V2AppConfigFragmentClient` — `get` (POST /get with body-key), `scope_search`, `admin_search`, `admin_bulk_create / update / purge`. - Replace legacy `V2AppConfigClient` with the merged-view (BEP-1052 §5) surface — `my_get`, `my_search`, `admin_get`, `admin_search`, `my_bulk_create / update`. Old `upsert_*` / `delete_*` paths are removed (their backing endpoints were dropped in BA-5822). - Register all three clients in `V2ClientRegistry`. CLI (`client/cli/v2/`): - `bai v2 app-config-policy` — `get`, `search`. - `bai v2 admin app-config-policy` — `bulk-create / update / purge`, with `--items '{json}'` or `@file.json`. - `bai v2 app-config-fragment` — `get`, `scope-search`. - `bai v2 admin app-config-fragment` — `search`, `bulk-create / update / purge`. - `bai v2 app-config` (merged-view) — `my-get`. - `bai v2 my app-config` — `search`, `bulk-create`, `bulk-update`. - `bai v2 admin app-config` — `get`, `search`. - Replace the legacy `bai v2 app-config` commands (`get-domain` / `delete-domain` / `get-user` / `delete-user` / `get-merged`) — those REST endpoints are gone post BA-5822. All bulk write commands accept JSON list inputs via `--items` / `--keys` / `--config-names`, with `@path/to/file.json` shorthand for file-loaded payloads. The CLI surface follows `bai admin {entity}` for superadmin-only operations, `bai my {entity}` for self-service writes that act on the caller's own data, and `bai {entity}` for any-authenticated-user reads — mirrors the manager-side adapter convention. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
End users only interact with the merged AppConfig view (`my_get`,
`my_search` on `V2AppConfigClient`); raw fragment / policy reads were
just an API mirror without convention support. Removes:
- SDK `V2AppConfigFragmentClient.get` / `.scope_search` (the latter did
not match the per-scope `{scope}_search()` convention used by
`user.py`, `session.py`, `vfolder.py`, etc.)
- SDK `V2AppConfigPolicyClient.get` / `.search`
- CLI groups `./bai app-config-fragment` and `./bai app-config-policy`
Admin surface (`admin_search`, `admin_bulk_*`) is unchanged — both
clients keep the methods their `admin/` CLI counterparts call.
`list[dict]` was missing the value type parameter and `json.loads` returns `Any`, so mypy flagged 9 type-arg / no-any-return errors. Use `list[dict[str, Any]]` and `cast()` to keep CLAUDE.md's no-`# type: ignore` rule. Also picks up a stale BA-5829 ruff format on Fragment node.py from the JSON-scalar fix cascade.
… drop BEP refs - Type the admin AppConfig CLI's `user_id` argument and `--user-id` flag as `click.UUID` (was `str` parsed via `UUID(...)`); the SDK already takes `UUID` so this drops a redundant runtime parse and surfaces bad input at click parse time. Also wrap the search filter's `user_id` in `UUIDFilter`, matching the DTO shape. - Carry the `bulk_create_my` / `bulk_update_my` → `my_bulk_create` / `my_bulk_update` rename through the v2 SDK (`domains_v2/app_config.py`), the self-service CLI (`cli/v2/my/app_config.py`), and the remaining GQL / adapter / service touchpoints that leaked through `-X theirs` during the stack rebase. - Strip the residual `BEP-1052 §X` references from CLI / SDK docstrings and the GraphQL schema dump comments. Only the news fragments retain the BEP wording. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…le GQL leftovers The CLI helptext (`bulk-create` / `bulk-update`) and a few GQL type fields still referenced `extra_config`; align them with the column rename. Also refresh the schema dump for the residual `extraConfig` fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
📚 Stacked PRs
This PR is part of a 10-PR stack delivering BEP-1052. Merge in order:
chore(BA-5822): drop legacy AppConfig layerfeat(BA-5814): AppConfigPolicy foundationfeat(BA-5815): AppConfigPolicy GraphQLfeat(BA-5844): AppConfigPolicy REST v2feat(BA-5827): AppConfigFragment foundationfeat(BA-5836): AppConfigFragment service verticalfeat(BA-5829): AppConfigFragment + AppConfig GraphQLfeat(BA-5830): AppConfigFragment + AppConfig REST v2feat(BA-5832): AppConfig v2 SDK + CLI← you are herefeat(BA-5837): ValkeyCache for AppConfigFragment merged-view readsCI on intermediate PRs may show test churn since each one only lands a slice of the new layer. The full picture is guaranteed to build at the tip (#11298).
Summary
Adds the v2 SDK + v2 CLI surface for the three AppConfig entities introduced in BEP-1052.
SDK (
client/v2/domains_v2/)V2AppConfigPolicyClient(new)get/search/admin_bulk_create/admin_bulk_update/admin_bulk_purgeV2AppConfigFragmentClient(new)get(POST + body key) /scope_search/admin_search/admin_bulk_create/admin_bulk_update/admin_bulk_purgeV2AppConfigClient(rewritten)my_get/my_search/admin_get/admin_search/my_bulk_create/my_bulk_updateThe legacy
V2AppConfigClient(upsert_*/delete_*for domain / user) is replaced — its backing endpoints were dropped in #11265.All three clients are registered as
@cached_propertyonV2ClientRegistry.CLI (
client/cli/v2/)bai v2 app-config-policyget,searchbai v2 admin app-config-policybulk-create,bulk-update,bulk-purgebai v2 app-config-fragmentget,scope-searchbai v2 admin app-config-fragmentsearch,bulk-create,bulk-update,bulk-purgebai v2 app-configmy-getbai v2 my app-configsearch,bulk-create,bulk-updatebai v2 admin app-configget,searchLegacy
bai v2 app-config get-domain / delete-domain / get-user / delete-user / get-mergedare removed — their endpoints are gone post #11265.Bulk write commands accept JSON list inputs via
--items/--keys/--config-names, with@path/to/file.jsonshorthand:bai v2 admin app-config-policy bulk-create --items '[{"config_name":"theme","scope_sources":["public","user"]}]' bai v2 admin app-config-fragment bulk-purge --keys @keys.json bai v2 my app-config bulk-update --items @my-fragments.jsonResolves BA-5832.
📚 Documentation preview 📚: https://sorna--11295.org.readthedocs.build/en/11295/
📚 Documentation preview 📚: https://sorna-ko--11295.org.readthedocs.build/ko/11295/