Project

Profile

Help

Story #4785

Updated by gmbnomis almost 5 years ago

h2. Description 

 h3. 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. 

 h3. 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@: @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@: @Distribution@ a subclass of @BaseDistribution@ Distribution containing publication, publisher, repository. This class is the "standard" Distributor that will be subclassed    by plugins plugin 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. 

Back