Repository navigation
Create projects, and manage milestones from the UI and MCP - #148
Conversation
reorderMilestones now parses its order with a schema from @orbit/shared instead of trusting the caller, and assertMilestoneInTeam is handed the project the issue will actually be on, so a milestone from a sibling project on the same team, or a milestone on an issue with no project at all, is refused rather than stored.
Five handlers, each one parsing with a schema from @orbit/shared and calling straight into the milestone service: list and create under a project, reorder under it, and patch and delete on a milestone. Create takes its project from the path, so a projectId in the body is ignored. Route tests seed a real workspace and prove the server refuses a guest, a contributor and a member whose teams do not reach the project.
reorder_milestones resolves every name against the project it names and hands the whole order to reorderMilestones, the same function the web route calls. update_issue takes a milestone, resolved against the project the patch leaves the issue on, so MCP can set what the issue properties panel sets.
A milestone row reads the milestones of the project the issue is on through a query of its own, keyed by that project, and patches milestoneId through the same route as every other property. Milestone deltas now invalidate that query rather than the bootstrap payload, which never carried milestones.
Add, edit, delete and reorder, with move up and move down so the order is keyboard operable. A move sends the whole order, which the server checks covers exactly the milestones of the project, so a stale client cannot half apply one. Progress per milestone still comes from the server.
POST /api/projects already worked and nothing called it. A dialog on the header, and on the empty state, posts a name, summary, target date and teams, then follows the slug the server allocated. The button only shows for a role that can manage projects, and a route test proves the server refuses everyone else on its own.
The editor keeps whatever it was opened with when the value it is handed goes back to a string it has already emitted, so clearing the body state left the text on screen and the next edit reposted it. Remount the editor on a successful post, and refuse a submit while one is in flight or the body is empty.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe pull request adds milestone CRUD and reordering across core services, web APIs, React Query, realtime updates, project and issue interfaces, and MCP tools. It also adds authorized project creation and resets the update composer after successful posts. ChangesMilestone and project workflow
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant MilestoneBoard
participant ReactQuery
participant MilestoneAPI
participant CoreService
User->>MilestoneBoard: Edit milestone
MilestoneBoard->>ReactQuery: Submit mutation
ReactQuery->>MilestoneAPI: Send PATCH request
MilestoneAPI->>CoreService: Update milestone
CoreService-->>MilestoneAPI: Return result and actions
MilestoneAPI-->>ReactQuery: Return updated milestone
ReactQuery-->>MilestoneBoard: Refresh milestone data
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (12)
packages/mcp-server/tests/tools.test.ts (2)
391-399: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winParse the MCP milestone payload with Zod.
milestonesOfcasts an unvalidated protocol payload toMilestoneShape[]. Define amilestoneShapeSchema, inferMilestoneShapefrom it, and parsepayload['milestones']before returning the rows.As per coding guidelines, validate every external input with Zod and use
xSchemaZod schemas with inferredXtypes.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/mcp-server/tests/tools.test.ts` around lines 391 - 399, Update milestonesOf to validate payload['milestones'] with a Zod milestoneShapeSchema before returning it. Define milestoneShapeSchema for id, name, and projectId, infer MilestoneShape from that schema, and replace the unchecked cast with schema parsing while preserving the MilestoneShape[] return type.Source: Coding guidelines
461-465: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTest assignment while changing to a different project.
Line 456 already assigns the issue to
project. Line 463 passes the same project again. This cannot prove that milestone resolution uses the patch project instead ofcurrentProjectId.Add a test that moves an issue from one project to another and assigns a milestone that exists only on the target project.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/mcp-server/tests/tools.test.ts` around lines 461 - 465, Update the test around the update_issue call to move the issue from its current project to a different target project, then assign a milestone that exists only on that target project. Ensure the request uses the target project and the assertions verify both the project change and successful target-project milestone assignment, proving resolution does not use currentProjectId.packages/mcp-server/src/tools/scrum.ts (1)
503-507: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winResolve the milestone references from one scoped list.
Each
resolveMilestonecall reads the full project milestone list. A 200-item request can perform 200 repeated visibility checks and database reads before reordering.Load the project milestones once, or add a batch resolver that maps all references while preserving the current not-found error.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/mcp-server/src/tools/scrum.ts` around lines 503 - 507, Update the milestone ordering flow around resolveMilestone to load the project’s scoped milestone list once and resolve all input.milestones against it, preserving input order and the existing not-found error behavior. Avoid calling resolveMilestone repeatedly; reuse the existing project and principal scoping rules when building the reference-to-ID mapping.apps/web/src/features/projects/new-project-dialog.tsx (2)
200-203: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMake the Cancel path clear the draft like the other close paths.
setOpen(false)does not triggeronOpenChange, soreset()does not run when the user clicks Cancel. The trigger button callsreset()before it reopens the dialog, so the stale draft stays hidden today. Route Cancel through the same reset to keep both close paths identical.♻️ Proposed refactor
- <Button type="button" size="sm" variant="ghost" onClick={() => setOpen(false)}> + <Button + type="button" + size="sm" + variant="ghost" + onClick={() => { + setOpen(false); + reset(); + }} + > Cancel </Button>🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/features/projects/new-project-dialog.tsx` around lines 200 - 203, Update the Cancel button in the DialogFooter to clear the draft before closing by invoking the same reset behavior used by the dialog’s other close paths, rather than calling only setOpen(false). Keep the dialog closed after cancellation and ensure the existing reopen flow remains unchanged.
76-83: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider
safeParsefor the response shape.
createdSchema.parsethrows aZodErrorwhen the response shape is unexpected. That error reaches thecatchblock andmessageOfrenders it innew-project-error. The user then sees raw validation text instead of a product message. UsesafeParseand show a fixed message when the shape does not match.♻️ Proposed refactor
- const { project } = createdSchema.parse(created); + const parsed = createdSchema.safeParse(created); + if (!parsed.success) { + setError('The server returned an unexpected response.'); + return; + } + const { project } = parsed.data;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/features/projects/new-project-dialog.tsx` around lines 76 - 83, Replace createdSchema.parse in the project-creation flow with safeParse, and branch on its success result before using project.name or project.slug. When validation fails, set a fixed product-facing error message through setError instead of passing the ZodError to messageOf; preserve the existing success navigation and caught-error handling for other failures.apps/web/src/lib/query/keys.ts (1)
27-27: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReuse
MILESTONES_ROOTin the key factory.Line 27 repeats the literal
'milestones', whiledocAccesson line 19 already builds its key fromDOC_ROOT. Realtime invalidation on[MILESTONES_ROOT]depends on both strings staying equal. Declare the constant beforequeryKeysand reference it.♻️ Proposed refactor
- milestones: (projectId: string) => ['milestones', projectId] as const, + milestones: (projectId: string) => [MILESTONES_ROOT, projectId] as const,Move the declaration above
queryKeys:export const MILESTONES_ROOT = 'milestones';Also applies to: 43-43
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/lib/query/keys.ts` at line 27, Declare and export MILESTONES_ROOT before queryKeys, then update the milestones and any other affected key factory entries to use this constant instead of the repeated 'milestones' literal, preserving the existing key shapes.docs/keyboard-shortcuts.md (1)
78-78: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse the
?dialog source for keyboard shortcut docs.The
mshortcut registration exists and matches this row. Avoid hand-maintaining parallel shortcut tables if the app generates them from the registry.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/keyboard-shortcuts.md` at line 78, Replace the manually maintained `m` shortcut row in the keyboard shortcut documentation with the generated `?` dialog source, using the existing shortcut registry as the authoritative source. Ensure the displayed entry remains “m — Change milestone” and avoid maintaining a parallel table.apps/web/tests/features/projects/milestone-board.test.tsx (2)
6-9: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueUse the
@/alias for the component under test.Lines 6 to 8 use the
@/alias. Line 9 uses a relative path to the samesrctree. Use@/features/projects/milestone-board.tsxfor consistency.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/tests/features/projects/milestone-board.test.tsx` around lines 6 - 9, Update the MilestoneBoard import in the milestone board test to use the configured `@/features/projects/milestone-board.tsx` alias instead of the relative path, keeping the other imports unchanged.
52-58: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReturn the patched milestone from the PATCH stub.
The stub returns
served[0]instead of the entry that matches the URL. The board ignores the response body today, so the tests pass. The stub still misrepresents the route contract and will hide a regression if the hook starts using the returned milestone.♻️ Proposed change
if (method === 'PATCH') { const patch = body as { name: string }; served = served.map((entry) => url.endsWith(entry.id) ? { ...entry, name: patch.name } : entry, ); - return Promise.resolve(Response.json({ milestone: served[0] })); + const patched = served.find((entry) => url.endsWith(entry.id)); + return Promise.resolve(Response.json({ milestone: patched })); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/tests/features/projects/milestone-board.test.tsx` around lines 52 - 58, Update the PATCH branch in the request stub to identify the milestone matching the URL, apply the name change to that entry, and return that patched milestone in the response instead of always returning served[0]. Preserve the existing served collection update behavior.apps/web/src/lib/query/use-milestones.ts (1)
123-134: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winCancel in-flight milestone queries before the optimistic write.
onMutatewrites the optimistic order without cancelling running queries. A refetch that started before the mutation can resolve afterwards and restore the old order. MakeonMutateasync and callcancelQueriesfirst.♻️ Proposed change
- onMutate: (milestoneIds) => { + onMutate: async (milestoneIds) => { const key = queryKeys.milestones(projectId); + await client.cancelQueries({ queryKey: key }); const previous = client.getQueryData<readonly Milestone[]>(key);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/lib/query/use-milestones.ts` around lines 123 - 134, Update the onMutate handler in the milestone mutation to be async, await client.cancelQueries for the milestones query key before reading previous data or applying the optimistic setQueryData, and preserve the existing rollback context and ordering logic.apps/web/tests/features/issues/issue-properties.test.tsx (1)
23-24: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAvoid the
{} as WorkspaceDataspread in the fixture.The spread on Line 24 casts an empty object to
WorkspaceData. The compiler then accepts the literal even ifWorkspaceDatagains required fields, and the missing fields becomeundefinedat runtime. Build the fixture as a fully typed literal, or add a sharedworkspaceFixturehelper that the type checker validates.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/tests/features/issues/issue-properties.test.tsx` around lines 23 - 24, Replace the `{} as WorkspaceData` spread in the `workspace` fixture with a fully populated, type-checked `WorkspaceData` literal, or reuse a shared `workspaceFixture` helper validated against `WorkspaceData`; ensure all required fields are explicitly defined so newly required fields produce compile-time errors.Source: Coding guidelines
apps/web/src/features/projects/milestone-board.tsx (1)
211-221: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider a confirmation step before deleting a milestone.
onDeletecalls the delete mutation immediately. A single click destroys a milestone with no undo path. Add a confirmation dialog, or add an undo action in the toast.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/features/projects/milestone-board.tsx` around lines 211 - 221, Update the milestone delete flow around the onDelete handler to require confirmation before invoking the delete mutation. Add a confirmation dialog or an undo action in the resulting toast, ensuring a single click on the milestone delete Button no longer immediately destroys the milestone.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/src/features/issues/issue-properties.tsx`:
- Around line 89-93: Update the milestone useHotkey registration to pass an
enabled condition based on issue.projectId, disabling it when no project exists.
Keep the shortcut active and advertised when the milestone PropertyMenu is
rendered.
In `@apps/web/src/features/projects/milestone-board.tsx`:
- Around line 33-40: Update formatDate to avoid parsing date-only values as UTC,
preserving the intended calendar day for milestone.targetDate across time zones.
Format the YYYY-MM-DD parts directly or construct the Date with local time
before calling toLocaleDateString; keep the existing “No target” behavior and
display format unchanged.
In `@apps/web/tests/app/api/projects/milestones.test.ts`:
- Around line 70-83: Update the shared setup around beforeAll and beforeEach to
use the repository’s rollback test database wrapper instead of calling
resetDatabase directly. Ensure workspace and project creation, along with each
test’s database writes, execute within the wrapper’s transaction lifecycle and
roll back after every test while preserving the existing published reset and
sign-in setup.
In `@packages/mcp-server/tests/tools.test.ts`:
- Line 401: Move the milestone tests from the `describe('milestones over mcp')`
block in `tools.test.ts` into separate files under `tests/tools/`, mirroring
their source modules: place issue milestone coverage with `src/tools/issues.ts`
tests and scrum milestone coverage with `src/tools/scrum.ts` tests. Preserve the
existing test behavior while removing the misplaced coverage from the monolithic
test file.
---
Nitpick comments:
In `@apps/web/src/features/projects/milestone-board.tsx`:
- Around line 211-221: Update the milestone delete flow around the onDelete
handler to require confirmation before invoking the delete mutation. Add a
confirmation dialog or an undo action in the resulting toast, ensuring a single
click on the milestone delete Button no longer immediately destroys the
milestone.
In `@apps/web/src/features/projects/new-project-dialog.tsx`:
- Around line 200-203: Update the Cancel button in the DialogFooter to clear the
draft before closing by invoking the same reset behavior used by the dialog’s
other close paths, rather than calling only setOpen(false). Keep the dialog
closed after cancellation and ensure the existing reopen flow remains unchanged.
- Around line 76-83: Replace createdSchema.parse in the project-creation flow
with safeParse, and branch on its success result before using project.name or
project.slug. When validation fails, set a fixed product-facing error message
through setError instead of passing the ZodError to messageOf; preserve the
existing success navigation and caught-error handling for other failures.
In `@apps/web/src/lib/query/keys.ts`:
- Line 27: Declare and export MILESTONES_ROOT before queryKeys, then update the
milestones and any other affected key factory entries to use this constant
instead of the repeated 'milestones' literal, preserving the existing key
shapes.
In `@apps/web/src/lib/query/use-milestones.ts`:
- Around line 123-134: Update the onMutate handler in the milestone mutation to
be async, await client.cancelQueries for the milestones query key before reading
previous data or applying the optimistic setQueryData, and preserve the existing
rollback context and ordering logic.
In `@apps/web/tests/features/issues/issue-properties.test.tsx`:
- Around line 23-24: Replace the `{} as WorkspaceData` spread in the `workspace`
fixture with a fully populated, type-checked `WorkspaceData` literal, or reuse a
shared `workspaceFixture` helper validated against `WorkspaceData`; ensure all
required fields are explicitly defined so newly required fields produce
compile-time errors.
In `@apps/web/tests/features/projects/milestone-board.test.tsx`:
- Around line 6-9: Update the MilestoneBoard import in the milestone board test
to use the configured `@/features/projects/milestone-board.tsx` alias instead of
the relative path, keeping the other imports unchanged.
- Around line 52-58: Update the PATCH branch in the request stub to identify the
milestone matching the URL, apply the name change to that entry, and return that
patched milestone in the response instead of always returning served[0].
Preserve the existing served collection update behavior.
In `@docs/keyboard-shortcuts.md`:
- Line 78: Replace the manually maintained `m` shortcut row in the keyboard
shortcut documentation with the generated `?` dialog source, using the existing
shortcut registry as the authoritative source. Ensure the displayed entry
remains “m — Change milestone” and avoid maintaining a parallel table.
In `@packages/mcp-server/src/tools/scrum.ts`:
- Around line 503-507: Update the milestone ordering flow around
resolveMilestone to load the project’s scoped milestone list once and resolve
all input.milestones against it, preserving input order and the existing
not-found error behavior. Avoid calling resolveMilestone repeatedly; reuse the
existing project and principal scoping rules when building the reference-to-ID
mapping.
In `@packages/mcp-server/tests/tools.test.ts`:
- Around line 391-399: Update milestonesOf to validate payload['milestones']
with a Zod milestoneShapeSchema before returning it. Define milestoneShapeSchema
for id, name, and projectId, infer MilestoneShape from that schema, and replace
the unchecked cast with schema parsing while preserving the MilestoneShape[]
return type.
- Around line 461-465: Update the test around the update_issue call to move the
issue from its current project to a different target project, then assign a
milestone that exists only on that target project. Ensure the request uses the
target project and the assertions verify both the project change and successful
target-project milestone assignment, proving resolution does not use
currentProjectId.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 63b951a3-ba3b-4ccf-93e4-f441de2f0d0c
📒 Files selected for processing (33)
apps/web/src/app/(app)/projects/[slug]/page.tsxapps/web/src/app/(app)/projects/page.tsxapps/web/src/app/api/milestones/[id]/route.tsapps/web/src/app/api/projects/[id]/milestones/reorder/route.tsapps/web/src/app/api/projects/[id]/milestones/route.tsapps/web/src/features/issues/issue-properties.tsxapps/web/src/features/projects/data.tsapps/web/src/features/projects/milestone-board.tsxapps/web/src/features/projects/new-project-dialog.tsxapps/web/src/features/projects/update-composer.tsxapps/web/src/lib/query/keys.tsapps/web/src/lib/query/schemas.tsapps/web/src/lib/query/use-issues.tsapps/web/src/lib/query/use-milestones.tsapps/web/src/lib/realtime/delta-bridge.tsxapps/web/tests/app/api/projects/milestones.test.tsapps/web/tests/app/api/projects/route.test.tsapps/web/tests/features/issues/issue-properties.test.tsxapps/web/tests/features/projects/milestone-board.test.tsxapps/web/tests/features/projects/new-project-dialog.test.tsxapps/web/tests/features/projects/update-composer.test.tsxapps/web/tests/lib/realtime/delta-bridge.test.tsxdocs/keyboard-shortcuts.mddocs/mcp.mdpackages/core/src/work/issue-service.tspackages/core/src/work/milestone-service.tspackages/core/tests/work/issue-service.test.tspackages/core/tests/work/milestone-service.test.tspackages/mcp-server/src/resolve.tspackages/mcp-server/src/tools/issues.tspackages/mcp-server/src/tools/scrum.tspackages/mcp-server/tests/tools.test.tspackages/shared/src/validators/milestone.ts
…ored Review found three things. The milestone list now carries scope and completed from listMilestonesWithProgress, so the counts follow the issues instead of freezing at whatever the page was rendered with, and an issue delta refreshes them. resolveMilestone refuses a name two milestones share rather than picking the first. The milestone routes parse with schemas from @orbit/shared before the service does. Two smaller ones: the m shortcut is only registered when the issue is on a project, and a date only target date is formatted from its own digits, so it no longer shows the previous day west of UTC. The projects table and the project header carried that bug too and now share the fix.
The panel advertised m next to Milestone even when the issue is on no project, where the menu is not rendered and the binding is registered disabled. The repository hint invariant test catches exactly that, so the hint now appears only alongside a menu that opens. The row moved into its own component to stay inside the complexity budget.
Keeps the milestone wiring #148 added and drops the standup wiring beside it: reorderMilestones and resolveMilestone in the MCP scrum tools, the milestones invalidation in the delta bridge, and the milestones query key, all without bringing back STANDUP_ROOT or the standup board key.
No catchup SQL
Nothing in this branch touches the schema.
milestoneandprojectalreadyexist with every column used here, so there is no new file under
packages/db/catchup/and nothing to apply before the code ships.What was broken
/projectsrendered a table and nothing else: a sweep of every button andanchor inside
<main>came back empty, soPOST /api/projectsworked and noclient ever called it.
packages/core/src/work/milestone-service.tshadcreate, update, delete, list and reorder, and
apps/web/src/app/apihad nomilestonesdirectory at all, so milestones had no HTTP surface. The filtermenu offered "Milestone" and the display menu offered a Milestone column, both
of which could only ever match seed data because nothing could set
issue.milestoneId. Andupdate-composer.tsxkept its text after a successfulpost, so the next edit reposted the same update.
Backend first
Every rule below is enforced on the server. The client hides what the policy
forbids, and every test that matters proves the refusal against the route.
@orbit/shared,calling a service, and publishing the actions the service returned:
GET/POST /api/projects/[id]/milestones,POST /api/projects/[id]/milestones/reorder,PATCH/DELETE /api/milestones/[id].projectIdin the body isignored, and there is a test for it.
reorderMilestonesparses its own input withmilestoneOrderSchemafrom@orbit/shared, so the service is a gate on its own and not only the route.It already refused an order that does not cover exactly the milestones of the
project; that is now reachable over HTTP and over MCP.
assertMilestoneInTeamused to skip the project check whenever the patch didnot also set
projectId, so an issue on project A could take a milestone froma sibling project B on the same team, and an issue on no project could take a
milestone at all.
applyIssueUpdatesnow hands it the project the issue willactually be on, and the null case is refused.
MCP parity
Everything the UI gained goes through the same service function.
create_project(already there)create_milestone,update_milestone,delete_milestone(already there)reorder_milestones(new)milestoneonupdate_issue(new)reorder_milestonesisreadOnly: false, so a token holding onlyorbit.readnever sees it. It resolves each name against the project it names, then hands
the whole order to
reorderMilestones.UI
/projectsheader and on the empty state. Name,summary, target date and teams; the slug comes back from the server and the
dialog follows it.
move down. Reorder posts the whole order, never a pair, so the server can
check it covers the project. Move buttons are real buttons with labels, so
the order is keyboard operable. Progress per milestone still comes from
projectProgress.It reads the milestones of the project the issue is on through a query keyed
by that project, and says "Pick a project first" when there is none.
submit while one is in flight.
Milestone deltas now invalidate the milestones query instead of the bootstrap
payload, which never carried milestones.
Tests, and the mutation that makes each one bite
Every test below was watched failing before the code existed, then the
production code was broken deliberately and confirmed RED, then restored.
issue-service.test.tsrefuses a sibling project milestonecurrent.projectIdargument toassertAssignableToTeamissue-service.test.tsrefuses a milestone with no projectprojectId !== nullback inassertMilestoneInTeammilestone-service.test.tsrefuses an order that is not idsmilestoneOrderSchema.parsemilestones.test.tsignores a bodyprojectIdmilestones.test.tsrefuses a guest and a contributor (3 cases)assertCan(principal, 'milestone:manage')milestones.test.tsrefuses a member off the project teamsassertProjectVisiblefromcreateMilestonemilestones.test.ts422 on a malformed reorder bodyroute.test.tsrefuses a contributor and a guest creating a projectassertCan(principal, 'project:manage')tools.test.tsreorder over MCP (3 cases) + discoveryreorder_milestonestooltools.test.tsmilestone onupdate_issue(3 cases)args.milestonebranch inbuildIssuePatchmilestone-board.test.tsxsends the whole order (2 cases)issue-properties.test.tsxreads the right project (3 cases)nullinstead ofissue.projectIdupdate-composer.test.tsxempties the editor (2 cases)keyon the editorThe route tests seed a real workspace with
@orbit/core/test-support, mock onlythe session, and let the real
resolveMembershipread the role and teams out ofPostgres, so the refusals come from the server and not from a stub.
bun run verifyexits 0.Greptile Summary
The PR adds UI and HTTP support for project and milestone management, exposes milestone ordering and issue assignment through MCP, and refreshes milestone progress from current issue data.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR UI[Project and issue UI] --> HTTP[Validated project and milestone routes] MCP[MCP tools] --> Core[Core project, milestone, and issue services] HTTP --> Core Core --> DB[(Database)] Core --> Events[Published actions] Events --> Cache[Query invalidation] Cache --> UIReviews (3): Last reviewed commit: "fix(issues): hide the milestone shortcut..." | Re-trigger Greptile
After review
Seven threads, five fixed and two answered.
refreshed.
GET /api/projects/[id]/milestonesnow carriesscopeandcompletedfromlistMilestonesWithProgress, the board takes no progressprop at all, and an issue delta invalidates the milestones query along with
everything else that counts issues.
resolveMilestonematches an id first and refuses an ambiguous name with aconflict that names the candidate ids.
first, with
milestoneUpdateSchemaand a newmilestoneCreateBodySchemawhich is the create schema without
projectId, so the path stays the onlysource of the project.
mshortcut was registered even with no project to hang a milestoneon. It is registered
enabled: issue.projectId !== null, and the<Kbd>hint goes with it. The repository hint invariant test caught the hint half of
that on CI before this branch was near merge, which is exactly what it is for.
new Date('2026-06-08')is UTC midnight.formatDayinapps/web/src/features/projects/dates.tsreads the digits and never builds aDate. The projects table and the project header carried the same bug and now
share the fix.
Two were answered rather than applied: moving the MCP milestone cases out of
tests/tools.test.tswould not land on a mirrored path either, since themilestone tools live across three source files; and there is no rollback test
wrapper in this repository for
apps/webto adopt, only the lane cloneddatabase every other database backed test already uses.
New tests for the round, each watched failing first:
pickmatch a name and take the firstformatDaynames the same day in four zonesnew Date(...).toLocaleDateStringmshortcut is not advertised without a projectenabledfrom the bindingshortcut="m"unconditional