Skip to content

fix(create): a milestone whose target date has passed takes no new issues - #79

Merged
muqsitnawaz merged 2 commits into
mainfrom
fix/no-past-milestone
Nov 3, 2026
Merged

muqsitnawaz merged 2 commits into
mainfrom
fix/no-past-milestone

Conversation

@muqsitnawaz

Copy link
Copy Markdown
Contributor

What was wrong

Agents kept filing new issues into milestones whose target date had already passed. There were two causes:

  1. The default milestone ignored the date. next_open_milestone picked the earliest targetDate still under 100% and never compared it to today. Once a milestone went overdue at less than 100%, every plain linear create in that project landed in it, labeled "next for ". On v0.33.0 against our live workspace, a default create picked a milestone whose target was 2026-10-23.
  2. An explicit milestone was not checked. create --milestone, update --milestone and goals --milestone accepted a milestone whose target date had passed. Only --backlog checked the date.

What changes

  • milestone_passed(m, today): a milestone whose target date is before the team's today. A milestone due today still takes issues.
  • The default (next_open_milestone, used by create and goals) skips passed milestones.
  • create, update and goals refuse a passed milestone with exit 1. The refusal names the milestone and its date, lists the project's milestones still open, and names linear milestones set-target-date for work that really belongs to it. Bulk --from-file rows get a one-line form.
  • When no milestone is still open, the "no milestone" refusal lists only the open milestones.
  • The CreateRequiresMilestoneTest fixture used hard-coded September 2026 targets, which are now past. It now uses dates relative to today, as _CreateWorld does.

New surface: milestone_passed and passed_milestone_error; resolve_milestone_id gains open_on. next_open_milestone now takes today. No new flags or config keys.

Run evidence

Captured run of this branch (831e847) against our live Linear workspace on 2026-11-03T17:19Z (org sign-in required, because it names internal milestones): https://share.getrush.ai/muqsit/linear-cli-no-past-milestone-run

What it shows:

  • A default create now picks the next milestone due on or after today (target 2026-11-05) instead of the one that targeted 2026-10-23.
  • linear create … --milestone <milestone that targeted 2026-10-23> prints the refusal and exits 1. The refusal lists the open milestones and the set-target-date command.
  • linear update <issue> --milestone <milestone that targeted 2026-10-26> prints the same refusal and exits 1. Reading the issue afterwards showed no milestone was written.
  • python3 -m unittest test_linear: Ran 288 tests … OK (skipped=4).

Goals: _goal_milestone defaults to the next open milestone, and an explicit passed milestone exits 1 with the same refusal.

🤖 Generated with Claude Code

muqsitnawaz and others added 2 commits November 3, 2026 09:18
…sues

create's default milestone was the earliest target still under 100%, with no
date check, so an overdue milestone left open caught every new issue. The
default now skips passed milestones, and create/update/goals --milestone refuse
one by name, list the open milestones, and name set-target-date as the way to
keep using it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…te and goals refusals

Review follow-up on #79: goals todo copied the Daily goal's milestone with no
date check. Adds tests for resolve_milestone_id(open_on), the goals refusal and
the to-do fallback; each fails on the previous release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@felicitycos1

Copy link
Copy Markdown

how it works sorry I don't understand

@muqsitnawaz

Copy link
Copy Markdown
Contributor Author

Independent review (non-author code-reviewer subagent, read-only, 831e847): no blocking findings. It walked every writer of projectMilestoneId, covering create single and bulk, update single and bulk, goals set and goals todo, and checked the team-timezone "today", the resolve_milestone_id(open_on) error paths, the backlog ordering, and public-repo hygiene. Two non-blocking items were fixed in f07c1e7:

  1. goals todo copied a passed Daily-goal milestone onto the new to-do. It now takes the next open milestone.
  2. There were no tests for the update/goals refusals or open_on. Five are added, and all 10 new tests fail against v0.33.0.

python3 -m unittest test_linear: Ran 293, OK (skipped=4). CI: unittest and CodeQL pass.

@muqsitnawaz

Copy link
Copy Markdown
Contributor Author

Verdict: APPROVE (independent non-author code-reviewer subagent). Its words: "READY TO MERGE after you decide on item 1 (a one-line fix) and add the missing update/goals tests from item 2." Both are done in f07c1e7, and CI passes on that head.

@felicitycos1

Copy link
Copy Markdown

Hi how it works

@felicitycos1

felicitycos1 commented Nov 3, 2026 via email

Copy link
Copy Markdown

@muqsitnawaz
muqsitnawaz merged commit 20e6135 into main Nov 3, 2026
5 checks passed
@muqsitnawaz
muqsitnawaz deleted the fix/no-past-milestone branch November 3, 2026 19:57
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.

2 participants