fix(issuable view): fetch all note pages when showing comments

What does this MR do?

glab issue view --comments fetched one page of notes and dropped the rest. On an issue with more than 20 notes the newest comments never showed, in text and in JSON output.

Notes are now collected across all pages with ScanAndCollect, starting at the --page value, the same behavior as mr view --comments. Incidents use the same code path and get the same fix.

How to test

  1. glab issue view 1165 -R gitlab-org/cli --comments prints all 12 comments (was 10).
  2. go test ./internal/commands/issuable/view/ -run Test_listIssueNotes covers multi-page collection and an error on a later page.

Closes #8687 (closed)

Merge request reports

Loading
Loading