Operator limits: one clear pull request notice when a review is refused
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github, typescript
Research direction
Start from the claim path that refuses a job with quota_exhausted or workspace_suspended, which depends on #277 and should be merged first. Add a small notice module with its dedupe table, using the existing provider client and the fake GitHub review API for comment endpoints, and put the English text in src/copy/. Done means T01 to T10 pass, with one comment per pull request and period, no untrusted text, and no notice when GitHub refuses or the instance has no entitlements.
Written by the indexing model from the issue text.
Description
Part of #268. Depends on #277.
Problem
A review refused for a limit or a suspension (#277) ends as a failed run on the Runs page. The people who care are on the pull request, not on the Runs page: from where they stand the bot has gone silent. The refusal needs a short, clear message on the pull request, once, without creating any cost or confusion on every push.
Behavior
- When the claim refuses a job with
quota_exhaustedorworkspace_suspended, the app posts one comment on that pull request with the bot's identity, using the installation token of the job's connection (the same way the app already gets installation access for a job; no runner is involved, no model is called). It is best effort: a failure to post does not change the job's outcome and is logged with the code only. - One per pull request and period. Further pushes and manual reviews on the same pull request in the same period do not post again; the next period (a later
period_start) may post again. A small record keyed by workspace, repository, pull request number and period start provides this; the comment carries a hidden marker so a second app instance does not duplicate it. - Text (English, in
src/copy/): says that this workspace has used the reviews included for the current period (or that reviews are paused for this workspace), that no review ran for this change, and who can act (the workspace's Owners and Admins). No amounts, no figures, no reasons for a suspension, no counts of other pull requests. If the instance has configured a plan page (#284), a link to the app's plan page of the workspace (/w/<slug>/settings/plan, #282) may be included; without it, no link. - Pull request titles, branch names and descriptions are untrusted and never appear in the text. A closed pull request, or a draft that automatic review skips, gets no notice.
- The comment is not edited or deleted when the limit later lifts: the next review's own comment follows it.
- Settings for notices: always on when an entitlement refuses; no switch.
Scope
A small notice module and its dedupe table (scoped repository, classified in scoping.test.ts), the GitHub write through the existing provider client, the fake GitHub review API (already has comment endpoints), copy, docs.
Out of scope
Notices for other refusals (llm_not_configured, gate off), editing or removing old notices, email, notifications outside GitHub.
Test cases
| ID | kind | level | case | expected |
|---|---|---|---|---|
| T01 | behavior | integration | a job refused with quota_exhausted |
exactly one comment on the pull request via the fake GitHub; no runner credential, no model call |
| T02 | behavior | integration | a second push and a manual review on the same pull request in the same period | no second comment |
| T03 | behavior | integration | period_start moves forward and the limit is hit again |
a new comment is allowed |
| T04 | behavior | integration | workspace_suspended |
a neutral comment with no reason |
| T05 | security | unit | comment text | contains no amount, count, reason or untrusted pull request text |
| T06 | negative | integration | GitHub refuses the comment (403, 404, timeout) | job outcome unchanged, one log line with the code, no retry storm |
| T07 | behavior | integration | closed pull request, or a draft skipped by automatic review | no comment |
| T08 | security | integration | two app instances refuse the same job concurrently | one comment (marker or dedupe record) |
| T09 | behavior | integration | no plan page configured | no link in the text |
| T10 | regression | integration | an instance with no entitlements | never posts such a comment |
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 226
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ExpidetGames/code-reviewer
-
area: app type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ExpidetGames/code-reviewer#308 ·
Maintainers usually reply within 1 day
-
type: docs
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ExpidetGames/code-reviewer#94 ·
Maintainers usually reply within 1 day
-
area: ops type: feature
Difficulty 5/5 Over a week Newbie friendliness 30/100
ExpidetGames/code-reviewer#414 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ExpidetGames/code-reviewer#406 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
ExpidetGames/code-reviewer#401 ·
Maintainers usually reply within 1 day
All issues in ExpidetGames/code-reviewer
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
chrisparsons83/flexspotff#215 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vitest-dev/vitest#11633 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day