Project

Profile

Help

Issue #4749

closed

"repository" field on Publication is broken

Added by gmbnomis almost 5 years ago. Updated almost 5 years ago.

Status:
CLOSED - DUPLICATE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

The repository field on the PublicationSerializer see https://github.com/pulp/pulpcore/blob/c6ca9f60c63b85e41b2aab6b6ec909d9bfe1964c/pulpcore/app/serializers/publication.py#L39 has two problems on reading:

1. It uses HyperlinkedRelatedField, i.e. returns a full URI
2. The URL is broken

Example:

{
    "_created": "2019-04-30T21:27:42.622727Z",
    "_distributions": [],
    "_href": "/pulp/api/v3/publications/cookbook/cookbook/61e0a809-635b-48e6-a953-6b237e8d5dab/",
    "_type": "cookbook.cookbook",
    "publisher": "/pulp/api/v3/publishers/cookbook/cookbook/a5abd1d9-de46-4b7c-bdc8-3a3157237638/",
    "repository": "http://localhost:24817/pulp/api/v3/repositories/%3CRepository:%20foo%3E/",
    "repository_version": "/pulp/api/v3/repositories/8d8a93da-1cee-4edb-83f8-896591809093/versions/1/"
}

Additionally, we may consider to make this field write only: When reading, it may be confusing (a publication is always based on the repository version only. "repository" is a parameter that may be given for convenience when creating a publication).


Related issues

Related to Pulp - Test #4874: Test create a Publication using a Repository VersionCLOSED - COMPLETEkersomActions
Has duplicate Pulp - Issue #4792: Serialization bug on PublicationsCLOSED - CURRENTRELEASEdalleyActions

Also available in: Atom PDF