Project

General

Profile

Feature #3898

Pagination should be turned off by default in --csv mode

Added by Tomáš Strachota over 8 years ago. Updated about 7 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Hammer core
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

The pagination should be turned off by default when using csv output adapter. Csv is intended to be used primarily for machine processing so there's not much use in pagination. This behaviour can be overridden by passing --per-page implicitly.

Depends on: http://projects.theforeman.org/issues/3652


Related issues

Related to Hammer CLI - Bug #5073: [RFE] Ability to disable paginationClosed2014-04-04
Related to Hammer CLI - Bug #10534: hammer pagination output should be disabled by default or respect terminal sizeClosed2015-05-18
Has duplicate Foreman - Bug #8568: Hammer host list does not paginate correctly when interactive is set to "no"Duplicate2014-12-03
Has duplicate Hammer CLI - Bug #10313: hammer truncates output when interactive=falseDuplicate2015-04-29
Blocked by Foreman - Feature #3652: Add explicit way for API consumers to specifiy all pages in an index requestDuplicate2013-11-14

Associated revisions

Revision ae520bbb (diff)
Added by Tom Caspy over 7 years ago

fixes #3898 - list commands should not be interactive for csv output

History

#1 Updated by Dominic Cleal over 8 years ago

  • Blocked by Feature #3652: Add explicit way for API consumers to specifiy all pages in an index request added

#2 Updated by Dominic Cleal over 8 years ago

  • Related to Bug #5073: [RFE] Ability to disable pagination added

#3 Updated by Dominic Cleal almost 8 years ago

  • Bugzilla link set to 1142258

#4 Updated by Dominic Cleal over 7 years ago

  • Has duplicate Bug #8568: Hammer host list does not paginate correctly when interactive is set to "no" added

#5 Updated by Tom Caspy over 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tom Caspy
  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/160 added

#6 Updated by Anonymous over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#7 Updated by Tomáš Strachota over 7 years ago

  • Status changed from Closed to New
  • % Done changed from 100 to 0

I'm reopening the issue since the PR actually fixed something different. It only turns off interactivity but data returned from server remain paginated.
I'm sorry if the issue description wasn't clear enough. Please contact me if you need more details.

#8 Updated by Tom Caspy over 7 years ago

this is by design. the data can't return without pagination (imagine a query returning 100K results, which is definitely possible)
the idea is that the machine reading the data will go through the pagination programatically.
i.e. this pseudo code:

current_results = get first page
all results += current_results
while current_results.size < per_page
current_results = get next page
all_results += current_results
end

#9 Updated by Ohad Levy over 7 years ago

Tom Caspy wrote:

this is by design. the data can't return without pagination (imagine a query returning 100K results, which is definitely possible)

I would assume that we can increase the default page size when we are in batch mode, so instead of 20 results, you can query for 500 or 1000 at a time?

#10 Updated by Tom Caspy over 7 years ago

yes. there are page and per_page options.

#11 Updated by Dominic Cleal over 7 years ago

  • Has duplicate Bug #10313: hammer truncates output when interactive=false added

#12 Updated by Tomáš Strachota about 7 years ago

  • Related to Bug #10534: hammer pagination output should be disabled by default or respect terminal size added

#13 Updated by Tom Caspy about 7 years ago

I think #10534 fixes this.

#14 Updated by Dominic Cleal about 7 years ago

  • Status changed from New to Duplicate
  • Assignee deleted (Tom Caspy)

Agreed.

Also available in: Atom PDF