Project

Profile

Help

Issue #4191

Pulp does not support all search query strings - only name works reliably

Added by akofink 11 months ago. Updated 6 months ago.

Status:
CLOSED - NOTABUG
Priority:
Normal
Assignee:
-
Category:
API
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Master
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

Reproduce:
Query Pulp with a query string parameter other than name

Actual:
Pulp ignores most non-name parameters

Expected:
Pulp filters by any parameter

Examples ([httpie syntax](https://httpie.org/doc#querystring-parameters)):
Some of the following are not very useful, but filtering should be consistent.

GET /pulp/api/v3/publishers/file/ type=="foo" # this should always return 0 results

HTTP/1.1 200 OK
Allow: GET, POST, HEAD, OPTIONS
Connection: keep-alive
Content-Length: 499
Content-Type: application/json
Date: Tue, 27 Nov 2018 13:54:49 GMT
Server: nginx/1.12.2
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "_href": "/pulp/api/v3/publishers/file/1/",
            "created": "2018-11-26T18:21:33.521797Z",
            "distributions": [],
            "last_published": null,
            "last_updated": "2018-11-26T18:21:52.763045Z",
            "manifest": "PULP_MANIFEST",
            "name": "pdf",
            "type": "file" 
        },
        {
            "_href": "/pulp/api/v3/publishers/file/2/",
            "created": "2018-11-26T21:16:34.010881Z",
            "distributions": [],
            "last_published": null,
            "last_updated": "2018-11-26T21:16:34.010913Z",
            "manifest": "PULP_MANIFEST",
            "name": "txt",
            "type": "file" 
        }
    ]
}
GET /pulp/api/v3/publishers/file/ _href==/pulp/api/v3/publishers/file/1/ # this should always return 1 result

HTTP/1.1 200 OK
Allow: GET, POST, HEAD, OPTIONS
Connection: keep-alive
Content-Length: 499
Content-Type: application/json
Date: Tue, 27 Nov 2018 14:02:29 GMT
Server: nginx/1.12.2
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "_href": "/pulp/api/v3/publishers/file/1/",
            "created": "2018-11-26T18:21:33.521797Z",
            "distributions": [],
            "last_published": null,
            "last_updated": "2018-11-26T18:21:52.763045Z",
            "manifest": "PULP_MANIFEST",
            "name": "pdf",
            "type": "file" 
        },
        {
            "_href": "/pulp/api/v3/publishers/file/2/",
            "created": "2018-11-26T21:16:34.010881Z",
            "distributions": [],
            "last_published": null,
            "last_updated": "2018-11-26T21:16:34.010913Z",
            "manifest": "PULP_MANIFEST",
            "name": "txt",
            "type": "file" 
        }
    ]
}
GET /pulp/api/v3/publications/ publisher==/pulp/api/v3/publishers/file/2/

HTTP/1.1 200 OK
Allow: GET, HEAD, OPTIONS
Connection: keep-alive
Content-Length: 590
Content-Type: application/json
Date: Tue, 27 Nov 2018 14:04:30 GMT
Server: nginx/1.12.2
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN

{
    "count": 2,
    "next": null,
    "previous": null,
    "results": [
        {
            "_href": "/pulp/api/v3/publications/2/",
            "created": "2018-11-26T18:42:17.866763Z",
            "distributions": [],
            "pass_through": true,
            "publisher": "/pulp/api/v3/publishers/file/1/",
            "repository_version": "/pulp/api/v3/repositories/1/versions/1/" 
        },
        {
            "_href": "/pulp/api/v3/publications/1/",
            "created": "2018-11-26T18:32:02.020005Z",
            "distributions": [
                "http://centos7-pulp3-source.virbr0.akofink-desktop/pulp/api/v3/distributions/1/" 
            ],
            "pass_through": true,
            "publisher": "/pulp/api/v3/publishers/file/1/",
            "repository_version": "/pulp/api/v3/repositories/1/versions/1/" 
        }
    ]
}

There are many more! Try using any of the other non-name parameters in the above API output (i.e. manifest, pass_through, repository_version).

History

#1 Updated by amacdona@redhat.com 11 months ago

Filters with Pulp3 are not enabled for all fields. Each filterable field must be explicitly declared, and for the file publisher (which just uses the publisher base class), the only fields that are filterable are `name` and `last_updated`.

If you need other fields to be filterable, please file a story for those fields. Feel free to combine fields into 1 story, but it is probably simplest to file a separate story for each endpoint.

As a note, we did it this way to promote backwards compatibility. It is much easier to add new filters than to move/change filters that already exist.

#2 Updated by CodeHeeler 11 months ago

  • Status changed from NEW to CLOSED - NOTABUG

#3 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#4 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF