Skip to content

feat(BA-5815): AppConfigPolicy GraphQL#11269

Draft
jopemachine wants to merge 9 commits intoBA-5814from
BA-5815
Draft

feat(BA-5815): AppConfigPolicy GraphQL#11269
jopemachine wants to merge 9 commits intoBA-5814from
BA-5815

Conversation

@jopemachine
Copy link
Copy Markdown
Member

@jopemachine jopemachine commented Apr 24, 2026

📚 Stacked PRs

This PR is part of a 10-PR stack delivering BEP-1052. Merge in order:

  1. ⬇️ chore(BA-5822): drop legacy AppConfig layer (preparation for BEP-1052) #11265chore(BA-5822): drop legacy AppConfig layer
  2. ⬇️ feat(BA-5814): AppConfigPolicy foundation (data / repository / service / adapter, bulk-aware) #11266feat(BA-5814): AppConfigPolicy foundation
  3. 👉 feat(BA-5815): AppConfigPolicy GraphQL #11269feat(BA-5815): AppConfigPolicy GraphQL ← you are here
  4. ⬇️ feat(BA-5844): AppConfigPolicy REST v2 surface #11312feat(BA-5844): AppConfigPolicy REST v2
  5. ⬇️ feat(BA-5827): AppConfigFragment foundation (DB + repository + errors) #11282feat(BA-5827): AppConfigFragment foundation
  6. ⬇️ feat(BA-5836): AppConfigFragment service vertical (service / DTO / adapter) #11296feat(BA-5836): AppConfigFragment service vertical
  7. ⬇️ feat(BA-5829): AppConfigFragment + AppConfig GraphQL #11285feat(BA-5829): AppConfigFragment + AppConfig GraphQL
  8. ⬇️ feat(BA-5830): AppConfigFragment + AppConfig REST v2 #11286feat(BA-5830): AppConfigFragment + AppConfig REST v2
  9. ⬇️ feat(BA-5832): AppConfig v2 SDK + CLI (BEP-1052) #11295feat(BA-5832): AppConfig v2 SDK + CLI
  10. ⬇️ feat(BA-5837): ValkeyCache for AppConfigFragment merged-view reads #11298feat(BA-5837): ValkeyCache for AppConfigFragment merged-view reads

