Actions
Story #8454
closedAs a user, I can't delete RepositoryVersion.number==0
Start date:
Due date:
% Done:
100%
Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 94
Quarter:
Description
Current State¶
You cannot delete version 0. That is enforced int the code here.
Proposal¶
Allow users to be able to delete RepoVersion 0 if it is not the only RepoVersion. Due to the set-differencing data model in Pulp, RepositoryVersions must have at least one RepositoryVerison.
Implementation¶
- The viewset should no longer prevent that RepositoryVersion 0 can be removed
- A check needs to be added to the Delete Task that if the RepositoryVersion being deleted is the only remaining repository version an error is raised
- Add tests (see below)
Add Tests¶
We need a functional test asserting the correctness around removing RepoVersion 0. Something like:
- Create a repository
- Put some content in it to create RepoVersion 1
- Put more content in it to create RepoVersion 2
- Assert the content counts for RepositoryVersion 2
- Assert the content summary data from RepoVersion 2
- Delete RepoVersion 0
- Delete RepoVersion 1
- Assert the content counts from RepoVersion 2 again, to ensure the content is still in-tact.
- Assert the content summary data from RepoVersion 2 again, to ensure it is correct
We also need a functional test asserting that the only remaining repository version cannot be deleted.
- Create a Repository
- Try to delete repository 0
- Assert the task fails.
Related issues
Actions
Allow users to delete repo version 0
fixes #8454