feat(BA-6921): AppConfig fragment write REST v2 API (CRUD)#12928
Open
jopemachine wants to merge 7 commits into
Open
feat(BA-6921): AppConfig fragment write REST v2 API (CRUD)#12928jopemachine wants to merge 7 commits into
jopemachine wants to merge 7 commits into
Conversation
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 16, 2026 09:01
82b529a to
2b22425
Compare
This was referenced Jul 16, 2026
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
2 times, most recently
from
July 16, 2026 09:23
bff6a0c to
c6c1db3
Compare
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 16, 2026 09:34
c6c1db3 to
53b60df
Compare
jopemachine
added a commit
that referenced
this pull request
Jul 16, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 16, 2026 09:51
53b60df to
436d45c
Compare
jopemachine
added a commit
that referenced
this pull request
Jul 16, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
jopemachine
added a commit
that referenced
this pull request
Jul 16, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 16, 2026 10:59
436d45c to
b180d8b
Compare
jopemachine
added a commit
that referenced
this pull request
Jul 16, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
jopemachine
commented
Jul 16, 2026
jopemachine
commented
Jul 16, 2026
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 16, 2026 11:06
b180d8b to
cc8fa8a
Compare
jopemachine
commented
Jul 16, 2026
jopemachine
added a commit
that referenced
this pull request
Jul 16, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
jopemachine
force-pushed
the
feat/BA-6555-app-config-merge-engine
branch
from
July 16, 2026 11:10
5b75d9e to
10388d5
Compare
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 16, 2026 11:10
cc8fa8a to
5fa07ce
Compare
jopemachine
added a commit
that referenced
this pull request
Jul 16, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
jopemachine
commented
Jul 16, 2026
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 16, 2026 11:30
5fa07ce to
2133188
Compare
5 tasks
jopemachine
force-pushed
the
feat/BA-6948-app-config-fragment-scope-id-uuid
branch
from
July 21, 2026 05:11
df4fe1e to
69fcb45
Compare
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 21, 2026 05:12
20f41dd to
d89d49e
Compare
jopemachine
force-pushed
the
feat/BA-6948-app-config-fragment-scope-id-uuid
branch
from
July 21, 2026 05:16
69fcb45 to
7c50d93
Compare
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
2 times, most recently
from
July 21, 2026 05:44
64f2d18 to
02c6786
Compare
jopemachine
force-pushed
the
feat/BA-6948-app-config-fragment-scope-id-uuid
branch
from
July 21, 2026 05:51
49be602 to
1d41686
Compare
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 21, 2026 05:52
02c6786 to
0aa5954
Compare
jopemachine
force-pushed
the
feat/BA-6948-app-config-fragment-scope-id-uuid
branch
from
July 21, 2026 06:00
1d41686 to
9c62736
Compare
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
3 times, most recently
from
July 21, 2026 07:55
8ea687e to
f0c7832
Compare
jopemachine
added a commit
that referenced
this pull request
Jul 21, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
2 times, most recently
from
July 21, 2026 09:22
1df2041 to
0b84b9a
Compare
jopemachine
added a commit
that referenced
this pull request
Jul 21, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
Base automatically changed from
feat/BA-6948-app-config-fragment-scope-id-uuid
to
main
July 21, 2026 10:02
Raw app_config_fragment write surface as REST v2: create / get / update / purge, backed by a dedicated AppConfigFragmentAdapter. Writes and single-fragment reads are open to any authenticated user and gated by RBAC at the processor (scope / single-entity / bulk validators): a user acts on their own user-scope, a domain admin on their domain's, a superadmin on any (public is superadmin-only). Wires the RBAC validators into AppConfigFragmentProcessors (previously ungated). Base of the split; the fragment search API and the merged-read (resolve) API (#12377) stack on top and reuse this entity's AppConfigFragmentNode DTO.
Merging the path id into the body DTO via model_copy() bypassed validation and declared a required body field that was always overwritten, so a mismatched id in the body was silently ignored and the OpenAPI spec advertised a field the handler discards. Pass the id as its own argument instead. The bulk item still carries its own id and is split out as AppConfigFragmentUpdateItem, leaving UpdateAppConfigFragmentInput as the single-fragment body. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The scope_type/scope_id agreement is the one piece of real logic in these DTOs: public must name no owner, domain and user must name one, and a blank id is as unusable as a missing one. Enumerate the full scope enum on both the accepted and the rejected side so a new scope variant cannot slip through untested. Also pin the update body split — the single-fragment body carries no id, while the bulk item does — and the min_length on both bulk batches. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follows the column becoming UUID NULL in BA-6948: the request and response DTOs take UUID | None, so a non-UUID scope_id is rejected at the boundary instead of reaching a row no scope query can find. The adapter no longer maps public to an empty-string sentinel in either direction — None is what the column stores. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Report a failed bulk item by the fragment id it targeted rather than its batch position. Every bulk item names its own fragment, so the id is what the caller can act on; an index makes them correlate the failure back by hand. - Declare _adapter at class scope, per the class-field rule in the root AGENTS.md. - Drop the FK detail from the config_name description. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The request body carries scope_id as a plain UUID, but the creator spec now takes an AppConfigScopeIdentifier — only scope_type says whether that UUID is a domain or a user. The adapter is the boundary that knows both, so it does the reading. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 21, 2026 10:04
0b84b9a to
0fef542
Compare
jopemachine
added a commit
that referenced
this pull request
Jul 21, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 21, 2026 10:15
0fef542 to
3b5c071
Compare
jopemachine
added a commit
that referenced
this pull request
Jul 21, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
BaseRequestModel only maps a pydantic ValidationError onto BackendAISchemaValidationFailed inside model_validate, and every production entry point — BodyParam, QueryParam, PathParam, headers — parses that way. The raw ValidationError the direct constructor raises is therefore unreachable in service, so accepting either exception let the tests pass on a rejection no caller can observe. Reject through model_validate and assert the one error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jopemachine
force-pushed
the
feat/BA-6921-app-config-fragment-rest-v2
branch
from
July 21, 2026 10:27
3b5c071 to
80e715c
Compare
jopemachine
added a commit
that referenced
this pull request
Jul 21, 2026
Fragment search surface, split out of the write PR (BA-6921, #12928): system-wide admin search (superadmin) and principal-scoped search (auth), with the filter/order/scope DTOs and the filter/order query converters. Stacks on BA-6921 and reuses its AppConfigFragmentNode DTO. The scoped search is the REST surface of the visible-fragments query (BA-6810).
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 (bottom-up):
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-6702): move fragment rank to the allow list with scope defaultsfeat(BA-6701): expose allow-list rank on the v2 API surfacefeat(BA-6704): cascade app config subtree deletion from the definitionfeat(BA-6626): app_config_fragment bulk repository layerfeat(BA-6618): app_config_fragment bulk CRUD service layerfeat(BA-6810): AppConfigFragment visible-fragments query (repository layer)feat(BA-6859): bind fragments to their RBAC scope on write (repository layer)fix(BA-6872): seedAPP_CONFIG_FRAGMENTpermissions into the RBAC role fixturechore(BA-6873): drop the dead APP_CONFIG RBAC entity typefeat(BA-6555): AppConfig merge engine + resolve service (service layer)feat(BA-6948): storeapp_config_fragments.scope_idas a nullable UUIDfeat(BA-6921): AppConfig fragment write REST v2 API (CRUD) ← you are herefeat(BA-6922): AppConfig fragment search REST v2 API (admin + scoped)feat(BA-6556): merged AppConfig REST v2 read APISummary
Raw
app_config_fragmentwrite surface as REST v2 — create / get / update / purge — split out of the original combined PR. Writes and single-fragment reads are open to any authenticated user and gated by RBAC at the processor (a user acts on their ownuser-scope, a domain admin on their domain's, a superadmin on any;publicis superadmin-only).What's included
common/dto/manager/v2/app_config_fragment/): create / update / purge inputs,AppConfigFragmentNode, payloads.api/rest/v2/app_config_fragment/):POST /,GET|PATCH|DELETE /{fragment_id}— allauth_required.api/adapters/app_config_fragment/adapter.py): dedicatedAppConfigFragmentAdapter.AppConfigFragmentProcessorsnow injects the scope / single-entity / bulk RBAC validators (previously ungated).The search surface (admin + scoped) moved to #12930 (BA-6922); the merged read to #12377 (BA-6556) — both stack on this PR.
📚 Documentation preview 📚: https://sorna--12928.org.readthedocs.build/en/12928/
📚 Documentation preview 📚: https://sorna-ko--12928.org.readthedocs.build/ko/12928/
📚 Documentation preview 📚: https://sorna--12928.org.readthedocs.build/en/12928/
📚 Documentation preview 📚: https://sorna-ko--12928.org.readthedocs.build/ko/12928/
📚 Documentation preview 📚: https://sorna--12928.org.readthedocs.build/en/12928/
📚 Documentation preview 📚: https://sorna-ko--12928.org.readthedocs.build/ko/12928/