Project

Profile

Help

Issue #5521

closed

Collection model that has no CollectionVersion related objects needs to be removed somehow when orphaned

Added by bmbouter about 3 years ago. Updated 11 months ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Ticket moved to GitHub: "pulp/pulp_ansible/693":https://github.com/pulp/pulp_ansible/issues/693


Problem

1. Upload a collection with <namespace=foo, name=bar, and version=1.0> and associate it with a repository_version so it's not an orphan.
2. Upload a second collection with <namespace=foo, name=bar, and version=2.0> and associate it with a repository_version so it's not an orphan.

At this point I expect the /pulp/api/v3/ansible/collection_versions to show you two CollectionVersions. Once story 5520 is implemented you would see exactly 1 Collection (deduplicated since they share Collection.

3. Now unassociate the version=1.0 collection
4. Run orphan cleanup and verify the Collection verson=1.0 was deleted from Pulp entirely. Now you'll have 1 Collection and 1 CollectionVersion
5. Now unassociate the version=2.0 collection
6. Run orphan cleanup again and verify the Collection version=2.0 was deleted from Pulp entirely.
7. Now list a Collection using the endpoint from 5520 and observe it still shows the Collection even though there are 0 CollectionVersions, this is the bug.

Solutions

Add a post_delete hook on CollectionVersion that will identify if it's the last CollectionVersion referring to that Collection and delete the Collection also if so.

Actions #1

Updated by bmbouter about 3 years ago

  • Parent task set to #5517
Actions #2

Updated by bmbouter about 3 years ago

  • Parent task deleted (#5517)

Removing from automation hub blockers because in AH content will never be removed so it won't impact AH.

Actions #3

Updated by pulpbot 11 months ago

  • Description updated (diff)
  • Status changed from NEW to CLOSED - DUPLICATE

Also available in: Atom PDF