feat(mr note): add --resolve and --unresolve flags

Summary

Adds --resolve and --unresolve flags to the glab mr note command to allow resolving and unresolving discussions by note ID.

  • --resolve <note-id>: Resolves the discussion containing the specified note
  • --unresolve <note-id>: Unresolves the discussion containing the specified note

The flags are mutually exclusive with each other and with --message. Users can now resolve/unresolve discussions without needing to know the discussion ID hash, using the more visible note ID instead.

Changes

  • Added --resolve and --unresolve flags to mr note command
  • Implemented resolveDiscussion() helper function that:
    • Lists all discussions in the MR
    • Finds the discussion containing the specified note ID
    • Calls the GitLab API to resolve/unresolve the discussion
  • Added comprehensive tests for both resolve and unresolve functionality
  • Updated documentation

Example Usage

# Resolve a discussion by note ID
glab mr note 123 --resolve 3107030349

# Unresolve a discussion by note ID
glab mr note 123 --unresolve 3107030349

Part of Stack

This is MR 3 in a stack of changes:

  1. !2892 (merged) - Switch mr view --comments to Discussions API
  2. !2893 (merged) - Add --resolved and --unresolved filtering flags
  3. This MR - Add resolve/unresolve commands
Edited by Kai Armstrong

Merge request reports

Loading