Get artifacts with limit, display name search and sort, does not return correct set of packages

Bug #1766537 reported by Sandhya Rao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glare
Fix Released
High
Kushal Agrawal

Bug Description

When there are a total of 4 artifacts matching the search criteria, only single artifact package is returned.
The below query has search with the text "Operation Metadata", limit=5 and sorted on name in ascending order.

Notice that the count of the artifacts is 4, where as only one record is displayed.

API Request:
https://{{BEFQDN}}:9494/artifacts/all?&limit=5&sort=name:asc&display_type_name=or:eq:Operation Metadata

Response:

{
    "artifacts": [
        {
            "status": "active",
            "activated_at": "2018-04-20T10:37:07Z",
            "description": "",
            "tags": [],
            "created_at": "2018-04-20T10:37:03Z",
            "type_name": "batch_operation_metadata",
            "display_type_name": "Operation Metadata",
            "updated_at": "2018-04-23T10:29:04Z",
            "visibility": "public",
            "name": "cbnd_batch_operation_metadata_hot_packages",
            "version": "18.5.0",
            "owner": "CloudBandNetworkDirector",
            "id": "3e8604fd-ceb7-4896-839e-2d3555db8034",
            "metadata": {}
        }
    ],
    "total_count": 4,
    "type_name": "all",
    "display_type_name": "All Artifacts",
    "first": "/artifacts/all?sort=name%3Aasc&limit=5&display_type_name=or%3Aeq%3AOperation+Metadata",
    "schema": "/schemas/all"
}

Changed in glare:
assignee: nobody → Kushal Agrawal (kushal2605)
importance: Undecided → High
Revision history for this message
Kushal Agrawal (kushal2605) wrote :

1. this is not related to any specific field search.
2. it is only reproducable in mysql database.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glare (master)

Fix proposed to branch: master
Review: https://review.openstack.org/564401

Changed in glare:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glare (master)

Reviewed: https://review.openstack.org/564401
Committed: https://git.openstack.org/cgit/openstack/glare/commit/?id=92bc2ad89fa6f7abb1d08a4802ca4767794ac76c
Submitter: Zuul
Branch: master

commit 92bc2ad89fa6f7abb1d08a4802ca4767794ac76c
Author: Kushal Agrawal <email address hidden>
Date: Thu Apr 26 12:15:46 2018 +0530

    list api with limit and search text issue

    If artifact data has multiple properties other than base
    artifact properties i.e. which needs to be stored in
    glare_artifact_properties table. In that case providing limit will
    always result in less no of artifacts then limit.

    This issue is not available in sqllite database, therefore no additional
    testcase is added.

    Change-Id: I933783cabb5b71d92b4d645d340bd9d1c9f6f8b5
    closes-bug: #1766537

Changed in glare:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.