-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add method to allow import of models with references to repo versions #1966
Comments
From: @ggainey (ggainey) I'm not sure the realities of import/export allow us to do anything useful here. 'downstream' is not (ever) a copy of upstream. It's its own version of Pulp, whose admin can be doing anything they want to repositories (like adding and removing repo-versions). An upstream AnsibleCollectionDeprecated is deprecated for a specific repo-version; how do we map that to a downstream that may, for example, have never had a repo-version? Or one that has had 100, when upstream had 3? How do we expect the AnsibleCollectionDeprecatedModelResource to 'find' the repo-version it is deprecated for/against? @gerrod @daviddavis, can either of you find any way for us to be able to make this possible? This may be a permanent restriction for this data-flow. |
From: daviddavis (daviddavis) ggainey wrote:
We have a specific repo version upstream that has been exported and we're mapping it to the new repo version downstream that is created during import. This newly created repo version could be passed to the plugin.
One naive solution would be to simply dump a list of collections that should be deprecated. After the new repo version is imported, we create a AnsibleCollectionDeprecated for each collection in the list and attach it to the new repo version. |
From: daviddavis (daviddavis) Here's maybe a bit better solution: during export AnsibleCollectionDeprecatedModelResource dumps the natural key for collections (namespace, name). During import, the pulpcore code calls some list of model resources (POST_IMPORT_ORDER or something?) after creating the repo version and it sets a repo version property on these resources and then runs |
From: @ggainey (ggainey) OK, I see where my confusion was. Looking at the data model, I assumed that an Your proposal in #c5 is the direction I'm leaning. It needs some more think-time, but the general path (import post-RV-creation, Thanks for the clarification! |
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! |
This issue is no longer marked for closure. |
Author: @gerrod3 (gerrod)
Redmine Issue: 8204, https://pulp.plan.io/issues/8204
Currently pulp import creates all the content models before creating the new repository version meaning that models with foreign keys to repository version can not be imported. This is currently the case with the AnsibleCollectionDeprecated model in pulp_ansible. It's possible other plugins have similarly difficult models to export/import that would need this solution.
The text was updated successfully, but these errors were encountered: