Project

Profile

Help

Story #4785

As a plugin writer, I have Master/Detail Distributions

Added by gmbnomis about 1 year ago. Updated 7 months ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:

Description

Description

Problem

If plugin writers want to customize distributions (or use different content apps), they have to "invent" new REST endpoints (e.g. pulp_docker has a "docker-distributions" endpoint).

This leads to inconsistent API with unexpected location of distribution endpoints.

Solution

Switching to Master/Detail allows plugins to define customized Distribution at 'well-known' endpoints (e.g. .../distributions/docker/docker/)

The Models offered by core will be: (see also #4715)

- BaseDistribution: a (non-abstract) MasterModel containing name, base_path, content_guard, and remote. This class can be used in plugins that don't use publications

- Distribution: a subclass of BaseDistribution containing publication, publisher, repository. This class is the "standard" Distributor that will be subclassed by plugins using the standard content app

We will have the Master/Detail Distribution viewset overridden by the plugin. For convenience, plugin writers should not be forced to redefine the create/update/remove async tasks, i.e. they should create the respective detail model instance.

pulpcore db migrations will have to be re-generated for this change; users will have to redo their data bases. (this is necessary for rc2 anyway (because of #4678))

Optional: If possible, the current .../distributions/ endpoint should still work. It will be deprecated in rc2 and removed in rc3.


Checklist


Related issues

Related to Pulp - Task #4715: Remove 'publisher', 'publication', and 'repository' from BaseDistributionCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Related to Ansible Plugin - Issue #4820: Update pulp_ansible to use RepositoryVersionDistributionMODIFIED<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Related to Pulp - Test #4882: Add back tests related to overlapping base_pathCLOSED - COMPLETE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 708f8f83 View on GitHub
Added by gmbnomis about 1 year ago

Switch to Master/Detail Distribution

and update the outdated parts of the README.

Required PR: https://github.com/pulp/pulpcore/pull/117 Required PR: https://github.com/pulp/pulpcore-plugin/pull/95 Required PR: https://github.com/PulpQE/pulp-smash/pull/1205

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

Revision 0fe3cbda View on GitHub
Added by gmbnomis about 1 year ago

Switch Distribution to Master/Detail

The models offered by pulpcore are:

  • BaseDistribution: a (non-abstract) MasterModel. This class can be used in plugins that don't use publications.

  • Distribution: a subclass of BaseDistribution. This class is the "standard" Distributor that will be subclassed by plugins using the standard content app.

Required PR: https://github.com/pulp/pulpcore-plugin/pull/95 Required PR: https://github.com/pulp/pulp_file/pull/217 Required PR: https://github.com/PulpQE/pulp-smash/pull/1205 Required PR: https://github.com/pulp/pulp-certguard/pull/20 Required PR: https://github.com/pulp/pulp-swagger-codegen/pull/12

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

Revision ee415525 View on GitHub
Added by bmbouter about 1 year ago

Split Distribution into two objects

The Distribution contained options which should not be mixed. Specifically the repository and repository_version options go together and the publication goes by itself.

This PR splits that object into two new objects RepositoryVersionDistribution and PublicationDistribution. The two models are not detail objects, and require the plugin writer to declare a Distribution detail object. It was already this way before this PR.

This also adds a release note about the breaking changes that come with the switch to Master/Detail.

Required PR: https://github.com/pulp/pulpcore-plugin/pull/97 Required PR: https://github.com/pulp/pulp_file/pull/219

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

Revision 7070c7d3 View on GitHub
Added by bmbouter about 1 year ago

Use PublicationDistribution from pulpcore.plugin

The plugin API now uses PublicationDistribution which causes pulp_file users to only receive the fields they can actually use.

Required PR: https://github.com/pulp/pulpcore/pull/124 Required PR: https://github.com/pulp/pulpcore-plugin/pull/97

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

History

#1 Updated by gmbnomis about 1 year ago

  • Description updated (diff)

#2 Updated by gmbnomis about 1 year ago

  • Related to Task #4715: Remove 'publisher', 'publication', and 'repository' from BaseDistribution added

#4 Updated by dkliban@redhat.com about 1 year ago

  • Status changed from NEW to MODIFIED

#5 Updated by bmbouter about 1 year ago

  • Status changed from MODIFIED to POST

Bringing back to POST so I can split Distribution into two class types.

#6 Updated by bmbouter about 1 year ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#7 Updated by daviddavis about 1 year ago

  • Related to Issue #4820: Update pulp_ansible to use RepositoryVersionDistribution added

#8 Updated by kersom about 1 year ago

  • Related to Test #4882: Add back tests related to overlapping base_path added

#9 Updated by bmbouter 7 months ago

  • Sprint/Milestone set to 3.0.0

#10 Updated by bmbouter 7 months ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF