feat(BA-6555): add app_config service layer#12359
Draft
jopemachine wants to merge 2 commits into
Draft
Conversation
b40117b to
870a98b
Compare
This was referenced Jun 23, 2026
296a9a0 to
07bafd2
Compare
1777f48 to
9dc1da7
Compare
47878cb to
ae7f25f
Compare
9dc1da7 to
59a0a70
Compare
e9f0e1b to
684601c
Compare
59a0a70 to
7694f19
Compare
684601c to
e5986d3
Compare
7694f19 to
02106ca
Compare
e5986d3 to
cb34649
Compare
jopemachine
commented
Jun 23, 2026
94e2ca4 to
08e919c
Compare
fb7af85 to
4b9ce45
Compare
jopemachine
commented
Jun 23, 2026
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
| class AppConfigResolveScope: |
Member
Author
There was a problem hiding this comment.
AppConfigScopeArguments
6d5b0cc to
18135f0
Compare
2d822bb to
408d923
Compare
18135f0 to
24c5952
Compare
7e5ab1d to
847de39
Compare
704bd3f to
05aeedf
Compare
f3e9bed to
cc90dc1
Compare
05aeedf to
961eeff
Compare
f67bb21 to
25fc7ff
Compare
961eeff to
5c94da3
Compare
25fc7ff to
2a8bd46
Compare
5c94da3 to
5499abb
Compare
2a8bd46 to
933610d
Compare
5499abb to
82bc893
Compare
933610d to
60bf490
Compare
82bc893 to
14e30cf
Compare
60bf490 to
c86a0c7
Compare
14e30cf to
ab5c6fd
Compare
c86a0c7 to
ab11cd9
Compare
ab5c6fd to
b0fed49
Compare
ab11cd9 to
5e78703
Compare
b0fed49 to
3a9f1a1
Compare
5e78703 to
ce8e7a0
Compare
3a9f1a1 to
43f39c1
Compare
… fragments) Adds the read-side AppConfigService.resolve: fetches the fragments visible to a (domain, user) principal for one config_name (list_visible_fragments, via the by_*_visibility conditions) and deep-merges them in rank order; AppConfigResolveScope bundles the principal. Rebased onto the domain/user-keyed scoped_search (BA-6554): ConfigNameSearchScope is gone, so the merged read relies on the visibility conditions. Squash of the BA-6555 development history, re-based onto the updated BA-6554. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add AppConfigService.resolve_bulk + ResolveBulkAppConfigAction (USER ScopeAction taking config_names): resolve several merged AppConfigs for one (domain, user) principal in a single query. AppConfigFragmentRepository.list_visible_fragments_bulk fetches the visible fragments of all names at once ((config_name, rank)-ordered); the service groups by name and deep-merges each, returning one AppConfigData per requested name in order. This is the bulk-query path (no scoped search over merged AppConfig, per BA-6614). Co-Authored-By: Claude Opus 4.8 (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
Part of the AppConfigFragment / AppConfig stack under BEP-1052 (epic BA-5781). Merge in order:
feat(BA-6552): app_config_fragments DB model and Alembic migrationfeat(BA-6553): repository layerrefactor(BA-6619): consolidate AppConfigScopeType into common.datarefactor(BA-6620): ExistsQuerier + AppConfigAllowList.existsfeat(BA-6554): AppConfigFragment service layerfeat(BA-6628): conditional-bulk repository primitivesfeat(BA-6626): app_config_fragment bulk repository layerfeat(BA-6618): AppConfigFragment bulk CRUD service layerfeat(BA-6555): app_config service layer← you are herefeat(BA-6556): AppConfig REST v2 APISummary
Adds the app_config service layer (BA-6555) — resolving the merged
AppConfigfor a(user, config_name). This is the read foundation the REST/GQL read endpoints (BA-6556 / BA-6557) build on.What's included
services/app_config/merge.py): applicable fragments are ordered byrank(low → high) and deep-merged — nested objects recurse, scalars and lists are wholesale-replaced, higherrankwins on conflict. An empty merge result projects tonull(clients fall back to built-in defaults).AppConfigFragment(one raw row) is unchanged; newAppConfigDatais the merged per-user view — the ordered contributingfragmentsplus the deep-mergedconfig.ApplicableAppConfigScope+repository.list_applicable_fragments): a single join-free, rank-ordered query selecting everypublicfragment, the user'sdomainfragment, and the user's ownuserfragment for the name. No allow-list / policy lookup at read time (per BEP-1052); an unregistered name simply yields an empty merge.resolveaction / processor returning the mergedAppConfigData.resolveservice path, and the applicable-fragments query against a real DB.Read variants (single is here; self-search / admin cross-user search) and the HTTP surface land in BA-6556 (REST v2) and BA-6557 (GraphQL).