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
Actions #1

Updated by gmbnomis almost 5 years ago

  • Description updated (diff)
Actions #2

Updated by amacdona@redhat.com almost 5 years ago

  • Triaged changed from No to Yes
Actions #3

Updated by kersom almost 5 years ago

  • Related to Test #4874: Test create a Publication using a Repository Version added
Actions #4

Updated by kersom almost 5 years ago

  • Related to Issue #4792: Serialization bug on Publications added
Actions #5

Updated by dalley almost 5 years ago

  • Related to deleted (Issue #4792: Serialization bug on Publications)
Actions #6

Updated by dalley almost 5 years ago

  • Has duplicate Issue #4792: Serialization bug on Publications added
Actions #7

Updated by dalley almost 5 years ago

  • Status changed from NEW to CLOSED - DUPLICATE

I ran across this separately and didn't see this issue, so I filed a new one and linked it in my commit message. The underlying issue will be fixed with https://github.com/pulp/pulpcore/pull/152

Also available in: Atom PDF