CI on intermediate PRs may show test churn since each one only lands a slice of the new layer. The full picture is guaranteed to build at the tip (#11298).

Summary

Wires the AppConfigPolicy domain (foundation in #11266) into the GQL and REST v2 layers. Service / processor / adapter / DTO bulk additions live in #11266 — this PR is API-only.

GraphQL (api/gql/app_config_policy/):

  • appConfigPolicy(configName: String!) — any authenticated user
  • appConfigPolicies(filter, orderBy, first/after/last/before/limit/offset)
  • adminBulkCreateAppConfigPolicies(input) / adminBulkUpdateAppConfigPolicies(input) / adminBulkPurgeAppConfigPolicies(input) — admin only, per-item transaction with partial-success failure list (BEP-1052 §3)
  • Types: AppConfigPolicyGQL, AppConfigPolicyFilterGQL, AppConfigPolicyOrderByGQL, AdminAppConfigPolicyItemInputGQL, bulk inputs / payloads, AppConfigPolicyBulkErrorGQL
  • No single-item create / update / purge mutations — Policy writes are bulk-only

REST v2 (api/rest/v2/app_config_policy/, mounted at /v2/app-config-policies):

  • GET /{config_name} — auth_required
  • POST /search — auth_required
  • POST /bulk-create / bulk-update / bulk-purge — superadmin_required

Adds AppConfigPolicyConfigNamePathParam to the shared path-params module and wires the handler into rest/v2/tree.py.

Resolves BA-5815.


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


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

@github-actions github-actions Bot added size:S 10~30 LoC comp:manager Related to Manager component comp:common Related to Common component labels Apr 24, 2026
@jopemachine jopemachine force-pushed the BA-5815 branch 2 times, most recently from 3201752 to d8b5061 Compare April 24, 2026 06:28
@github-actions github-actions Bot added size:L 100~500 LoC require:db-migration Automatically set when alembic migrations are added or updated and removed size:S 10~30 LoC labels Apr 24, 2026
@github-actions github-actions Bot added size:S 10~30 LoC and removed size:L 100~500 LoC labels Apr 24, 2026
jopemachine added a commit that referenced this pull request Apr 24, 2026
Extends the Policy foundation with the Service / Processor slice so
the adapter can reach domain operations through the central
Processors registry from day one (matches the pattern of every other
domain wired into services/processors.py).

What lands here:
- `services/app_config_policy/actions/` — 5 frozen-dataclass actions
  (`create`, `get`, `search`, `update`, `purge`) plus a shared
  `AppConfigPolicyAction` base bound to `EntityType.APP_CONFIG`.
- `services/app_config_policy/service.py` — `AppConfigPolicyService`
  delegating to `AppConfigPolicyRepository` /
  `AppConfigPolicyAdminRepository` (1 repo call per method). Uses
  `ObjectNotFound` for missing-config-name on update.
- `services/app_config_policy/processors.py` —
  `AppConfigPolicyProcessors(AbstractProcessorPackage)` wrapping each
  service method in an `ActionProcessor`, with `supported_actions()`.
- `services/processors.py` — `Services` / `Processors` containers +
  `supported_actions()` updated to include Policy.
- `services/factory.py` — `create_services()` / `create_processors()`
  wire `AppConfigPolicyService` and `AppConfigPolicyProcessors`.

No DTO / GQL / REST wiring here — those land with the vertical
(BA-5815, #11269). `delete` is intentionally omitted: policies have
no soft-delete concept (see BEP-1052 §1); `purge` is the only
removal path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added size:XS ~10 LoC and removed size:S 10~30 LoC labels Apr 24, 2026
@jopemachine jopemachine force-pushed the BA-5815 branch 4 times, most recently from 9c87317 to be58707 Compare April 24, 2026 08:14
@github-actions github-actions Bot added size:XL 500~ LoC area:docs Documentations and removed size:XS ~10 LoC labels Apr 24, 2026
jopemachine added a commit that referenced this pull request Apr 25, 2026
jopemachine added a commit that referenced this pull request Apr 26, 2026
@jopemachine jopemachine changed the title feat(BA-5815): AppConfigPolicy GraphQL + REST v2 feat(BA-5815): AppConfigPolicy GraphQL Apr 26, 2026
jopemachine added a commit that referenced this pull request Apr 27, 2026
Extends the Policy foundation with the Service / Processor slice so
the adapter can reach domain operations through the central
Processors registry from day one (matches the pattern of every other
domain wired into services/processors.py).

What lands here:
- `services/app_config_policy/actions/` — 5 frozen-dataclass actions
  (`create`, `get`, `search`, `update`, `purge`) plus a shared
  `AppConfigPolicyAction` base bound to `EntityType.APP_CONFIG`.
- `services/app_config_policy/service.py` — `AppConfigPolicyService`
  delegating to `AppConfigPolicyRepository` /
  `AppConfigPolicyAdminRepository` (1 repo call per method). Uses
  `ObjectNotFound` for missing-config-name on update.
- `services/app_config_policy/processors.py` —
  `AppConfigPolicyProcessors(AbstractProcessorPackage)` wrapping each
  service method in an `ActionProcessor`, with `supported_actions()`.
- `services/processors.py` — `Services` / `Processors` containers +
  `supported_actions()` updated to include Policy.
- `services/factory.py` — `create_services()` / `create_processors()`
  wire `AppConfigPolicyService` and `AppConfigPolicyProcessors`.

No DTO / GQL / REST wiring here — those land with the vertical
(BA-5815, #11269). `delete` is intentionally omitted: policies have
no soft-delete concept (see BEP-1052 §1); `purge` is the only
removal path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jopemachine added a commit that referenced this pull request Apr 27, 2026
Comment thread src/ai/backend/manager/api/gql/app_config_policy/resolver/mutation.py Outdated
Comment thread src/ai/backend/manager/api/gql/app_config_policy/types/bulk_inputs.py Outdated
jopemachine added a commit that referenced this pull request Apr 27, 2026
Extends the Policy foundation with the Service / Processor slice so
the adapter can reach domain operations through the central
Processors registry from day one (matches the pattern of every other
domain wired into services/processors.py).

What lands here:
- `services/app_config_policy/actions/` — 5 frozen-dataclass actions
  (`create`, `get`, `search`, `update`, `purge`) plus a shared
  `AppConfigPolicyAction` base bound to `EntityType.APP_CONFIG`.
- `services/app_config_policy/service.py` — `AppConfigPolicyService`
  delegating to `AppConfigPolicyRepository` /
  `AppConfigPolicyAdminRepository` (1 repo call per method). Uses
  `ObjectNotFound` for missing-config-name on update.
- `services/app_config_policy/processors.py` —
  `AppConfigPolicyProcessors(AbstractProcessorPackage)` wrapping each
  service method in an `ActionProcessor`, with `supported_actions()`.
- `services/processors.py` — `Services` / `Processors` containers +
  `supported_actions()` updated to include Policy.
- `services/factory.py` — `create_services()` / `create_processors()`
  wire `AppConfigPolicyService` and `AppConfigPolicyProcessors`.

No DTO / GQL / REST wiring here — those land with the vertical
(BA-5815, #11269). `delete` is intentionally omitted: policies have
no soft-delete concept (see BEP-1052 §1); `purge` is the only
removal path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jopemachine added a commit that referenced this pull request Apr 27, 2026
jopemachine and others added 9 commits April 27, 2026 11:30
GraphQL (`api/gql/app_config_policy/`):
- Queries: `appConfigPolicy(configName)`, `appConfigPolicies(filter, orderBy, ...)`.
- Bulk admin mutations (BEP-1052 §3): `adminBulkCreateAppConfigPolicies`,
  `adminBulkUpdateAppConfigPolicies`, `adminBulkPurgeAppConfigPolicies`.
  Single-item mutations are intentionally not exposed — Policy writes
  are bulk-only by design.
- Types: `AppConfigPolicyGQL`, filter / order-by, `AdminAppConfigPolicyItemInputGQL`,
  bulk inputs / payloads, `AppConfigPolicyBulkErrorGQL`.

REST v2 (`api/rest/v2/app_config_policy/`, mounted at `/v2/app-config-policies`):
- `GET /{config_name}` — auth_required.
- `POST /search` — auth_required.
- `POST /bulk-create` / `bulk-update` / `bulk-purge` — superadmin_required.

Adds `AppConfigPolicyConfigNamePathParam` to the shared path-params
module and wires the handler into `rest/v2/tree.py`. Service / adapter
foundation lands in BA-5814; this PR only wires the GQL + REST entry
points on top.

Resolves BA-5815.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- `AppConfigPolicyGQL` is now a Strawberry Relay Node
  (`PydanticNodeMixin[AppConfigPolicyNode]`) so it can flow through
  `Edge[T]` / `Connection[T]`.
- Add `AppConfigPolicyEdgeGQL` and `AppConfigPolicyConnectionGQL` and
  return the connection from `appConfigPolicies` (consistent with
  `auditLogsV2` and other paginated queries).
- Add `UPDATED_AT` to `AppConfigPolicyOrderFieldGQL`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The committed dump still carried the now-removed single-item
`adminCreate/UpdateAppConfigPolicy` mutations and was missing the
bulk variants the Python source already exposes — the bulk-only
cleanup landed in code but the schema dump was never regenerated.
Re-running `dump-gql-schema` + `generate-supergraph` from this
branch keeps the cleanup in the PR that introduces the GQL surface
(rather than letting it surface as a confusing diff in the Fragment
service vertical PR downstream).
Strip `BEP-1052 §X` mentions from docstrings, comments, and inline
notes across the GQL resolver / types and the REST v2 handler /
registry. News fragment retains the BEP wording.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: octodog <mu001@lablup.com>
The combined GraphQL + REST landing didn't match the AppConfigFragment
review pattern (BA-5829 GraphQL, BA-5830 REST as separate PRs). Move
the REST handler / registry / path-param wiring out to BA-5844 and
narrow this PR (and its news fragment) to the AppConfigPolicy
GraphQL surface only.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Track BA-5814 DTO refactor:
  • Split AdminAppConfigPolicyItemInputGQL into Create / Update variants
    (per review on PR #11269 — extensibility for diverging fields).
  • AdminBulkPurgeAppConfigPolicyInputGQL now takes ids: list[UUID].
  • AdminBulkPurgeAppConfigPoliciesPayloadGQL exposes purgedIds: [UUID!]!
    (was purgedConfigNames).
  • AppConfigPolicyBulkErrorGQL drops `config_name`.
  • Root `appConfigPolicy` query keys on row id (was config_name).
  • Add per-resolver one-liner docstrings to mutation entry points.

Regenerate v2 schema dump and supergraph to match.
jopemachine added a commit that referenced this pull request Apr 27, 2026
Pulls in id-keyed Policy GQL surface (AdminAppConfigPolicyCreateItemInput
/ AdminAppConfigPolicyUpdateItemInput / purgedIds) propagated from
PR #11269.
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 require:db-migration Automatically set when alembic migrations are added or updated size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant