Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1598555 - [RFE] foreman-tasks: bulk_search does not support paging results
Summary: [RFE] foreman-tasks: bulk_search does not support paging results
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Tasks Plugin
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
low vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Jan Hutař
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-05 19:26 UTC by Brad Buckingham
Modified: 2019-01-21 15:43 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description Brad Buckingham 2018-07-05 19:26:33 UTC
Description of problem:

The foreman_tasks bulk_search API does not support paging the results. 

Below is an example where usage of the API can result in a lot of result displayed to the user.

Note: the behavior described here was initially raised by bug 1500090; however, that bug raised 2 items and only 1 was addressed.  This is to track the second issue (paging)

Version-Release number of selected component (if applicable):
tfm-rubygem-foreman-tasks-0.13.2-1.el7sat.noarch
tfm-rubygem-foreman-tasks-core-0.2.5-1.el7sat.noarch
tfm-rubygem-katello-3.7.0.rc1.2-0.1.rc1.2.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. go to Content -> Products
2. click Repo Discovery
3. select Repository Type - 'Container Images'
4. enter Registry to Discover - 'registry.access.redhat.com'
5. click Discover

Actual results:

~800 repositories are discovered and listed

Expected results:

The results can be paged, similar to other areas of the app.

Additional info:

The results displayed appear to be a result of the following API call:

POST foreman_tasks/api/tasks/bulk_search
{searches: [{type: "task", task_id: "78e783a0-1005-4588-a07f-de4bd10db2ce", search_id: "1"}]}

The response returned contains an output element (array) listing the 800 results.

Comment 1 Adam Ruzicka 2018-07-17 11:23:29 UTC
The thing with bulk_search is you can provide several queries to search by and (if I'm reading the code right) each of these can have different per_page and page values. So it most likely does support pagination in a non-standard way.

The problem with repo discovery is that it creates a single task which detects the repos and then the list of repos is loaded from that single task. No matter how hard one would try to paginate the bulk_search it would always behave the same way because there's just one task.

We should probably think about whether we still need the bulk_search endpoint (is it used anywhere? could it be replaced by a call to index?) and maybe file another BZ (or reuse this one) to cover the repo discovery pagination.


Note You need to log in before you can comment on or make changes to this bug.