feat(agent): auto-match PRs to open GitHub Milestones in suggest-mode (#3183) - #3256
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 1335a70 | Commit Preview URL Branch Preview URL |
Jul 04 2026, 11:24 PM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3256 +/- ##
==========================================
+ Coverage 94.11% 94.12% +0.01%
==========================================
Files 275 276 +1
Lines 30120 30191 +71
Branches 10993 11010 +17
==========================================
+ Hits 28347 28418 +71
Misses 1127 1127
Partials 646 646
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-04 23:43:10 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
…#3183) Adds a ProjectTrackerAdapter interface (src/integrations/project-tracker-adapter.ts) with a GitHubMilestonesAdapter implementation, so #3184 (Projects v2) and #3186 (Linear) slot in without reshaping the matching/suggestion logic. Matching reuses the existing tokenize/termOverlap primitives from the duplicate-PR collision detector (now exported), at a stricter threshold than that gate since misattaching tracked progress is worse than an advisory-only duplicate note. New tri-state autoProjectMilestoneMatch setting (off/suggest/auto, default off), wired through the full config-as-code chain: migration, Drizzle schema, DB resolver, OpenAPI, and .gittensory.yml parity, mirroring the reviewCheckMode template. "auto" behaves like "suggest" until #3185 wires real milestone attachment. Hooked into the main PR-webhook path right after the existing linked-issue evidence gathering, entirely independent of the gate/disposition -- a missed or wrong match never affects CI or merge.
… handler The processors.ts call site passed an inline onError closure whose console.error body lived in the huge webhook file and was only reachable through a full pipeline test, leaving it uncovered (codecov/patch: 50% on that file). maybeSuggestMilestoneMatchForPr now takes deliveryId directly and does its own logging internally, where it already has dedicated, isolated test coverage -- the processors.ts call site is now a plain data object literal with no logic of its own.
99961e3 to
1335a70
Compare
… comment Gate review found a real gap: GitHub milestones and issue comments both paginate at 100 per page, but listOpenMilestones and the suggest comment's marker search only ever read page 1 -- a repo with >100 open milestones, or a busy PR with >100 comments, could silently miss a match or double-post. Both now page up to a bounded limit (mirroring the same pattern already used in src/github/comments.ts). Also: attachToMilestone now rejects a non-positive-integer milestoneId instead of sending NaN to GitHub, and the suggestion comment code-formats the milestone title (stripping literal backticks) so a maintainer-authored title containing @mentions or markdown emphasis can't leak into the rendered comment.
Summary
ProjectTrackerAdapterinterface (src/integrations/project-tracker-adapter.ts) with aGitHubMilestonesAdapterimplementation, so feat(agent): auto-match PRs to open GitHub Projects v2 (suggest-mode) #3184 (Projects v2) and feat(agent): Linear adapter for project/milestone matching #3186 (Linear) slot in later without reshaping the matching/suggestion logic.tokenize/termOverlapprimitives from the duplicate-PR collision detector (src/signals/engine.ts, now exported) at a stricter threshold (0.65 score + 3 shared terms vs. the duplicate-PR gate's 0.58/2) — misattaching tracked progress is worse than an advisory-only duplicate note.autoProjectMilestoneMatchsetting (off/suggest/auto, defaultoff), wired through the full config-as-code chain (migration, Drizzle schema, DB resolver, OpenAPI,.gittensory.ymlparity) mirroring thereviewCheckModetemplate."auto"behaves identically to"suggest"until feat(agent): promote project/milestone matching to auto-apply mode #3185 wires real milestone attachment — no attach code exists yet, so treating it as silently inert would be worse than degrading to the safe, visible suggest behavior.maybeSuggestMilestoneMatchForPrfunction so the webhook handler's own call site stays a single unconditional call, easy to reason about and outside the huge webhook file's own test burden.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
typecheck,git diff --check,db:migrations:check,ui:openapi:check(regenerated + verified), and every affected suite directly (test/unit/project-tracker-adapter.test.ts— 20 tests, 100% branch/line coverage locally on the new adapter file;test/unit/repository-settings-project-milestone-match.test.ts— 5 tests;test/unit/focus-manifest.test.ts,test/unit/settings-preview.test.ts,test/unit/openapi.test.ts,test/unit/ci-openapi-settings-parity.test.ts,test/unit/selfhost-config-examples.test.ts,test/unit/signals*.test.ts) plusnpm run test:changed(232 files / 5888 tests, all green — this touchessrc/queue/processors.tsso it coverstest/unit/queue.test.ts, 482 tests, too). No UI/MCP/workers files touched, soui:*/test:workers/build:mcp/test:mcp-packare out of scope. CI runs the full gate on push.Safety
autoProjectMilestoneMatchadded to all 4reviewCheckMode-sibling locations insrc/openapi/schemas.ts, regenerated vianpm run ui:openapi.)UI Evidencesection below... (N/A — backend-only change, no visible UI.)UI Evidence
N/A — backend-only change, no visible UI.
Notes
maybeSuggestMilestoneMatch's idempotency check (GET comments, look for a marker, then POST) doesn't have the canonical-comment/duplicate-cleanup robustness thatsrc/github/comments.ts's sticky-panel-comment helper has, so two near-simultaneous webhook deliveries for the same PR could theoretically both post a suggestion comment. For a best-effort, advisory-only comment this is a cosmetic risk, not a correctness one — flagging it rather than expanding this PR's scope to fix it; happy to follow up if it's observed in practice.