Project

Profile

Help

Issue #4749

"repository" field on Publication is broken

Added by gmbnomis over 1 year ago. Updated over 1 year 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 - COMPLETE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Has duplicate Pulp - Issue #4792: Serialization bug on PublicationsCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by gmbnomis over 1 year ago

  • Description updated (diff)

#2 Updated by amacdona@redhat.com over 1 year ago

  • Triaged changed from No to Yes

#3 Updated by kersom over 1 year ago

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

#4 Updated by kersom over 1 year ago

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

#5 Updated by dalley over 1 year ago

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

#6 Updated by dalley over 1 year ago

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

#7 Updated by dalley over 1 year 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

Please register to edit this issue

Also available in: Atom PDF