Skip to content

fix: resolve option parsing conflict in issue subcommands#14

Merged
pchuri merged 1 commit intomainfrom
fix/issue-subcommand-option-parsing
Dec 10, 2025
Merged

fix: resolve option parsing conflict in issue subcommands#14
pchuri merged 1 commit intomainfrom
fix/issue-subcommand-option-parsing

Conversation

@pchuri
Copy link
Copy Markdown
Owner

@pchuri pchuri commented Dec 10, 2025

📋 Summary

Fixed a critical bug where filter options like --assignee, --project, --status were not being parsed correctly when using jira issue list subcommand. This was a follow-up fix to PR #13 - the buildJQL fix alone wasn't enough because the options weren't reaching the function due to Commander.js parent/subcommand option conflicts.

🎯 Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🧪 Test improvements
  • 🔧 Code refactoring
  • ⚡ Performance improvements

🔍 Changes Made

  • Removed parent command's legacy options and action handler from bin/commands/issue.js
  • Removed unused getIssueAction() helper function
  • Updated tests in tests/commands/issue.test.js to verify subcommand structure
  • All functionality now uses explicit subcommands (list, create, view, edit, delete)

🧪 Testing

  • All existing tests pass
  • New tests added for new functionality
  • Manual testing completed
  • Code coverage maintained/improved

📊 Test Results

Test Suites: 7 passed, 7 total
Tests:       91 passed, 91 total
Snapshots:   0 total
Time:        0.387 s

🚀 Deployment Notes

  • No special deployment steps required
  • Requires environment variable changes
  • Requires dependency updates
  • Other:

📝 Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

🔗 Related Issues

💬 Additional Notes

Root Cause:
Commander.js v11 has strict separation between parent command and subcommand options. When both parent and subcommand define the same options, the subcommand's options are ignored.

Before (Broken):

jira issue list --assignee=currentUser
# Options object: { "limit": "20" }  ❌ assignee missing

After (Fixed):

jira issue list --assignee=currentUser
# Options object: { "limit": "20", "assignee": "currentUser" }  ✓
# Generated JQL: assignee = currentUser()  ✓

This fix completes the work started in #13 by ensuring options are properly parsed and passed to the buildJQL function.

The parent command's options were conflicting with subcommand options,
causing --assignee and other filter options to not be parsed correctly
when using subcommands like 'jira issue list --assignee=currentUser'.

Changes:
- Removed legacy parent command options and action
- All functionality now uses explicit subcommands
- Updated tests to verify subcommand structure and options
- All 91 tests passing
@pchuri pchuri self-assigned this Dec 10, 2025
@pchuri pchuri requested a review from Copilot December 10, 2025 04:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical bug where filter options (--assignee, --project, --status) were not being parsed correctly in the jira issue list subcommand due to Commander.js parent/subcommand option conflicts. The fix removes legacy parent command options and action handlers, ensuring all functionality uses explicit subcommands.

Key Changes:

  • Removed parent command options and action handler that conflicted with subcommand options
  • Deleted unused getIssueAction() helper function
  • Updated tests to verify subcommand structure instead of parent command options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pchuri pchuri merged commit efe6be8 into main Dec 10, 2025
5 checks passed
@pchuri pchuri deleted the fix/issue-subcommand-option-parsing branch December 10, 2025 04:41
github-actions bot pushed a commit that referenced this pull request Dec 10, 2025
## [2.1.2](v2.1.1...v2.1.2) (2025-12-10)

### Bug Fixes

* resolve option parsing conflict in issue subcommands ([#14](#14)) ([efe6be8](efe6be8))
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 2.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants