[PULP-1749] Add migrate endpoint for push repositories#2406
Conversation
Provide an async API to convert legacy ContainerPushRepository instances into ContainerRepository while preserving content and distribution links. Co-authored-by: Cursor <cursoragent@cursor.com>
Clarify copy_versions semantics, warn about in-flight uploads, and cover post-migrate push plus full version history replay. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Do you plan to add a management command to migrate all remaining repositories? Do you think we need to keep the old href's around as an alias? (Or by returning a clever redirect?) |
Yeah. I think I'll do it in a separate PR once I get this right.
No, this is one downside of the migration is that it's a completely new object, old hrefs won't work. I think it won't be a big deal since these repos are auto-created on push and auto-deleted when the distro is removed, so I don't expect many users are keeping track of these hrefs. Adding a compatibility layer is a lot of effort so my plan is to make the docs explicit on how the migration works so users understand what is happening. |
Summary
migrateaction on push repositories that dispatches a task to convertContainerPushRepositoryintoContainerRepositorycopy_versionsto preserve full repository version history (defaults to copying only the latest version)Test plan
pytest pulp_container/tests/functional/api/test_migrate_push_repository.pyPOST /pulp/api/v3/repositories/container/container-push/{pk}/migrate/returns 202 and completes successfullycopy_versions: truewhen multiple repository versions existMade with Cursor