Repository navigation
Conversation
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
There was a problem hiding this comment.
🟡 Changes recommended
The new rule is missing required README documentation, breaking the parity test, and incorrectly flags unpaginated endpoints such as listLanguages.
2 open issues
What changed in this PR
Adds a custom ESLint rule to help detect missing explicit page sizes in Octokit REST list calls used by gh-aw’s setup scripts.
Changes:
- Detects
rest.<namespace>.list*({...})calls withoutper_page, skipping spreads and non-literal arguments. - Adds tests for reported calls, supported exclusions, and the documentation URL.
- Registers the rule and enables it at warning level.
| File | Description |
|---|---|
eslint-factory/src/rules/require-per-page-on-github-list-call.ts |
Implements call matching and missing-page-size diagnostics. |
eslint-factory/src/rules/require-per-page-on-github-list-call.test.ts |
Adds valid and invalid rule cases and a documentation URL check. |
eslint-factory/src/index.ts |
Registers the new rule in the plugin. |
eslint-factory/eslint.config.cjs |
Enables the rule as a warning. |
Review effort: Balanced (auto)
| "no-misplaced-error-code-definition": noMisplacedErrorCodeDefinitionRule, | ||
| "require-fs-chmod-try-catch": requireFsChmodTryCatchRule, | ||
| "no-single-char-string-replace": noSingleCharStringReplaceRule, | ||
| "require-per-page-on-github-list-call": requirePerPageOnGithubListCallRule, |
There was a problem hiding this comment.
Added the missing rule table row and documentation section in eslint-factory/README.md. The fix is in commit f958219.
|
|
||
| function isRestListCallee(callee: TSESTree.Expression): string | null { | ||
| // Matches <client>.rest.<namespace>.list*(...) | ||
| if (callee.type !== "MemberExpression" || callee.computed || callee.property.type !== "Identifier" || !callee.property.name.startsWith("list")) { |
There was a problem hiding this comment.
Excluded repos.listLanguages, which does not support pagination, and added a regression test. The fix is in commit f958219.
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Found one correctness issue: the rule treats per_page: undefined as compliant even though the parameter is omitted and the API still uses the default page size. Please address this false negative and add regression coverage. Other reviewed paths did not reveal additional merge-blocking issues.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
| if (arg.properties.some(p => p.type === "SpreadElement")) { | ||
| return; | ||
| } | ||
| const hasPerPage = arg.properties.some(p => p.type === "Property" && ((!p.computed && p.key.type === "Identifier" && p.key.name === "per_page") || (p.key.type === "Literal" && p.key.value === "per_page"))); |
There was a problem hiding this comment.
This only checks that the key exists, so per_page: undefined (and void 0) still passes lint and is omitted from the request, leaving Octokit at its default page size. That directly defeats the rule’s purpose of preventing silent truncation. Please reject statically undefined values (and add a regression test), while retaining dynamic variables that cannot be proven undefined.
There was a problem hiding this comment.
The rule now reports per_page: undefined and per_page: void 0, while still accepting dynamic values. Regression tests are included in commit f958219.
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /diagnosing-bugs (regression-test check). Requesting changes: the new rule is not documented in the README, so an existing test will fail.
📋 Key Themes & Highlights
Key Themes
- Blocking, documentation parity:
src/index.tsregistersrequire-per-page-on-github-list-call, buteslint-factory/README.mdhas no table row or###section.src/index-readme-parity.test.tsasserts each exported rule is documented exactly once, sonpm testwill fail. I confirmed the mismatch statically by diffing the registered rules against README headers. - Test coverage gap: the quoted
"per_page"key branch is untested.
Positive Highlights
- ✅ Conservative design: spreads and non-literal arguments are skipped, which keeps false positives low.
- ✅ The
list*/.rest.<ns>callee matching is tight and computed-member access is excluded. - ✅ The PR body documents the local scan, so the low-noise claim is verifiable.
Validation note
I could not run npm ci here: the sandbox network presents a self-signed certificate. The README finding is therefore based on a static check, not a test run. The author should run npm test in eslint-factory/ to confirm.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~3 AIC · ⌖ ~2 AIC · ⊞ 6.3K
Comment /matt to run again
| "no-misplaced-error-code-definition": noMisplacedErrorCodeDefinitionRule, | ||
| "require-fs-chmod-try-catch": requireFsChmodTryCatchRule, | ||
| "no-single-char-string-replace": noSingleCharStringReplaceRule, | ||
| "require-per-page-on-github-list-call": requirePerPageOnGithubListCallRule, |
There was a problem hiding this comment.
[/tdd] Blocking: this rule is registered here, but eslint-factory/README.md has no Rules table row and no ### require-per-page-on-github-list-call section. src/index-readme-parity.test.ts requires every exported rule to be documented exactly once, so that test will fail. The docs.url anchor asserted by the rule test (#require-per-page-on-github-list-call) will also not resolve.
💡 Suggested README addition
Add a row to the Rules table: | [require-per-page-on-github-list-call](#require-per-page-on-github-list-call) | Require an explicit per_page on Octokit REST list* calls, which otherwise return only the default 30 items |. Then add a section after the other rule sections showing the flagged form github.rest.issues.listComments({ owner, repo, issue_number: 1 }) and the safe alternative that passes per_page: 100 or uses github.paginate.
The PR validation only ran the rule test file, which is why this slipped through.
@copilot please address this.
There was a problem hiding this comment.
Added the README rules-table entry and documentation section; npm test now passes the rule documentation parity test. The fix is in commit f958219.
| `async function f() { await github.rest.issues.listComments(params); }`, | ||
| `async function f() { await github.rest.issues.get({ owner, repo, issue_number: 1 }); }`, | ||
| `async function f() { await github.paginate(github.rest.issues.listComments, { owner, repo }); }`, | ||
| `async function f() { await list.listItems({ owner }); }`, |
There was a problem hiding this comment.
[/tdd] The quoted "per_page" key branch in the rule (p.key.type === "Literal") has no test, so a regression there would pass silently. Add a valid case alongside the others.
💡 Suggested test
async function f() { await github.rest.issues.listComments({ owner, repo, "per_page": 100 }); }
Quoted keys are valid JavaScript, so covering them pins down the rule conservative handling.
@copilot please address this.
There was a problem hiding this comment.
Added a valid regression case for the quoted "per_page" key. The fix is in commit f958219.
|
@copilot run pr-finisher skill |
Co-authored-by: pelikhan <[email protected]>
|
🎉 This pull request is included in a new release. Release: |


New rule:
require-per-page-on-github-list-callFlags Octokit
<client>.rest.<ns>.list*({...})calls with noper_page, which silently return only the default 30 items. Conservative: skips spreads and non-literal arguments.Research
gh issue list --search "actions/setup/js created:>=2026-10-26"; discussions listed via the REST API for the same window.actions/setup/jsfound 1 real hit:restore_aic_usage_cache_fallback.cjs:146(listWorkflowRunArtifactswithoutper_page). All other list calls already passper_page, so the rule is low-noise. The hit is left unfixed (rule iswarn).Validation (from
eslint-factory)npm ci: oknpm run build: oknpm test -- src/rules/require-per-page-on-github-list-call.test.ts: 2 passednpm run lint:setup-js: exit 0, 0 errors, 1062 warnings (all pre-existing apart from the 1 new-rule hit above)Steering issue #76113 had no
steercomments.