Project

Profile

Help

Issue #5706

closed

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

Added by bmbouter over 4 years ago. Updated over 4 years 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.

Actions #1

Updated by bmbouter over 4 years ago

  • Description updated (diff)
Actions #2

Updated by gmbnomis over 4 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.

Actions #3

Updated by daviddavis over 4 years ago

  • Tracker changed from Issue to Task
  • % Done set to 0
Actions #4

Updated by daviddavis over 4 years ago

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

Updated by fao89 over 4 years ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 62
Actions #6

Updated by rchan over 4 years ago

  • Sprint changed from Sprint 62 to Sprint 63
Actions #7

Updated by daviddavis over 4 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?

Actions #8

Updated by fao89 over 4 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

Actions #9

Updated by ipanova@redhat.com over 4 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.

Actions #10

Updated by gmbnomis over 4 years ago

+1 for optional base_version parameter

Actions #11

Updated by fao89 over 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89
Actions #12

Updated by fao89 over 4 years ago

  • Status changed from ASSIGNED to POST

Added by Fabricio Aguiar over 4 years ago

Revision 420dd1ff | View on GitHub

added/removed content according to a given Version

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

Actions #13

Updated by Anonymous over 4 years ago

  • Status changed from POST to MODIFIED
Actions #14

Updated by daviddavis over 4 years ago

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

Added by Fabricio Aguiar over 4 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)

Actions #15

Updated by Anonymous over 4 years ago

Added by Fabricio Aguiar over 4 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)

Actions #16

Updated by Anonymous over 4 years ago

Added by daviddavis over 4 years ago

Revision 987e42de | View on GitHub

Renaming method for RepositoryContent relationships

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

Added by daviddavis over 4 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 over 4 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)

Actions #17

Updated by bmbouter over 4 years ago

  • Sprint/Milestone set to 3.0.1
Actions #18

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF