feat: gh-prs-ready-need-review — GitHub PR counters to Gather#11
feat: gh-prs-ready-need-review — GitHub PR counters to Gather#11yaustar wants to merge 8 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
|
btw - https://github.com/gathertown/webhook-objects/tree/main/packages/gh-prs-inbox isn't that far off from this, from what i'm seeing. Yours is more robust for sure |
Replace raw fetch calls with the octokit SDK and add --coverage to the package test script per review feedback. Co-authored-by: Cursor <cursoragent@cursor.com>
bgreenier
left a comment
There was a problem hiding this comment.
Looks like a little bit of lockfile hell here - can you nuke all the *lock* json/yaml files and then pnpm i
Remove explicit SIGINT handler, use production URLs in .env.example, and regenerate lockfiles (drop stray package-lock.json). Co-authored-by: Cursor <cursoragent@cursor.com>
|
[felix] Nuked |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0fd0edd. Configure here.
| q: query, | ||
| per_page: perPage, | ||
| }); | ||
| return (data.items ?? []) as GitHubPullRequest[]; |
There was a problem hiding this comment.
Search capped at one page
Medium Severity
searchIssues calls GitHub issue search once with per_page 100 and returns only data.items, with no pagination. When a query matches more than 100 PRs, extra results are dropped, so listOpenPrsForUser and listOpenReviewRequestedPrsForUser can under-report counts pushed via counter.set.
Reviewed by Cursor Bugbot for commit 0fd0edd. Configure here.
There was a problem hiding this comment.
This is fine. If we have more than 100 items, then we've gone past the size of the inbox anyway.
The workspace @webhook-objects/client is being removed in favor of the npm-published SDK (see #15): createWebhookObjectClient replaces new Client, send takes (type, data) and stamps the timestamp itself, ping() replaces requestMetadata(), and the client type is WebhookObjectClient. The @gathertown packages join the minimumReleaseAge exclusions since they are first-party. Co-authored-by: Cursor <cursoragent@cursor.com>


Summary
@webhook-objects/gh-prs-ready-need-review, a polling bot that mirrors two GitHub PR metrics to Gather Smart Objectcounterpresets via@webhook-objects/clientstart,ping, andresetscripts; config viapackages/gh-prs-ready-need-review/.env(see.env.example)--env-file-if-exists=.envso missing.envfails with a clear config error instead of Node exit code 9Test plan
.env.exampleto.envand fill in GitHub + Gather webhook credentialspnpm --filter @webhook-objects/gh-prs-ready-need-review ping— both objects respond towebhook.pingpnpm --filter @webhook-objects/gh-prs-ready-need-review reset— legacy activity slots cleared, counters resetpnpm --filter @webhook-objects/gh-prs-ready-need-review start— poll cycle logs PR counts and pushescounter.setpnpm --filter @webhook-objects/gh-prs-ready-need-review test— unit tests passNote
Low Risk
Self-contained new package with read-only GitHub API usage and outbound signed webhooks; secrets stay in local
.envwith no server-side deployment in this diff.Overview
Adds
@webhook-objects/gh-prs-ready-need-review, a long-running poller that pushes two GitHub PR counts to separate Gather Smart Objectcounterpresets via@gathertown/webhook-object-sdk(Octokit search API, notghCLI).Open PRs (14-day window): non-draft open PRs in
GITHUB_REPOwhere the authenticated user is author or assignee—two searches merged and deduped because search cannot OR user qualifiers.Review requests (7-day window): open PRs with a direct
user-review-requestedfor the user, noreview:approved, created in the last week.Config is env-based (
.env.example, validated URLs/secrets,POLL_INTERVAL_MS≥ 10s). Scripts:start(poll loop),ping,reset(clears legacyactivityslots andcounter.resetfor migration off inbox-style publishing). Vitest covers repo parsing and cutoff dates. Root.gitignoreadds.DS_Storeand.env;pnpm-workspace.yamlexempts Gather webhook SDK packages from minimum release age.Reviewed by Cursor Bugbot for commit 8ec3e8f. Bugbot is set up for automated code reviews on this repo. Configure here.