refactor(cli): extract issue identifier and workflow-state helpers - #265
Merged
bougyman merged 1 commit intoSep 11, 2026
Merged
Conversation
Move bare-ID expansion into `LinearCli.CLI.Issue.Identifiers` and workflow-state selection/matching into `LinearCli.CLI.Issue.WorkflowStates`. - `Identifiers.expand_issue_id/1` consolidates the bare-number-to-prefixed-ID expansion and its team-resolution helpers (profile → favorites → prompt). - `WorkflowStates.cancelled_state_for/2`, `completed_state_for/2` consolidate type-filtered state selection with prompt-or-direct return. - `WorkflowStates.resolve_workflow_state/2` is made public so `IssueHelpers.gimme_da_issue!/2` can use the same exact+prefix matching logic without duplication. - `IssueHelpers` delegates to both new modules; `Commands` aliases `Identifiers` directly for its twelve `expand_issue_id` call sites. - Tests split: `expand_issue_id_test.exs` updated to call `Identifiers`; `workflow_states_test.exs` added with moved + new targeted tests for `resolve_workflow_state/2`; `issue_helpers_test.exs` pruned of the `cancelled/completed_state_for` describe block. Phase 18, EXT-48. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bougyman
deleted the
EXT-48-extract-issue-identifier-workflow-state-helpers
branch
September 11, 2026 23:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LinearCli.CLI.Issue.IdentifiersfromIssueHelpers: single public functionexpand_issue_id/1with private team-resolution helpers (profile → favorites → prompt).LinearCli.CLI.Issue.WorkflowStatesfromIssueHelpers:cancelled_state_for/2,completed_state_for/2, andresolve_workflow_state/2(made public to avoid duplicating exact+prefix matching logic between type-filtered selection andgimme_da_issue!'s--statusresolution).IssueHelpersdelegates to both new modules;CommandsaliasesIdentifiersdirectly for its 12expand_issue_idcall sites.smells_bad/1one-liner duplicated inWorkflowStates; removed fromIssueHelpers(its callers there use inline tuples).Test plan
expand_issue_id_test.exsupdated to callIdentifiers.expand_issue_id/1directlytest/linear_cli/cli/issue/workflow_states_test.exs: movedcancelled/completed_state_fortests + 5 new targeted tests forresolve_workflow_state/2(exact match, case-insensitive, unique prefix, unknown name, ambiguous prefix)issue_helpers_test.exs: pruned moved tests;cancel_issue,close_issue,gimme_da_issue!tests still exercise workflow state selection end-to-endmix compile --warnings-as-errorscleanmix credo --strictcleanmix format --check-formattedcleanPhase 18, EXT-48.
🤖 Generated with Claude Code