Expose the name-addressed app config fragment purge on REST v2
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
## Objective
Expose the scope-addressed purge on REST v2 as a scoped route and a my route, so a caller removing a fragment never has to resolve an id first.
## Background
/by-names already carries the (scope, config_name) address for the read, so the name-addressed delete belongs beneath that segment rather than beside the id-addressed /bulk-delete. The scoped and my callers differ only in which scope they may name, not in behaviour, so per api/rest/v2/AGENTS.md they share one handler pair and RBAC decides; an admin_ route would carry superadmin_required and lock out the domain admins that hold APP_CONFIG_FRAGMENT owner operations at domain scope.
Purge is not exposed on GraphQL at all, by id or in bulk, so this stays REST-only like its siblings.
## Acceptance Criteria
- POST /v2/app-config-fragments/scoped/by-names/bulk-delete purges the fragments at the scope named in the body, RBAC-gated at that scope.
- POST /v2/app-config-fragments/my/by-names/bulk-delete purges the caller's own user-scope fragments and names no scope in the body, so a regular user cannot address anyone else's.
- Both inputs reject an empty config_names batch; the scoped input accepts every scope kind with a matching id and rejects a mismatch.
- The response payload returns the purged fragment ids in the order their config names were given.
- The OpenAPI dump is regenerated and the route table in the registry docstring lists both routes.
## Related
- BA-7149 - the originating issue.
- src/ai/backend/manager/api/rest/v2/AGENTS.md
- src/ai/backend/common/dto/manager/v2/AGENTS.md
## Story Points
0.5
JIRA Issue: BA-7184
Contributor guide
Research direction
Start with src/ai/backend/manager/api/rest/v2/AGENTS.md and the existing REST v2 by-names and bulk-delete handlers. Review src/ai/backend/common/dto/manager/v2/AGENTS.md for the request and response DTOs, then verify both routes, RBAC scope handling, ordered fragment IDs, regenerated OpenAPI output, and the registry docstring against the acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100