Project

Profile

Help

Issue #5706

base_version can cause content to show as added, even though it was in the previous version

Added by bmbouter 12 months ago. Updated 10 months ago.

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

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.

Associated revisions

Revision 420dd1ff View on GitHub
Added by Fabricio Aguiar 10 months ago

added/removed content according to a given Version

https://pulp.plan.io/issues/5706 closes #5706

Revision baea1263 View on GitHub
Added by Fabricio Aguiar 10 months ago

added/removed content according to a given Version

https://pulp.plan.io/issues/5706 closes #5706

(cherry picked from commit 420dd1ff2f326db454b216f33d848d5267489dfb)

Revision bca447bd View on GitHub
Added by Fabricio Aguiar 10 months ago

added/removed content according to a given Version

https://pulp.plan.io/issues/5706 closes #5706

(cherry picked from commit 420dd1ff2f326db454b216f33d848d5267489dfb)

Revision 987e42de View on GitHub
Added by daviddavis 10 months ago

Renaming method for RepositoryContent relationships

ref #5706 https://pulp.plan.io/issues/5706

Revision 664bbe8c View on GitHub
Added by daviddavis 10 months ago

Renaming method for RepositoryContent relationships

ref #5706 https://pulp.plan.io/issues/5706

(cherry picked from commit 987e42de3da23ea07fb5a8f0d2bde06107d3844c)

Revision 62b6d781 View on GitHub
Added by daviddavis 10 months ago

Renaming method for RepositoryContent relationships

ref #5706 https://pulp.plan.io/issues/5706

(cherry picked from commit 987e42de3da23ea07fb5a8f0d2bde06107d3844c)

History

#1 Updated by bmbouter 12 months ago

  • Description updated (diff)

#2 Updated by gmbnomis 12 months 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.

#3 Updated by daviddavis 12 months ago

  • Tracker changed from Issue to Task
  • % Done set to 0

#4 Updated by daviddavis 11 months ago

  • Tracker changed from Task to Issue
  • Severity set to 2. Medium
  • Triaged set to No

#5 Updated by fao89 11 months ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 62

#6 Updated by rchan 11 months ago

  • Sprint changed from Sprint 62 to Sprint 63

#7 Updated by daviddavis 11 months 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?

#8 Updated by fao89 11 months 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

#9 Updated by ipanova@redhat.com 11 months 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.

#10 Updated by gmbnomis 11 months ago

+1 for optional base_version parameter

#11 Updated by fao89 11 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89

#12 Updated by fao89 11 months ago

  • Status changed from ASSIGNED to POST

#13 Updated by Anonymous 10 months ago

  • Status changed from POST to MODIFIED

#14 Updated by daviddavis 10 months ago

Follow up PR to rename the method: https://github.com/pulp/pulpcore/pull/480

#15 Updated by Anonymous 10 months ago

#16 Updated by Anonymous 10 months ago

#17 Updated by bmbouter 10 months ago

  • Sprint/Milestone set to 3.0.1

#18 Updated by bmbouter 10 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF