refactor: simplify priority output and accept textual priority names#128
Merged
refactor: simplify priority output and accept textual priority names#128
Conversation
- Remove raw numeric `priority` field from IssueSummary, SearchSummary, and IssueDetail; rename `priorityLabel` → `priority` in JSON output - Accept textual names (none, urgent, high, medium, low) in -p/--priority alongside numeric 0-4, case-insensitive - Invalid priority names produce a clear error listing valid options - Update usage, --help, and README to reflect new accepted values Closes #116
- Make parse_priority pub(crate) and use it in projects create - Add .trim() to parse_priority for whitespace robustness - Add unit test for whitespace handling - Fix README column alignment for projects create
It's a resolver like the other helpers — belongs alongside resolve_team_id, resolve_issue_id, etc.
The priority number-to-name mapping comes from Linear's GraphQL schema (IssueCreateInput.priority / IssueUpdateInput.priority). Note the schema/API discrepancy: schema says "Normal" but priorityLabel returns "Medium" for priority 3 — we accept both.
The bracketed references were parsed as intra-doc links to types in a different crate, causing unresolved link errors with -Dwarnings.
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
priorityfromIssueSummary,SearchSummary, andIssueDetailJSON output; renamepriorityLabel→priority(e.g."priority": "Urgent"instead of"priority": 1.0+"priorityLabel": "Urgent")-p/--priorityonissues create,issues update, andissues batch-update—none,urgent,high,medium/normal,low(case-insensitive), alongside existing numeric 0-4lineark usage,--help, and CLI READMECloses #116
Test plan
make check && make test— all passing (lint, build, 123 offline tests, 7 unit tests including 4 newparse_prioritytests)issues_create_with_textual_priority_and_update— creates with--priority urgent, reads back verifying"priority": "Urgent", updates with--priority low, verifies"priority": "Low"priorityis now a text label,priorityLabelis absent--profile work, readonly): list/search/read all show"priority": "<label>"with no numeric orpriorityLabelfield