feat(api): REST + CLI mirror for contributor notifications (#6745) - #7018
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7018 +/- ##
=======================================
Coverage 93.72% 93.73%
=======================================
Files 690 690
Lines 68560 68580 +20
Branches 18743 18746 +3
=======================================
+ Hits 64261 64281 +20
Misses 3302 3302
Partials 997 997
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-17 18:14:53 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Adds the REST + CLI mirror for the
loopover_list_notificationsandloopover_mark_notifications_readMCP tools, closing the last gap in the/v1/contributors/:login/*read family for a contributor's own notification feed.GET /v1/contributors/:login/notifications— returns the badge notification feed ({ login, unreadCount, notifications }), self-scoped viarequireContributorAccess, reusinglistNotificationDeliveriesForRecipient+buildNotificationFeed— the exact pathLoopoverMcp.listNotificationstakes.POST /v1/contributors/:login/notifications/read— marks the contributor's delivered notifications read viamarkNotificationDeliveriesRead; an absent/empty body marks all, a validatedidsarray marks those. Returns{ login, marked }.loopover-mcp notificationsandloopover-mcp notifications-read [--id <id>]..., mirroring the sibling contributor commands' login resolution (--login/ active session /LOOPOVER_LOGIN/GITHUB_LOGIN) and--jsoncontract.NotificationFeed/NotificationsMarkedschemas;openapi.jsonregenerated.Why
The route file already framed contributor notifications as an MCP-parity gap the REST leg was never built for, while every sibling read (
/profile,/decision-pack,/open-pr-monitor) already has a REST + CLI surface. This brings notifications to the same parity, reusing the existing repository + feed-builder functions with no new business logic.Validation
npm run typecheck,npm run ui:openapi:check,npm run command-reference:check,npm run docs:drift-check— all green.test/unit/routes-notifications.test.ts(12 cases) drives 100% line + branch coverage on both new routes: feed shape and unread count, exclusion of still-pending rows, mark-all vs mark-by-id, malformed-body 400, the auth guard (unauthenticated + shared-mcp-token 403 per fix(mcp): scope GITTENSORY_MCP_TOKEN read access to the operator allowlist, not just write/manage #2455), and output parity with both MCP tools for identical input.test/unit/mcp-cli-notifications.test.ts(12 cases) covers the CLI:--jsonbyte-parity with the route, plain-text rendering,--idforwarding vs mark-all, login resolution, ANSI-escape sanitization of API-chosen text, and self-documentation in--help/ completion.Closes #6745