feat(BA-6702): move fragment rank to the allow list with scope defaults#12516
Merged
Conversation
jopemachine
added a commit
that referenced
this pull request
Jul 3, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 3, 2026
69e564b to
76f61f2
Compare
This was referenced Jul 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR relocates the app-config merge-priority rank from the partly user-owned app_config_fragments table to the admin-owned app_config_allow_list table, so a fragment owner can no longer re-order the merge by editing their own fragment. It is the DB/model step of the BEP-1052 AppConfigFragment stack (API exposure and the FK/cascade land in the follow-up PRs #12517 and #12518).
Changes:
- Adds
ranktoAppConfigAllowListRow/AppConfigAllowListDatawith scope-type defaults (public=100,domain=200,user=300 via the newAppConfigScopeType.default_rank()) and an optional explicit override onAppConfigAllowListCreatorSpec; dropsrankfrom the fragment row/data and simplifiesAppConfigFragmentCreatorSpecto a plainCreatorSpec(no moreNextValuePolicynext-value assignment). - Migration
66d0f891ed20adds/backfills allow-listrankand drops fragmentrank, with a symmetric (lossy, documented) downgrade. - Updates BEP-1052, the changelog fragment, and the repository/service tests to match the new rank placement.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
common/data/app_config/types.py |
Adds default_rank() scope-type default source (100/200/300). |
manager/models/app_config_allow_list/row.py |
Adds non-null rank column + to_data() mapping; updates docstring. |
manager/models/app_config_allow_list/orders.py |
Adds rank query order. |
manager/data/app_config_allow_list/types.py |
Adds rank to the allow-list data type. |
manager/repositories/app_config_allow_list/creators.py |
Optional rank with scope-type default fallback. |
manager/models/app_config_fragment/row.py |
Removes rank column and mapping. |
manager/models/app_config_fragment/orders.py |
Removes the rank order. |
manager/data/app_config_fragment/types.py |
Removes rank from fragment data. |
manager/repositories/app_config_fragment/creators.py |
Becomes plain CreatorSpec (no next-value rank). |
manager/repositories/app_config_fragment/db_source/db_source.py |
Drops NextValuePolicy; plain Creator after the write gate. |
manager/repositories/app_config_fragment/updaters.py, services/.../actions/update.py |
Docstring updates reflecting rank move. |
manager/models/alembic/versions/66d0f891ed20_*.py |
Migration moving rank between tables with backfill + downgrade. |
proposals/BEP-1052-scoped-app-config-redesign.md |
Documents rank placement, scope defaults, join-based read merge. |
changes/12516.feature.md |
Changelog fragment. |
tests/unit/manager/.../app_config_allow_list/*, .../app_config_fragment/* |
Adds allow-list rank tests; removes fragment rank tests; seeds allow-list ranks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # revision identifiers, used by Alembic. | ||
| revision = "66d0f891ed20" | ||
| down_revision = "a379b72f1206" | ||
| # Part of: NEXT_RELEASE_VERSION |
76f61f2 to
974923c
Compare
974923c to
76f61f2
Compare
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
76f61f2 to
367f886
Compare
HyeockJinKim
approved these changes
Jul 6, 2026
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.
Summary
Applies the review feedback on the AppConfigFragment stack. Replaces #12429 — the conditional-bulk repository primitives are dropped from the stack; the rank redesign lands first instead. Split for review into three PRs: this one (DB/model rank move), #12517 (API surface), and #12518 (FK + cascade).
rankmoves fromapp_config_fragmentstoapp_config_allow_list. Fragment writes are partly user-owned (an allow-listed user manages their ownuser-scope fragment), so a rank on the fragment would let the owner re-order the merge. Merge priority is admin policy — it now lives on the admin-owned allow-list entry, and fragments carry no rank of their own.rankby scope type —public=100,domain=200,user=300 — so a user's own fragment wins the merge by default; an explicit rank may be passed throughAppConfigAllowListCreatorSpec(API exposure comes in feat(BA-6701): expose allow-list rank on the v2 API surface #12517).config_namenext-value rank assignment (NextValuePolicy, lock on the definition row) is gone;AppConfigFragmentCreatorSpecbecomes a plainCreatorSpec. The allow-list write gates are untouched here (feat(BA-6704): cascade app config subtree deletion from the definition #12518 revisits them together with the FK).66d0f891ed20: addsapp_config_allow_list.rank(backfilled by scope-type default) and dropsapp_config_fragments.rank. Downgrade restores fragment ranks from their allow-list entry (scope-type default fallback for orphans). Verified up/down against a local DB with seeded data.📚 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-6702): move fragment rank to the allow list with scope defaults(replaces feat(BA-6628): conditional-bulk repository primitives #12429) ← you are herefeat(BA-6628): expose allow-list rank on the v2 API surfacefeat(BA-6628): cascade fragment deletion from the allow listfeat(BA-6626): app_config_fragment bulk repository layerfeat(BA-6618): AppConfigFragment bulk CRUD service layerfeat(BA-6555): app_config service layer (merge engine)feat(BA-6556): AppConfig REST v2 API🤖 Generated with Claude Code
📚 Documentation preview 📚: https://sorna--12516.org.readthedocs.build/en/12516/
📚 Documentation preview 📚: https://sorna-ko--12516.org.readthedocs.build/ko/12516/
📚 Documentation preview 📚: https://sorna--12516.org.readthedocs.build/en/12516/
📚 Documentation preview 📚: https://sorna-ko--12516.org.readthedocs.build/ko/12516/