-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switches plugin reporting to use Django name #1102
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The ``component`` field of the ``versions`` section of the status API ```/pulp/api/v3/status/`` now | ||
lists the Django app name, not the Python package name. Similarly the OpenAPI schema at | ||
``/pulp/api/v3`` does also. |
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -18,11 +18,10 @@ | |||||||||||||||
from drf_spectacular.settings import spectacular_settings | ||||||||||||||||
from drf_spectacular.types import OpenApiTypes | ||||||||||||||||
from drf_spectacular.utils import OpenApiParameter | ||||||||||||||||
from pkg_resources import get_distribution | ||||||||||||||||
from rest_framework import mixins, serializers | ||||||||||||||||
from rest_framework.schemas.utils import get_pk_description | ||||||||||||||||
|
||||||||||||||||
from pulpcore.app.settings import INSTALLED_PULP_PLUGINS | ||||||||||||||||
from pulpcore.app.apps import pulp_plugin_configs | ||||||||||||||||
|
||||||||||||||||
|
||||||||||||||||
class PulpAutoSchema(AutoSchema): | ||||||||||||||||
|
@@ -446,11 +445,12 @@ def get_schema(self, request=None, public=False): | |||||||||||||||
result["info"]["x-logo"] = { | ||||||||||||||||
"url": "https://pulp.plan.io/attachments/download/517478/pulp_logo_word_rectangle.svg" | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
# Adding plugin version config | ||||||||||||||||
components = ["pulpcore"] + INSTALLED_PULP_PLUGINS | ||||||||||||||||
result["info"]["x-pulp-app-versions"] = { | ||||||||||||||||
component: get_distribution(component).version for component in components | ||||||||||||||||
} | ||||||||||||||||
result["info"]["x-pulp-app-versions"] = {} | ||||||||||||||||
for app in pulp_plugin_configs(): | ||||||||||||||||
result["info"]["x-pulp-app-versions"][app.label] = app.version | ||||||||||||||||
Comment on lines
+450
to
+452
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to decline this change if that's alright. The list comprehension with the iterator at the end is less readable for me. What I wrote is a bit slower though. |
||||||||||||||||
|
||||||||||||||||
# Adding current host as server (it will provide a default value for the bindings) | ||||||||||||||||
server_url = "http://localhost:24817" if not request else request.build_absolute_uri("/") | ||||||||||||||||
result["servers"] = [{"url": server_url}] | ||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized, this changes the keys and not only the trailing "0" in the versions.
This will break the version check logic in the cli.
Can we get back to the old names`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also thought about this, but I don't see an easy way to. :/ What this change does is hand control over to the plugin for the name it provides. So it's up to the plugins really. Let's talk about it at the pulpcore meeting, I put an agenda item on there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And BTW. This is what breaks the CI here too.