refactor(mr view): switch from Notes API to Discussions API

Summary

Switch glab mr view --comments from using the Notes API to the Discussions API. This change preserves discussion thread structure and lays the groundwork for future features like filtering by resolved/unresolved status and resolving discussions.

Changes

  • Replace listMRNotes with listMRDiscussions
  • Update output format to show threaded discussions with note IDs
  • Display resolution status (✓ resolved / ⚠️ unresolved) for threads
  • Indent replies within discussion threads
  • Update all tests to work with Discussion objects
  • Flatten discussions to notes for raw/JSON output compatibility

New Output Format

The new format shows:

  • Thread [#<note-id>] for multi-note discussions
  • Individual notes for non-threaded comments
  • Resolution status for resolvable threads
  • Proper indentation for replies within threads

Example

Thread [#3107030349] ✓ resolved
  @phikai commented 2026-02-23
  Can you review this?

    @phikai replied 2026-02-25
    Back to you!

    @reviewer replied 2026-02-25
    LGTM!

Why This Change?

This is the first MR in a stack of three:

  1. This MR: Switch to Discussions API (foundation)
  2. Next MR: Add --resolved and --unresolved filtering flags
  3. Final MR: Add glab mr note resolve/unresolve commands

The Discussions API is necessary because:

  • Resolution state is tracked at the discussion level, not individual notes
  • Thread structure is preserved (original comment + replies)
  • Note IDs can be used to identify and resolve discussions

Test Plan

  • All existing tests updated and passing
  • glab mr view --comments shows discussions with thread structure
  • JSON output includes full Discussion objects
  • Raw output flattens discussions to notes (backwards compatible)
Edited by Kai Armstrong

Merge request reports

Loading