Skip to content

feat(BA-6628): assign scope-type default ranks to allow-list entries#12539

Closed
jopemachine wants to merge 2 commits into
feat/BA-6628-allow-list-rankfrom
feat/BA-6628-scope-default-rank
Closed

feat(BA-6628): assign scope-type default ranks to allow-list entries#12539
jopemachine wants to merge 2 commits into
feat/BA-6628-allow-list-rankfrom
feat/BA-6628-scope-default-rank

Conversation

@jopemachine

@jopemachine jopemachine commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Second half of the AppConfigFragment rank redesign (BA-6628), split out of #12516. #12516 moves the merge rank from app_config_fragments to the admin-owned app_config_allow_list with a single fixed default; this PR makes that default depend on the scope type.

  • AppConfigScopeType.default_rank() — a new allow-list entry defaults its rank from its scope type: public=100, domain=200, user=300. The defaults order the scopes so a user's own fragment overrides the domain default, which overrides the public value; the 100 gap leaves room for admins to place custom ranks in between. An explicit rank still overrides the default.
  • Migration 66d0f891ed20 — the backfill (added in feat(BA-6702): move fragment rank to the allow list with scope defaults #12516) switches from the fixed default to the per-scope-type defaults for existing allow-list rows.
  • BEP-1052 — documents the scope-type defaults and the "user fragment wins by default" behavior.

📚 Stacked PRs

Part of the AppConfigFragment / AppConfig stack under BEP-1052 (epic BA-5781). Merge in order:

  1. feat(BA-6552): add app_config_fragments DB model and Alembic migration #12306feat(BA-6552): app_config_fragments DB model and Alembic migration
  2. feat(BA-6553): add app_config_fragments repository layer #12307feat(BA-6553): repository layer
  3. refactor(BA-6619): consolidate AppConfigScopeType into common.data (single definition) #12403refactor(BA-6619): consolidate AppConfigScopeType into common.data
  4. refactor(BA-6620): ExistsQuerier ops primitive + AppConfigAllowList.exists #12405refactor(BA-6620): ExistsQuerier + AppConfigAllowList.exists
  5. feat(BA-6554): add app_config_fragment service layer #12358feat(BA-6554): AppConfigFragment service layer
  6. feat(BA-6702): move fragment rank to the allow list with scope defaults #12516feat(BA-6628): move fragment rank to the allow list
  7. 👉 feat(BA-6628): assign scope-type default ranks to allow-list entries #12539feat(BA-6628): assign scope-type default ranks to allow-list entries ← you are here
  8. feat(BA-6701): expose allow-list rank on the v2 API surface #12517feat(BA-6628): expose allow-list rank on the v2 API surface
  9. feat(BA-6704): cascade app config subtree deletion from the definition #12518feat(BA-6628): cascade fragment deletion from the allow list
  10. feat(BA-6626): app_config_fragment bulk repository layer #12426feat(BA-6626): app_config_fragment bulk repository layer
  11. feat(BA-6618): app_config_fragment bulk CRUD service layer #12401feat(BA-6618): AppConfigFragment bulk CRUD service layer
  12. feat(BA-6555): AppConfig merge engine + resolve service (service layer) #12359feat(BA-6555): app_config service layer (merge engine)
  13. feat(BA-6556): AppConfig REST v2 API (raw fragments and merged read/update) #12377feat(BA-6556): AppConfig REST v2 API

🤖 Generated with Claude Code

Move the merge-priority `rank` from `app_config_fragments` to the
admin-owned `app_config_allow_list`. Fragment writes are partly
user-owned, so a rank on the fragment would let a fragment owner
re-order the merge; the allow-list entry is admin-owned, making it the
right carrier for merge priority. A new entry's rank defaults to a fixed
value (per-scope-type defaults follow in a later PR); an explicit rank
may be passed through `AppConfigAllowListCreatorSpec`.

Drops the per-`config_name` next-value rank assignment (`NextValuePolicy`,
lock on the definition row) from fragment create — `AppConfigFragmentCreatorSpec`
becomes a plain `CreatorSpec`.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@github-actions github-actions Bot added size:M 30~100 LoC comp:manager Related to Manager component comp:common Related to Common component require:db-migration Automatically set when alembic migrations are added or updated labels Jul 6, 2026
Give a new allow-list entry a per-scope-type default `rank` instead of a
single fixed value: `public`=100, `domain`=200, `user`=300 (via
`AppConfigScopeType.default_rank()`). The defaults order the scopes so a
user's own fragment overrides the domain default, which overrides the
public value; the 100 gap leaves room for admins to place custom ranks
in between. An explicit `rank` still overrides the default.

The migration backfills existing allow-list rows by the same scope-type
defaults.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:common Related to Common component comp:manager Related to Manager component require:db-migration Automatically set when alembic migrations are added or updated size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant