Issue #6897
closedpulp_deb_client gem has different interface than other pulp_*_client gems
Description
Found during Katello integration. In the pulp_deb_client gem, the method for listing repository-versions expects a primary-key instead of an href, which all other client gems do:
module PulpDebClient
class RepositoriesDebVersionsApi
#...
def list(apt_repository_pk, opts = {})
module PulpFileClient
class RepositoriesFileVersionsApi
#...
def list(file_repository_href, opts = {})
I would make a PR, but I have no clue, where this goes wrong.
Updated by quba42 over 4 years ago
I can confirm that this is the case. Having compared pulp_deb and pulp_file code a bit, I have no idea why this might be the case.
Updated by mbucher over 4 years ago
So the root of the problem seems to be that the model in pulp_deb is called DebRepository
.
This results in the URL for a specific repository being created as:
/pulp/api/v3/repositories/deb/apt/{deb_repository_pk}/
Notice the primary-key being referenced as deb_repository_pk
, because this is auto-generated from the model-name.
The URL for listing the versions of a specific repository is created as:
/pulp/api/v3/repositories/deb/apt/{apt_repository_pk}/versions/
Because the primary-key of the repository is represented by apt_repository_pk
here, the OpenAPIGenerator is not able to match the prefix of this URL against the repository-URL and therefore leaves it as it is in the resulting api.json
, which leads to the different pulp_deb_client-gem.
I believe we have to options here:
- rename the model-class to
AptRepository
as well as all other related model-classes - create a new method in the Base-Model class that generates the primary-key parameter-name, which will give pulp_deb the option to overwrite it in
DebRepository
-class.
The primary-key parameter-name is currently generated in the get_pk_path_param_name_from_model()
-method within pulpcore/app/openapigenerator.py
(here)
Updated by quba42 over 4 years ago
I suppose AptRepostiory would actually be the "correct" name, given that we use the same repository type for Ubuntu, and are already using "/pulp/api/v3/repositories/deb/apt/" for the API path.
Sounds like it might be a pain to change though...
Updated by mdellweg over 4 years ago
I am fine with AptRepository
if you can prove it works. The migration (renaming) it should not be too hard.
Updated by mbucher over 4 years ago
Added a draft-PR for the renaming: https://github.com/pulp/pulp_deb/pull/180
Feel free to test and comment.
Added by mbucher over 4 years ago
Updated by quba42 over 4 years ago
- Status changed from NEW to POST
Updated by mbucher over 4 years ago
- Status changed from POST to MODIFIED
Applied in changeset 1d5c86428db57738cf776ccfc9a2eb8d1c325125.
Updated by quba42 over 3 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Refactor class-names to Apt..
fixes #6897