Project

Profile

Help

Issue #9039

Behavior of auto-distribute is counterintuitive

Added by dalley 2 months ago. Updated 21 days ago.

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

Description

The distribution use cases are roughly as follows:

  • A basic user with a small number of repos will want to set up their repos with the minimum amount of effort, and is less likely to be scripting the workflow. They likely don't want to ever mess with manually setting the publication every time the repository is updated. So they want to set the repository on their distribution so that it is automatically receives the latest metadata.

  • An advanced user that wants complete control of when their repo paths are updated will want to script their pipeline to create publications and then manually distribute them all at once. They are less likely to want auto-distribute enabled at all.

Auto-distribute falls pretty squarely into the first use case. If such a user sets the "repository" on their distribution, then they likely want the latest metadata available, which means the latest publication from the latest repository version.

The current behavior If I set the "repository" on a distribution, then only the very first publication for the latest repository version will be distributed - later publications are ignored. If a user is using auto-distribution and they want to fix the metadata for an existing repository version by re-publishing, then they would have to un-set "repository" and then manually set the publication, which would completely change the behavior of that distribution in the future.

Whereas with the previously described behavior, if they want to fix up the metadata for some reason, they can just make a new publication.

This change consists of 2 parts, updating the content app to change the sort order, and updating the cache invalidation to invalidate the cache when a new publication is created for a repository version.

There's one additional issue I noticed in the code:

                        versions = repository.versions.all()
                        publications = Publication.objects.filter(
                            repository_version__in=versions, complete=True
                        )
                        publication = publications.latest("repository_version", "-pulp_created")

I think "repository_version" is going to sort by the value of the PK, not the value of the repository version "number". The correct (or at least more explicit) query would be .latest("repository_version__number", ...)


Related issues

Related to Pulp - Backport #9059: Backport 9039 "behavior of auto-distribute is unintuitive" to 3.14.zCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 2cc98040 View on GitHub
Added by dalley 2 months ago

Make auto-distribute feature more intuitive

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

History

#1 Updated by dalley 2 months ago

  • Description updated (diff)

#2 Updated by dalley 2 months ago

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

#3 Updated by pulpbot 2 months ago

  • Status changed from ASSIGNED to POST

#4 Updated by dalley 2 months ago

  • Related to Backport #9059: Backport 9039 "behavior of auto-distribute is unintuitive" to 3.14.z added

#5 Updated by dalley 2 months ago

  • Sprint/Milestone set to 3.14.2

#6 Updated by dalley 2 months ago

  • Status changed from POST to MODIFIED

#7 Updated by daviddavis 2 months ago

  • Sprint/Milestone deleted (3.14.2)

#8 Updated by dalley about 2 months ago

  • Sprint/Milestone set to 3.15.0

#9 Updated by pulpbot 21 days ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF