Project

Profile

Help

Story #6671

As a pulpcore developer I can reliably determine the version of a Django plugin

Added by bmbouter 8 months ago. Updated about 1 month 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:
Quarter:

Description

Background

Currently plugins have their version accessible at the top-level of their python package. The plugin_template provides this in this part for example.

The AppConfig does not contain a version specification

The Problem

Django's discovery mechanisms are all about finding the AppConfig. See the apps part of their docs.

We've arbitrarily put the version at the module level which does not work well with how Django thinks about apps. For example there are cases where a single Python package could provide two Django apps. Django is prepared to deal with this, Pulp is not.

Another aspect to the same problem

Another aspect of the problem is well described in this SO post. The substantive summary is that "As such, you cannot generalize and use file or package and hope to always get the corresponding distribution." which is currently what Pulp tries to do when using period splitting. As is, the current StatusAPI for example would break if a python package was called one thing and its Distribution name was another, as Python packages do in-practice.

Solution

  1. Add a version field to the AppConfig which would allow plugin writers to clearly specify their version directly.
  2. Document this for plugin writers
  3. Add a warning on startup that identifies a plugin is missing a version if it is not defined

Related issues

Related to Pulp - Story #7624: Add pulpcore version to the plugin APICLOSED - DUPLICATE

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

Associated revisions

Revision 0db2dcbb View on GitHub
Added by bmbouter about 1 month ago

Adds PulpPluginAppConfig.version warnings

Starting with 3.10 plugins will be required to declare their version as the version attribute on the PulpPluginAppConfig subclass. This adds warnings starting in 3.9 encouraging plugin writers to do so.

Additionally, it sets the version on PulpAppConfig so that it doesn't complain about itself. The bumpversion spec also will bump this string at release time.

closes #6671

History

#1 Updated by bmbouter 3 months ago

  • Related to Story #7624: Add pulpcore version to the plugin API added

#2 Updated by bmbouter 3 months ago

  • Sprint/Milestone set to 3.9.0

#3 Updated by bmbouter about 1 month ago

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

#4 Updated by pulpbot about 1 month ago

  • Status changed from ASSIGNED to POST

#6 Updated by bmbouter about 1 month ago

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

#7 Updated by pulpbot about 1 month ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF