Project

General

Profile

Bug #24082

hammer content-view purge not deleting unused versions if one is in use by a published view

Added by Rimma Ashkinadze about 1 year ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Team Backlog:
Brad
Fixed in Releases:
Found in Releases:

Description

In this content view, there are 2 versions published in environments, 5 unpublished. One of the 5 unpublished can be removed initially. Then no other versions can be removed because one is in use. Once I delete the version of the composite that is in use, then I am able to proceed. Shouldn't purge be able to remove the unused ones that aren't in published composites?

$ hammer content-view version list --content-view my-el7-cv --organization-id 1
------|-----------------------|---------|-------------------------
ID | NAME | VERSION | LIFECYCLE ENVIRONMENTS
------|-----------------------|---------|-------------------------
15753 | my-el7-cv 2726.0 | 2726.0 | Library, Development, QA
15748 | my-el7-cv 2725.0 | 2725.0 |
15743 | my-el7-cv 2724.0 | 2724.0 |
15736 | my-el7-cv 2722.0 | 2722.0 | Staging, Production
15725 | my-el7-cv 2719.0 | 2719.0 |
15712 | my-el7-cv 2716.0 | 2716.0 |
15563 | my-el7-cv 2683.0 | 2683.0 |
------|-----------------------|---------|-------------------------

$ hammer content-view purge --id 259 --organization-id 1 --count 3
[...............................................................................................................................................................................................] [100%]
Version '2725.0' of content view 'my-el7-cv' deleted.
Cannot delete version while it is in use by composite content views: xxx-comp-cv Version 1494.0

$ hammer content-view version list --content-view my-el7-cv --organization-id 1
------|-----------------------|---------|-------------------------
ID | NAME | VERSION | LIFECYCLE ENVIRONMENTS
------|-----------------------|---------|-------------------------
15753 | my-el7-cv 2726.0 | 2726.0 | Library, Development, QA
15743 | my-el7-cv 2724.0 | 2724.0 |
15736 | my-el7-cv 2722.0 | 2722.0 | Staging, Production
15725 | my-el7-cv 2719.0 | 2719.0 |
15712 | my-el7-cv 2716.0 | 2716.0 |
15563 | my-el7-cv 2683.0 | 2683.0 |
------|-----------------------|---------|-------------------------

$ hammer content-view purge --id 259 --organization-id 1 --count 3
Cannot delete version while it is in use by composite content views: xxx-comp-cv Version 1494.0

$ hammer content-view version list --content-view my-el7-cv --organization-id 1
------|-----------------------|---------|-------------------------
ID | NAME | VERSION | LIFECYCLE ENVIRONMENTS
------|-----------------------|---------|-------------------------
15753 | my-el7-cv 2726.0 | 2726.0 | Library, Development, QA
15743 | my-el7-cv 2724.0 | 2724.0 |
15736 | my-el7-cv 2722.0 | 2722.0 | Staging, Production
15725 | my-el7-cv 2719.0 | 2719.0 |
15712 | my-el7-cv 2716.0 | 2716.0 |
15563 | my-el7-cv 2683.0 | 2683.0 |
------|-----------------------|---------|-------------------------

After I remove xxx-comp-cv Version 1494.0:

$ hammer content-view purge --id 259 --organization-id 1 --count 3
[...............................................................................................................................................................................................] [100%]
Version '2719.0' of content view 'my-el7-cv' deleted.

$ hammer content-view version list --content-view my-el7-cv --organization-id 1
------|-----------------------|---------|-------------------------
ID | NAME | VERSION | LIFECYCLE ENVIRONMENTS
------|-----------------------|---------|-------------------------
15753 | my-el7-cv 2726.0 | 2726.0 | Library, Development, QA
15743 | my-el7-cv 2724.0 | 2724.0 |
15736 | my-el7-cv 2722.0 | 2722.0 | Staging, Production
15712 | my-el7-cv 2716.0 | 2716.0 |
15563 | my-el7-cv 2683.0 | 2683.0 |
------|-----------------------|---------|-------------------------

Associated revisions

Revision 22ddfeac (diff)
Added by Christine Fouant 10 months ago

Fixes #24082 - content view purge skips versions in composites (#599)

History

#1 Updated by Andrew Kofink about 1 year ago

  • Legacy Backlogs Release (now unused) set to 349

#2 Updated by Jonathon Turel about 1 year ago

  • Target version changed from Katello 3.8.0 to Katello Backlog
  • Assignee set to Andrew Kofink

#3 Updated by Andrew Kofink 12 months ago

  • Team Backlog Brad added

#4 Updated by Christine Fouant 11 months ago

  • Assignee changed from Andrew Kofink to Christine Fouant

#5 Updated by The Foreman Bot 10 months ago

  • Pull request https://github.com/Katello/hammer-cli-katello/pull/599 added

#6 Updated by The Foreman Bot 10 months ago

  • Status changed from New to Ready For Testing

#7 Updated by Christine Fouant 10 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF