feat(issues): add --estimate and --clear-estimate#94
feat(issues): add --estimate and --clear-estimate#94moredatarequired wants to merge 3 commits intolinearis-oss:mainfrom
Conversation
…date Wire up estimate support in the command layer. The GraphQL fragments already include the estimate field, so `issues read` returns it without changes. This adds: - `--estimate <points>` on `issues create` to set story points - `--estimate <points>` on `issues update` to change story points - `--clear-estimate` on `issues update` to remove the estimate - Mutual exclusion validation for --estimate + --clear-estimate Includes command-layer and service-layer tests for all estimate paths, plus previously missing createIssue/updateIssue service tests. Refs linearis-oss#26 Supersedes linearis-oss#41
There was a problem hiding this comment.
Pull request overview
Adds CLI support for setting and clearing Linear issue story point estimates via issues create and issues update, with accompanying unit tests.
Changes:
- Add
--estimate <points>support toissues createandissues update - Add
--clear-estimatetoissues updateplus mutual-exclusion validation - Add unit tests for command-layer estimate handling and service-layer create/update wrappers
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
src/commands/issues.ts |
Introduces new CLI flags and maps them into IssueCreateInput / IssueUpdateInput. |
tests/unit/commands/issues.test.ts |
Adds unit tests ensuring estimate flags are passed through to service calls and mutual exclusion is enforced. |
tests/unit/services/issue-service.test.ts |
Adds tests for createIssue and updateIssue service wrappers, including estimate set/clear paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
iamfj
left a comment
There was a problem hiding this comment.
Hey @moredatarequired — this is solid work. Clean scope (command layer only since the fragment already had the field), patterns followed correctly, and I appreciate you backfilling the createIssue/updateIssue service tests that were previously missing.
One thing I want us to get right before merging: estimation scales are team-specific in Linear, and the current help text assumes story points.
Linear teams can each configure a different estimation type:
| Type | API values (always integers) | UI display |
|---|---|---|
notUsed |
— | disabled |
fibonacci |
0, 1, 2, 3, 5, 8, 13, 21 | point values |
exponential |
0, 1, 2, 4, 8, 16, 32 | point values |
linear |
1–10 | point values |
tShirt |
1, 2, 3, 5, 8, 13, 21 | XS, S, M, L, XL, XXL, XXXL |
The API accepts any Int regardless of scale (no server-side validation), so the code is functionally correct for all types. Two small things to fix:
- Option descriptions — "story points" is only accurate for some scales. See inline comments for suggestions.
ISSUES_META.context— should mention estimates so agents understand the field. Something like: "issues can have estimates; valid values are integers whose meaning depends on the team's estimation scale (fibonacci, exponential, linear, or t-shirt sizes mapped to integers)."
Both are string-level changes. The rest is good to go — architecture, tests, commit hygiene all look clean.
Not for this PR, but worth tracking:
- Exposing
issueEstimationTypeon team output (theTeamFieldsfragment doesn't include it today, so there's no way to discover a team's scale via the CLI) - Input validation for
--estimateand--priorityto catchNaNbefore hitting the API
|
Opened #95 to track exposing team configuration (estimation scale, cycles, triage, auto-close) via a new |
|
Also opened #96 to add |
Address review feedback: - Use `options.estimate !== undefined` instead of truthiness checks so that `--estimate 0` is not silently dropped (Linear scales include 0) - Change option descriptions from "story points" to scale-neutral wording, since teams may use fibonacci, exponential, linear, or t-shirt sizing - Add estimate context to ISSUES_META so agents understand the field - Add tests for --estimate 0 and --estimate 0 --clear-estimate
# Conflicts: # src/commands/issues.ts # tests/unit/commands/issues.test.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds estimate support to
issues createandissues update, addressing #26. Re-implementation of #41 on the current architecture.Changes
The
estimatefield is already present in theCompleteIssueFieldsfragment, soissues readalready returns it; no service, resolver, or GraphQL changes.--estimate <points>onissues create--estimate <points>and--clear-estimateonissues updateUsage
Tests
createIssueandupdateIssue(previously untested)Refs #26
Supersedes #41