Project

Profile

Help

Issue #3502

Can't list versions for a repository

Added by daviddavis over 1 year ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
3. High
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 34

Description

$ http http://localhost:8000/api/v3/repositories/e2bf7dc1-8638-420f-be13-1c60e660249f/versions/
HTTP/1.0 400 Bad Request

[
    "No value supplied for content filter" 
]

Bug was created in this PR:

https://github.com/pulp/pulp/pull/3373/files#diff-3072a203aa1fcb7d2fc8af1885d4d6ceR144

The problem is that I tried to make http http://localhost:8000/api/v3/repositories/e2bf7dc1-8638-420f-be13-1c60e660249f/versions/?content= return a 400 error but it also affected requests where no content filter is supplied. See the tasks endpoint as an example:

$ http http://localhost:8000/api/v3/tasks/
HTTP/1.0 200 OK

$ http http://localhost:8000/api/v3/tasks/?worker=                                                                                                                                     
HTTP/1.0 400 Bad Request

[
    "No value supplied for worker filter." 
]

No idea why these filters are behaving differently.


Associated revisions

Revision 1cb4e194 View on GitHub
Added by daviddavis over 1 year ago

Fix defaulting of value to blank string when not specified

If content is not passed in, the filter still gets run with a blank
string for some reason. Extending Filter instead of CharFilter seems to
fix this.

fixes #3502
https://pulp.plan.io/issues/3502

Revision 1cb4e194 View on GitHub
Added by daviddavis over 1 year ago

Fix defaulting of value to blank string when not specified

If content is not passed in, the filter still gets run with a blank
string for some reason. Extending Filter instead of CharFilter seems to
fix this.

fixes #3502
https://pulp.plan.io/issues/3502

Revision 1cb4e194 View on GitHub
Added by daviddavis over 1 year ago

Fix defaulting of value to blank string when not specified

If content is not passed in, the filter still gets run with a blank
string for some reason. Extending Filter instead of CharFilter seems to
fix this.

fixes #3502
https://pulp.plan.io/issues/3502

History

#1 Updated by daviddavis over 1 year ago

  • Description updated (diff)

#2 Updated by dalley over 1 year ago

  • Tags Pulp 3, Pulp 3 MVP added

#3 Updated by daviddavis over 1 year ago

This change seems to solve both issues but I am not sure why:

diff --git a/pulpcore/pulpcore/app/viewsets/repository.py b/pulpcore/pulpcore/app/viewsets/repository.py
index b386ce9..cc54c87 100644
--- a/pulpcore/pulpcore/app/viewsets/repository.py
+++ b/pulpcore/pulpcore/app/viewsets/repository.py
@@ -2,7 +2,7 @@ from gettext import gettext as _
 import itertools

 from django_filters.rest_framework import filters, filterset
-from django_filters import CharFilter
+from django_filters import Filter
 from rest_framework import decorators, mixins, serializers

 from pulpcore.app import tasks
@@ -119,7 +119,7 @@ class ExporterFilter(filterset.FilterSet):
         ]

-class RepositoryVersionContentFilter(CharFilter):
+class RepositoryVersionContentFilter(Filter):
     """ 
     Filter used to get the repository versions where some given content can be found.

#4 Updated by dalley over 1 year ago

  • Priority changed from Normal to High
  • Severity changed from 2. Medium to 3. High
  • Triaged changed from No to Yes
  • Sprint set to Sprint 34

#5 Updated by daviddavis over 1 year ago

  • Status changed from NEW to POST
  • Assignee set to daviddavis

#6 Updated by daviddavis over 1 year ago

  • Status changed from POST to MODIFIED

#7 Updated by dkliban@redhat.com over 1 year ago

  • Sprint/Milestone set to 3.0

#8 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3, Pulp 3 MVP)

Please register to edit this issue

Also available in: Atom PDF