Skip to content

feat(issues): add --estimate and --clear-estimate#94

Open
moredatarequired wants to merge 3 commits intolinearis-oss:mainfrom
moredatarequired:feat/estimate-support
Open

feat(issues): add --estimate and --clear-estimate#94
moredatarequired wants to merge 3 commits intolinearis-oss:mainfrom
moredatarequired:feat/estimate-support

Conversation

@moredatarequired
Copy link
Copy Markdown

@moredatarequired moredatarequired commented Apr 8, 2026

Adds estimate support to issues create and issues update, addressing #26. Re-implementation of #41 on the current architecture.

Changes

The estimate field is already present in the CompleteIssueFields fragment, so issues read already returns it; no service, resolver, or GraphQL changes.

  • --estimate <points> on issues create
  • --estimate <points> and --clear-estimate on issues update
  • validate against both flags passed together

Usage

# Read (already works — estimate is in the response)
linearis issues read ENG-123 | jq '.estimate'

# Create with estimate
linearis issues create "New feature" --team ENG --estimate 5

# Update estimate
linearis issues update ENG-123 --estimate 8

# Clear estimate
linearis issues update ENG-123 --clear-estimate

Tests

  • Command-layer tests for create and update estimate paths
  • Service-layer tests for createIssue and updateIssue (previously untested)
  • All 225 tests pass

Refs #26
Supersedes #41

…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
Copilot AI review requested due to automatic review settings April 8, 2026 07:05
@moredatarequired moredatarequired requested a review from iamfj as a code owner April 8, 2026 07:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to issues create and issues update
  • Add --clear-estimate to issues update plus 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.

Copy link
Copy Markdown
Member

@iamfj iamfj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Option descriptions — "story points" is only accurate for some scales. See inline comments for suggestions.
  2. 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 issueEstimationType on team output (the TeamFields fragment doesn't include it today, so there's no way to discover a team's scale via the CLI)
  • Input validation for --estimate and --priority to catch NaN before hitting the API

@iamfj
Copy link
Copy Markdown
Member

iamfj commented Apr 8, 2026

Opened #95 to track exposing team configuration (estimation scale, cycles, triage, auto-close) via a new teams read command. That'll close the discoverability gap for --estimate values discussed in this review.

@iamfj
Copy link
Copy Markdown
Member

iamfj commented Apr 8, 2026

Also opened #96 to add parseInt validation for --estimate and --priority (catching NaN before it hits the API). There's already a pattern for this in cycles.ts using invalidParameterError().

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
@moredatarequired
Copy link
Copy Markdown
Author

moredatarequired commented Apr 8, 2026

@iamfj thanks for the fast response! Aside from the comments related to opening #95 and #96, this should address all the feedback.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

3 participants