Repository navigation
Closed
Labels
priority: lowLow prioritytype: featureNew feature or requestworkload: daysLikely takes days to resolve
Milestone
Description
Why?
Service IDs can't be changed. PUT /services/{serviceId} with a new ID registers a second service, so renaming one means registering it again and deleting the old one. That loses everything stored under the old ID:
- the roles of users and groups (owners, maintainers);
- the verification;
createdAt.
Between the two requests, both services exist, and if the second request fails, both stay.
What?
- An admin-only operation that changes the ID of a service, e.g.
POST /services/{serviceId}/renamewith the new ID in the body (name and shape to be settled in the PR). - It moves everything stored under the old ID to the new one: the service document (including
createdAtand the verification), the role policies and the stored user names. - No point in time at which both IDs exist, and no state with only part of the data moved:
- MongoDB transactions need a replica set; today's deployments (Compose, Helm chart) run a standalone MongoDB. Either make transactions a requirement (and document it), or find an order of operations that is safe without them (e.g. the old ID answers 404 or 409 while the move runs, and a failed move is rolled back or resumed).
409if the new ID is taken,404if the old one doesn't exist,400for an invalid ID.- Logged like the other admin actions.
Acceptance criteria
- After a rename, the service, its roles, its verification and
createdAtare only reachable under the new ID. - A failed or concurrent rename never leaves both IDs, or a service without its roles.
- Tests cover success, the error codes and a failure in the middle of the move.
A follow-up in cloud-registry-ui will let admins edit the ID in the edit form once this exists. Until then the UI shows the ID read-only.
Metadata
Metadata
Assignees
Labels
priority: lowLow prioritytype: featureNew feature or requestworkload: daysLikely takes days to resolve
Activity