Project

Profile

Help

Story #8205

Add AnsibleCollectionDeprecated resource to export/import

Added by gerrod 9 months ago. Updated about 2 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Quarter:

Description

The Two Related Problem

  1. The 'deprecated' data is mutable.
  2. The 'deprecated' data is not correctly included in import/export data

Solution

From a high level, make the AnsibleCollectionDeprecated content.

Modeling

Here are the rough steps involved:

  1. switch the existing AnsibleCollectionDeprecated to inherit from Content
  2. Remove the repository_version FK entirely.
  3. Change the collection field to be a string with the collection name instead
  4. Add a string field called namespace.
  5. The uniqueness constraint should be the tuple "namespace", "collection_name"

Sync Implementation

The sync code will continue to parse the deprecated data in FirstStage in the same way, but instead of saving/managing them in first-stage, have the stages pipeline handle it all by making AnsibleCollectionDeprecated in-memory and associating with a declarative content object.

The Galaxy API viewset

Port this portion to look for the objects in the set of content of the RepositoryVersion.

The viewset for set/unset deprecation handling

Port this portion to generate a task that creates a RepositoryVersion

Additional work needed to get this working with Import/Export

Add a model to model resources: https://github.com/pulp/pulp_ansible/blob/master/pulp_ansible/app/modelresource.py


Related issues

Blocked by Pulp - Task #8204: Add method to allow import of models with references to repo versionsNEW

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision b20ce517 View on GitHub
Added by Fabricio Aguiar 3 months ago

AnsibleCollectionDeprecated as Content

https://pulp.plan.io/issues/8205 closes #8205

History

#1 Updated by gerrod 9 months ago

  • Blocked by Task #8204: Add method to allow import of models with references to repo versions added

#2 Updated by bmbouter 8 months ago

  • Tags Katello added

#3 Updated by fao89 8 months ago

  • Sprint/Milestone set to 1.0.0 - Candidates

#4 Updated by bmbouter 4 months ago

  • Tracker changed from Task to Story
  • Description updated (diff)

#5 Updated by daviddavis 4 months ago

Change the collection field to be a string with the collection name instead

I'm assuming this will contain namespace? Or we have to add another field for namespace?

Additional work needed to get this working with Import/Export

We just need to add a model to model resources: https://github.com/pulp/pulp_ansible/blob/master/pulp_ansible/app/modelresource.py

#6 Updated by bmbouter 4 months ago

  • Description updated (diff)

I put the import/export work in the ticket body.

We've talked with galaxy_ng about them moving the model over too but right now I was hoping to just store it as a string. I put that into the modelling details too.

#7 Updated by fao89 3 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89

#8 Updated by fao89 3 months ago

the first issue I found is the data migration, AnsibleCollectionDeprecated as content would change the repository versions.

AnsibleCollectionDeprecated(
    collection=Collection(name="pulp_installer", namespace="pulp"), 
    repository_version=RepositoryVersion(number=1),
) 

=>

AnsibleCollectionDeprecated(
    name="pulp_installer", 
    namespace="pulp",
) 
+ RepositoryContent

#9 Updated by bmbouter 3 months ago

I don't understand the issue with AnsibleCollectionDeprecated and migrations. Are you saying that changing the AnsibleCollectionDeprecated model will break the migrations?

#10 Updated by pulpbot 3 months ago

  • Status changed from ASSIGNED to POST

#11 Updated by Anonymous 3 months ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#12 Updated by fao89 about 2 months ago

  • Sprint/Milestone changed from 1.0.0 - Candidates to 0.10.0

Please register to edit this issue

Also available in: Atom PDF