Skip to content

feat(BA-6922): AppConfig fragment search REST v2 API (admin + scoped)#13020

Draft
jopemachine wants to merge 5 commits into
mainfrom
feat/BA-6922-app-config-fragment-search-rest-v2
Draft

feat(BA-6922): AppConfig fragment search REST v2 API (admin + scoped)#13020
jopemachine wants to merge 5 commits into
mainfrom
feat/BA-6922-app-config-fragment-search-rest-v2

Conversation

@jopemachine

@jopemachine jopemachine commented Jul 22, 2026

Copy link
Copy Markdown
Member

Recreates #12930, which GitHub auto-closed after a bad rebase briefly made the branch equal its base (head == base). No code was lost — this is the same branch and commit; only the PR shell is new. The single review thread on #12930 ("scope type doesn't represent public scope") is carried over as an open item below.

📚 Stacked PRs

Part of the AppConfigFragment / AppConfig stack under BEP-1052 (epic BA-5781). This branch is on main and waits on nothing — everything below it has merged. What it does have is downstream PRs that rewrite the very actions this adapter calls, so the order still matters.

Merged below this PR

PR why this PR needs it
#12984refactor(BA-6948): store app_config_fragments.scope_id as a nullable UUID the column shape the scope-type filter and scope DTO assume
#12928feat(BA-6921): AppConfig fragment write REST v2 API (CRUD) supplies AppConfigFragmentNode, the adapter, and the app-config-fragments sub-app this PR extends

👉 This PRfeat(BA-6922): fragment search REST v2 (admin + scoped). One net commit on main; mergeable on its own.

Must merge after this PR — both currently branch off main, and both change the action API this PR's adapter calls, so if either lands first this PR stops compiling:

PR what it changes underneath this PR fix-up needed here
#13032refactor(BA-6922): model the fragment scoped search as a scope action ScopedSearchAppConfigFragmentAction goes from BaseBulkAction with items: list[SearchableActionTarget] to a BaseScopeAction with a single scope: AppConfigFragmentSearchScope; DomainAppConfigFragmentTarget / UserAppConfigFragmentTarget are deleted this adapter imports and builds both target types and passes items=targets; the AppConfigFragmentScope DTO (lists of domain/user ids) collapses to one scope
#13037refactor(BA-6922): base the app config admin searches on the global action both fragment search results rename their list field dataitems; admin_search moves to GlobalActionProcessor this adapter reads action_result.data in admin_search and scoped_search; the processor swap is transparent at the call site

Neither is blocked by review here — they are blocked by the fact that their rebase target is this diff. #13032 and #13037 also overlap each other (app_config_fragment/actions/base.py, processors.py — both introduce AppConfigFragmentGlobalAction), so whichever of the two lands second takes a small merge as well.

Sibling, not a dependency

Related — may rename the routes added here

Summary

Fragment search REST v2 surface, split out of the write PR (BA-6921, #12928). Two variants:

What's included

  • DTOs: AppConfigFragmentFilter, AppConfigFragmentOrder, AdminSearchAppConfigFragmentInput, AppConfigFragmentScope, ScopedSearchAppConfigFragmentInput, plus types.py (order field + scope-type filter) and SearchAppConfigFragmentPayload.
  • Adapter: admin_search / scoped_search + the filter / order / scope-type query converters.
  • REST: the two search routes on the existing app-config-fragments sub-app.

Reuses AppConfigFragmentNode from #12928. No processor change — the admin_search / scoped_search service processors already exist; this PR only adds the API surface.

Open item carried from #12930

AppConfigFragmentScope (scoped-search) takes domain / user id lists but has no way to name the public scope. Whether a scoped search should be able to target public fragments is a design decision left open on the original PR — not resolved here. #13032 answers it downstream by replacing the lists with a single scope_type + scope_id, where public is expressible; this PR keeps the shape it was reviewed with.

🤖 Generated with Claude Code


📚 Documentation preview 📚: https://sorna--13020.org.readthedocs.build/en/13020/


📚 Documentation preview 📚: https://sorna-ko--13020.org.readthedocs.build/ko/13020/


📚 Documentation preview 📚: https://sorna--13020.org.readthedocs.build/en/13020/


📚 Documentation preview 📚: https://sorna-ko--13020.org.readthedocs.build/ko/13020/

@jopemachine
jopemachine requested a review from a team as a code owner July 22, 2026 05:53
@jopemachine
jopemachine force-pushed the feat/BA-6922-app-config-fragment-search-rest-v2 branch from 41c78f9 to b0c69a1 Compare July 22, 2026 05:54
@github-actions github-actions Bot added size:XL 500~ LoC area:docs Documentations comp:manager Related to Manager component comp:common Related to Common component labels Jul 22, 2026
@jopemachine
jopemachine marked this pull request as draft July 22, 2026 05:55
@jopemachine
jopemachine force-pushed the feat/BA-6922-app-config-fragment-search-rest-v2 branch from b0c69a1 to a124140 Compare July 22, 2026 05:59
@jopemachine
jopemachine force-pushed the feat/BA-6921-app-config-fragment-rest-v2 branch from 40c2ce9 to 2ff4f12 Compare July 22, 2026 06:04
@jopemachine
jopemachine force-pushed the feat/BA-6922-app-config-fragment-search-rest-v2 branch from a124140 to ffcf516 Compare July 22, 2026 06:06
Base automatically changed from feat/BA-6921-app-config-fragment-rest-v2 to main July 22, 2026 06:13
@jopemachine
jopemachine force-pushed the feat/BA-6922-app-config-fragment-search-rest-v2 branch from ffcf516 to 2962495 Compare July 22, 2026 06:20
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 and others added 2 commits July 22, 2026 16:57
`POST /scoped-search` matches neither documented form: the current
`/{entity}/{scope_type}/{scope_id}/search` nor the forward
`/{entity}/scoped/search`. `scheduling-history` already ships the latter as
`/kernels/scoped/search`, so follow it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jopemachine and others added 2 commits July 22, 2026 17:47
Pair the system-wide search with the scoped one: `/admin/search` alongside
`/scoped/search`, so the audience is in the path for both instead of being
implied by the bare `/search`.

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

Labels

area:docs Documentations comp:common Related to Common component comp:manager Related to Manager component size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant