Issue #5706
closedbase_version can cause content to show as added, even though it was in the previous version
Description
This was originally reported on IRC by gmbnomis.
Reproducer¶
1. Create empty RepositoryVersion, version 1.
2. Create a second RepositoryVersion by adding content unit B
3. Create a third RepositoryVersion, by adding content unit A AND use version 1 as the base_version
Issue¶
Observe that for RepositoryVersion 3, the added field shows A & B to be considered added, even though B was already present in RepositoryVersion 2.
Updated by gmbnomis about 5 years ago
bmbouter wrote:
This was originally reported on IRC by gmbnomis.
I got this one wrong and probably created lots of confusion. The reproducer is the same, but what I meant to say is:
Issue¶
Observe that for RepositoryVersion 3, the added field shows A to be considered added, and B as removed.
This is consistent with how the added and removed sets are defined (they show additions/removals with respect to the previous "latest" version (i.e. /2/ in this case)).
However, when a repo version finalizer looks at a repo version changes, it is interested in changes relative to the base version.
For example, assume we use a finalizer that removes dependent content for a removed content unit. Suppose that A depends on B. If the finalizer looks at the .removed set (containing B), the finalizer will remove A, which does not make sense.
Thus finalizers need other change sets than .added and .deleted. Currently, RepositoryVersion does not offer such sets comparing two (arbitrary) repo versions.
Updated by daviddavis about 5 years ago
- Tracker changed from Issue to Task
- % Done set to 0
Updated by daviddavis about 5 years ago
- Tracker changed from Task to Issue
- Severity set to 2. Medium
- Triaged set to No
Updated by fao89 about 5 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 62
Updated by daviddavis about 5 years ago
Currently in RPM, we get the base (or last) version and find the content that has been added and removed. It's not a good solution but it's a workaround now at least.
My initial feeling is that added() and removed() should stay the same (given that 3.0 has released). But maybe we can either add an optional argument to alter their behavior or maybe we should introduce a new set of methods?
Updated by fao89 about 5 years ago
I would go with an optional kwarg,
keeping added and removed as is for the default behavior, and changing it when kwarg is passed
Updated by ipanova@redhat.com about 5 years ago
One of the possible solutions would be to check for the optional kwarg which would be the base_version and if present then take that version instead of 'latest' version.
Updated by fao89 about 5 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to fao89
Updated by fao89 about 5 years ago
- Status changed from ASSIGNED to POST
Added by Fabricio Aguiar almost 5 years ago
Updated by Anonymous almost 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulpcore|420dd1ff2f326db454b216f33d848d5267489dfb.
Updated by daviddavis almost 5 years ago
Follow up PR to rename the method: https://github.com/pulp/pulpcore/pull/480
Added by Fabricio Aguiar almost 5 years ago
Revision baea1263 | View on GitHub
added/removed content according to a given Version
https://pulp.plan.io/issues/5706 closes #5706
(cherry picked from commit 420dd1ff2f326db454b216f33d848d5267489dfb)
Updated by Anonymous almost 5 years ago
Applied in changeset pulpcore|baea126391a5875c7de4cc57bc2af9de949f694f.
Added by Fabricio Aguiar almost 5 years ago
Revision bca447bd | View on GitHub
added/removed content according to a given Version
https://pulp.plan.io/issues/5706 closes #5706
(cherry picked from commit 420dd1ff2f326db454b216f33d848d5267489dfb)
Updated by Anonymous almost 5 years ago
Applied in changeset pulpcore|bca447bd85ff339f0cfa9461cb07d1341b84a057.
Added by daviddavis almost 5 years ago
Revision 987e42de | View on GitHub
Renaming method for RepositoryContent relationships
Added by daviddavis almost 5 years ago
Revision 664bbe8c | View on GitHub
Renaming method for RepositoryContent relationships
ref #5706 https://pulp.plan.io/issues/5706
(cherry picked from commit 987e42de3da23ea07fb5a8f0d2bde06107d3844c)
Added by daviddavis almost 5 years ago
Revision 62b6d781 | View on GitHub
Renaming method for RepositoryContent relationships
ref #5706 https://pulp.plan.io/issues/5706
(cherry picked from commit 987e42de3da23ea07fb5a8f0d2bde06107d3844c)
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
added/removed content according to a given Version
https://pulp.plan.io/issues/5706 closes #5706