feat: add issue and epic linking functionality to update command
Description
This merge request adds relationship management functionality to the glab issue update
command, allowing users to link/unlink issues and assign/remove epic associations directly from the CLI.
Key Changes:
-
Add issue linking support: New
--linked-issues
flag accepts comma-separated issue IIDs with configurable link types via--link-type
(relates_to, blocks, is_blocked_by) -
Add issue unlinking support: New
--unlink-issues
flag to remove existing links between issues -
Add epic assignment support: New
--epic
flag to assign issues to epics or remove from epics (set to 0) - Optimized API calls: Only call UpdateIssue API when there are actual issue property changes, reducing unnecessary requests
- Enhanced user feedback: Clear progress messages and success confirmations for all relationship operations
- Validation: Validates link types and checks for existing relationships before unlinking
Implementation Details:
- Added
handleIssueLinks()
function to manage all linking/unlinking operations - Added epic assignment logic directly in main update flow with proper action tracking
- Enhanced command examples with both linking and epic assignment use cases
- Added error handling for missing links, invalid link types, and epic operations
- Maintains full backward compatibility with existing update functionality
Related Issues
How has this been tested?
-
Unit tests: Added test coverage for new flags and default values in
issue_update_test.go
- Epic functionality tests: Added specific tests for epic flag validation and assignment/removal logic
- Manual testing: Verified linking/unlinking and epic assignment functionality with various combinations
- Integration testing: Confirmed optimized API calls work correctly - UpdateIssue only called when needed
- Error handling: Tested edge cases including invalid link types, non-existent relationships, and epic operations
-
Documentation: Auto-generated documentation updated via
make gen-docs
to include new functionality -
Backward compatibility: Verified all existing
glab issue update
functionality remains unchanged
Screenshots (if appropriate):
Types of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Breaking change (fix or feature that would cause existing functionality to change) -
Documentation -
Chore (Related to CI or Packaging to platforms) -
Test gap
Edited by Joe Burnett