Add cursor pagination flags to proboctl list commands
Replace the limit-driven auto-walking Paginate helper with explicit cursor-pagination flags (--first/--after, --last/--before) that mirror the GraphQL connection arguments. List commands now return a single keyset page with its page info, and emit cursors so callers can page forward and backward. --before no longer requires --last: both --first and --last default to 50 when omitted. Also split the tracker-pattern stats into enriched with and without a description so the enrichment backlog is visible at a glance. Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -55,7 +55,8 @@ func newCmdStats(f *cmdutil.Factory) *cobra.Command {
|
||||
}{
|
||||
{"total", coredata.NewCommonTrackerPatternFilter()},
|
||||
{"queued", coredata.NewCommonTrackerPatternFilter().WithState(new(coredata.CommonTrackerPatternEnrichmentStateQueued))},
|
||||
{"enriched", coredata.NewCommonTrackerPatternFilter().WithState(new(coredata.CommonTrackerPatternEnrichmentStateEnriched))},
|
||||
{"enriched", coredata.NewCommonTrackerPatternFilter().WithState(new(coredata.CommonTrackerPatternEnrichmentStateEnriched)).WithDescribed(new(true))},
|
||||
{"enriched (no description)", coredata.NewCommonTrackerPatternFilter().WithState(new(coredata.CommonTrackerPatternEnrichmentStateEnriched)).WithDescribed(new(false))},
|
||||
{"unenriched", coredata.NewCommonTrackerPatternFilter().WithState(new(coredata.CommonTrackerPatternEnrichmentStateUnenriched))},
|
||||
{"linked", coredata.NewCommonTrackerPatternFilter().WithLinked(new(true))},
|
||||
{"unlinked", coredata.NewCommonTrackerPatternFilter().WithLinked(new(false))},
|
||||
@@ -83,7 +84,7 @@ func newCmdStats(f *cmdutil.Factory) *cobra.Command {
|
||||
}
|
||||
|
||||
table := clicmdutil.NewTable("METRIC", "COUNT")
|
||||
for _, key := range []string{"total", "queued", "enriched", "unenriched", "linked", "unlinked"} {
|
||||
for _, key := range []string{"total", "queued", "enriched", "enriched (no description)", "unenriched", "linked", "unlinked"} {
|
||||
table.Row(key, fmt.Sprintf("%d", stats[key]))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user