Skip to content

refactor: simplify priority output and accept textual priority names#128

Merged
flipbit03 merged 5 commits intomainfrom
feat/simplify-priority-output
Mar 8, 2026
Merged

refactor: simplify priority output and accept textual priority names#128
flipbit03 merged 5 commits intomainfrom
feat/simplify-priority-output

Conversation

@flipbit03
Copy link
Copy Markdown
Owner

Summary

  • Remove raw numeric priority from IssueSummary, SearchSummary, and IssueDetail JSON output; rename priorityLabelpriority (e.g. "priority": "Urgent" instead of "priority": 1.0 + "priorityLabel": "Urgent")
  • Accept textual priority names in -p / --priority on issues create, issues update, and issues batch-updatenone, urgent, high, medium/normal, low (case-insensitive), alongside existing numeric 0-4
  • Clear error message for invalid priority values listing all valid options
  • Updated lineark usage, --help, and CLI README

Closes #116

Test plan

  • make check && make test — all passing (lint, build, 123 offline tests, 7 unit tests including 4 new parse_priority tests)
  • New offline tests: invalid priority rejection, help text mentions textual names
  • New online test: issues_create_with_textual_priority_and_update — creates with --priority urgent, reads back verifying "priority": "Urgent", updates with --priority low, verifies "priority": "Low"
  • Updated online test assertions: priority is now a text label, priorityLabel is absent
  • Smoke-tested against live workspace (--profile work, readonly): list/search/read all show "priority": "<label>" with no numeric or priorityLabel field

- 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
@flipbit03 flipbit03 self-assigned this Mar 8, 2026
- 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.
@flipbit03 flipbit03 merged commit 0a317bf into main Mar 8, 2026
8 checks passed
@flipbit03 flipbit03 deleted the feat/simplify-priority-output branch March 8, 2026 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: simplify priority output and accept textual priority names

1 participant