Issue #8793
closed
Retained_versions doesn't properly keep all content present in repository
Status:
CLOSED - CURRENTRELEASE
Description
Still have more testing to do to see if this also affects just using the repository field for publications (probably does since that just grabs the latest version), but if a repository is using the retained_versions field and a publication is created from this repository it won't contain the content from the deleted versions even though they are till present the repository.
This issue could affect other publication base plugins.
- Subject changed from Publications with repository_version set don't properly publish all content when using retained_versions to Retained_versions doesn't properly keep all content present in repository
To test: Create repository with retained_versions 1. Add one content unit 3 times. Check summary of repo_version 3. Expected summary present: 3, Actual summary present: 1.
- Project changed from File Support to Pulp
I was able to reproduce this. I did some digging and the problem is that when a new version is generated here it triggers the cleanup of old repo versions which in turn calls repo version delete(). But here you'll notice that there's a conditional based on repository version complete
. But the repository version hasn't been saved yet (with complete set to True). I believe that saving the repository version first before saving the repository should probably fix this bug. Not sure if that's the right solution though.
- Sprint/Milestone set to 3.13.0
I don't think we want to ship the version retention feature in 3.13 without this fix.
- Related to Story #8368: Limit number of old repository versions. added
- Assignee deleted (
gerrod)
- Status changed from NEW to ASSIGNED
- Assignee set to daviddavis
- Status changed from ASSIGNED to POST
- Triaged changed from No to Yes
- Sprint set to Sprint 97
- Status changed from POST to MODIFIED
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Also available in: Atom
PDF
Fixed retained version bug where content wasn't updated
Fixed a bug in the retained versions code where content wasn't being properly moved to newer repo versions when old versions were cleaned up.
fixes #8793