feat(issue): add lc issue move subcommand - #187
Conversation
Rework — code review feedback addressedChanges pushed in commit 6783eb2: Review issue fixed: JSON output corruption
Review issue addressed: idiomatic Elixir
Minor addressed: Readme documentation
|
Adds `lc issue move ISSUE_ID... --project PROJECT` to move one or more issues to a target Linear project. - Resolves the target project by name/URL/ID/search term via the same fuzzy-match + prompt logic used by issue create/update and project favorite (`Projects.project_for/2`) - Accepts variadic issue IDs via `allow_unknown_args: true` (same pattern as issue take/status/update) - Prints a plan line (`ISSUE_ID -> PROJECT_NAME`) for every issue before any mutation is attempted - `--dry-run` prints the plan and exits without executing any mutations - `--yes`/`-y` skips the confirmation prompt; without it, asks "Proceed with move?" (default: yes, matching `Prompt.yes?/1` convention) - `--team`/`-t` scopes project resolution to the given team; when omitted, derives team from the first fetched issue (avoids a separate prompt) - Moves execute concurrently via `Task.async_stream` (capped at 20, matching issue status pattern) - `--output json` emits the updated issue(s) as JSON, suppressing the confirmation "moved to" messages - Aliases: `m` and `mv` (e.g. `lc issue m --project PROJ ISSUE_ID`)
…d docs - Replace nested if/else in issue_move/1 with execute_moves_if_confirmed/4 function heads (dry_run, yes, prompt branches as separate clauses) - Replace value-as-error pattern in resolve_move_project with a with chain and resolve_move_team_id/2 function heads - Suppress plan lines in JSON output mode (print_move_plan guards on output) - Update JSON test to assert clean JSON without plan-line prefix workaround - Add issue move alias row (m, mv) to Readme alias table - Add issue move usage section to Readme Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6783eb2 to
80b4434
Compare
Rework (Run 3)Addressed review feedback from Run 2: Resolved: Readme.adoc merge conflict
The staged refactoring from Run 2 is included in the pushed commit:
Quality suite after rework:
|
Replace case-on-nil with project_result/2 multi-clause heads in resolve_move_project/2, and case-on-boolean with if in the execute_moves_if_confirmed/4 fallback clause. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rework (Run 4)Addressed: "There's still two nested cases to remove." What was changed (app/lib/linear_cli/cli/commands.ex):
Quality suite:
Pushed as a new commit (fe26143) on top of the existing branch, no force-push. |
Implementation Complete (Run 1 / All Reworks)All quality gates pass:
Summary of what was deliveredNew subcommand:
Key decisions
Files changed
|
…es_result Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rework (Run 5)Addressed: inline review comments requesting removal of `|> case do` at line 596. What was changed (app/lib/linear_cli/cli/commands.ex):
Quality suite:
|
Code Review (Run 5)Quality Suite
Prior Review Issues — All Resolved
Current AssessmentNo critical or major issues found. The implementation is clean after four rework rounds. What looks good
Minor observations (not blocking)
Overall AssessmentApprove. The code is idiomatic, well-tested, and follows established patterns. No issues remain from prior review rounds. |
Summary
lc issue move ISSUE_ID... --project PROJECTto move one or more issues to a Linear project--dry-runpreviews the planned moves without executing any mutations--yes/-yskips the confirmation prompt (default: prompt with yes as the default answer)Task.async_stream(capped at 20, same asissue status)m,mv(e.g.lc issue m --project Manhattan CRY-1 CRY-2)--team/-tscopes project resolution to the given team; falls back to the first fetched issue's teamDesign decisions
Linear.attach_issue_to_project/2which calls the existingissueUpdate(projectId:)mutation--dry-runsimply prints the plan and returns:okwithout calling any mutations--teamis omitted and no profile is active, derives team fromhd(issues).team.idto avoid requiring a separate team promptTest plan
--projectmoves a single issue with--yes(no prompt)--dry-runshows plan but makes no API mutation call--output jsonemits issue JSON, suppresses confirmation messagesmroutes toissue movemvroutes toissue move--teamscopes project resolution to the given teamCloses https://linear.app/the-rubyists/issue/EXT-9
🤖 Generated with Claude Code