Skip to content

feat(github): add milestone creation/assignment to the issue-planning tool#7511

Merged
JSONbored merged 1 commit into
mainfrom
claude/orb-github-issue-automation-080318
Jul 20, 2026
Merged

feat(github): add milestone creation/assignment to the issue-planning tool#7511
JSONbored merged 1 commit into
mainfrom
claude/orb-github-issue-automation-080318

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Adds src/github/milestones.ts (listOpenInstallationMilestones, createInstallationMilestone) — GitHub-native milestones didn't exist as a capability anywhere in this codebase before this PR; every prior milestone reference was either the read-only milestoned/demilestoned webhook event or an unrelated Linear-integration field. Both new functions go through the same installation-token/Orb-broker path as issue creation (#7425) — never a flat PAT.
  • Extends loopover_plan_repo_issues (#7426) with an optional milestone target (title/description/dueOn, all maintainer-supplied — never model-generated, per this sub-issue's own boundary). When creating ({create:true, dryRun:false}), the milestone is resolved once for the whole batch, then assigned to every issue actually created.
  • Reuse heuristic: an exact normalized-title match (reusing normalizeIssueTitleKey, already generic) against existing open milestones — deliberately not fuzzy. A fuzzy match risks silently grouping issues under the wrong milestone, which is worse than creating a new, differently-named one. This mirrors the manual convention .claude/skills/contributor-pipeline-gardening already follows (reusing one milestone across recurring rounds) instead of spawning a fresh one every planning run under the same title.
  • Milestone resolution degrades gracefully on any failure (a GitHub error, a suppressed/malformed create): the maintainer still gets their issues, just ungrouped (milestoneNumber absent in the result), rather than the whole batch failing over a milestone-specific glitch.
  • A dry-run preview makes no milestone-related GitHub calls at all, even when a milestone target is supplied — consistent with the tool's existing "nothing is written until {create:true, dryRun:false}" contract.
  • Sub-issue of #7424 (Epic: ORB self-hoster issue & milestone planning routine).

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run typecheck
  • npm run test:coverage locally — full unsharded suite: 1021 files / 19386 tests passed, 2 skipped. The same 9 pre-existing failures in 3 unrelated miner test files (tracked separately, unrelated to this PR) reproduce identically regardless of this change. New/changed code (src/github/milestones.ts, the milestone additions to src/services/issue-plan-draft.ts, the MCP wiring) is 100% branch-covered.
  • npm run build:mcp / npm run test:mcp-pack
  • npm run selfhost:env-reference:check / npm run ui:openapi:check / npm run docs:drift-check / npm run manifest:drift-check — all clean; no new env vars, no OpenAPI/manifest surface touched (MCP-only).
  • npm run ui:lint / npm run ui:typecheck / npm run ui:build / npm run test:workers — not run; this PR touches no files under apps/loopover-ui/** or Cloudflare-workers-pool-specific code.
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — test/unit/github-milestones.test.ts (7 tests, 100% branch coverage), milestone-specific additions to test/unit/issue-plan-draft.test.ts (6 new tests: no-op on dry run, create-new, reuse-by-normalized-title, empty-normalized-title, degrade-on-failure, no-installation) and test/unit/mcp-plan-repo-issues.test.ts (milestone round-trip).

If any required check was skipped, explain why:

  • ui:lint/ui:typecheck/ui:build/test:workers: no apps/loopover-ui/** or workers-pool-specific files changed.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests — non-2xx GitHub response, suppressed non-live mode, malformed response, missing installation, and milestone-resolution failure are all covered.
  • API/OpenAPI/MCP behavior is updated and tested where needed — MCP schema/tool extension fully tested; no HTTP/OpenAPI surface added.
  • UI changes use live API data or real empty/error/loading states. (N/A — no UI.)
  • Visible UI changes include a UI Evidence section. (N/A — backend/MCP-only change.)
  • Public docs/changelogs are updated where needed. (N/A — no user-facing docs surface beyond the tool's own description string, included in this diff.)

UI Evidence

N/A — this is a backend/MCP-only change with no visible UI, frontend, or docs surface.

Notes

  • Sub-issue of #7424. Extends #7426's loopover_plan_repo_issues tool (already merged, #7476), built on #7425's installation-token/Orb-broker write path (already merged, #7467).

Closes #7427

… tool

Adds src/github/milestones.ts (listOpenInstallationMilestones,
createInstallationMilestone) via the same installation-token/Orb-
broker path as issue creation (#7425). Extends
loopover_plan_repo_issues (#7426) with an optional milestone target:
resolve-or-create by exact normalized-title match against existing
open milestones (never fuzzy, to avoid silently grouping issues under
the wrong one), then assign it to every created issue.

Milestone title/description/dueOn are the caller's own input, never
model-generated. Resolution degrades gracefully on failure (issues
still get created, just ungrouped) rather than aborting the batch.

Closes #7427
@JSONbored JSONbored self-assigned this Jul 20, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.42%. Comparing base (98a8371) to head (20b5f7e).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7511      +/-   ##
==========================================
- Coverage   91.43%   91.42%   -0.02%     
==========================================
  Files         718      719       +1     
  Lines       73214    73253      +39     
  Branches    21692    21701       +9     
==========================================
+ Hits        66944    66972      +28     
- Misses       5227     5234       +7     
- Partials     1043     1047       +4     
Flag Coverage Δ
shard-1 32.84% <2.38%> (+6.65%) ⬆️
shard-2 34.13% <2.38%> (-3.20%) ⬇️
shard-3 30.50% <100.00%> (-5.87%) ⬇️
shard-4 44.95% <2.38%> (+2.03%) ⬆️
shard-5 36.03% <2.38%> (-2.16%) ⬇️
shard-6 36.19% <2.38%> (+2.49%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/github/issues.ts 100.00% <100.00%> (ø)
src/github/milestones.ts 100.00% <100.00%> (ø)
src/mcp/server.ts 96.45% <100.00%> (+<0.01%) ⬆️
src/services/issue-plan-draft.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@JSONbored
JSONbored merged commit 4b67bd9 into main Jul 20, 2026
17 checks passed
@JSONbored
JSONbored deleted the claude/orb-github-issue-automation-080318 branch July 20, 2026 19:16
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.

Spec: GitHub milestone creation/assignment capability (net-new)

1 participant