Repository navigation
Reject list_label perPage values outside 1..100 - #3649
vshalpnjabi wants to merge 4 commits into
Conversation
6f56a99 to
c11d716
Compare
|
Thanks — this is the earlier of the two equivalent fixes for #3647. Please add focused boundary tests for |
|
Added boundary tests for |
There was a problem hiding this comment.
🟡 Changes recommended
The implementation and tests do not consistently satisfy the documented unified perPage error contract, and the claimed registered-tool coverage is missing.
3 open issues
What changed in this PR
This pull request updates list_label pagination to distinguish omitted perPage values from explicit invalid values and enforce the advertised 1..100 range.
Changes:
- Rejects
perPagevalues below 1 or above 100. - Preserves the default page size when
perPageis omitted. - Adds boundary and handler coverage for invalid page sizes.
| File | Summary |
|---|---|
pkg/github/params.go |
Updates cursor-pagination validation to enforce the lower bound; review notes identify an error-message contract mismatch. |
pkg/github/params_test.go |
Adds boundary tests for cursor-pagination values. |
pkg/github/labels.go |
Preserves omitted-versus-explicit perPage behavior; review notes identify inconsistent range-error wording. |
pkg/github/labels_test.go |
Adds coverage for explicit perPage: 0; review notes that the described session-based registered-tool test is not present. |
Review effort: Lite (auto)
|
@SamMorrowDrums I moved the |

Summary
list_labelnow rejectsperPagevalues outside 1..100 instead of passing 0 through.Why
The advertised schema says
minimum: 1, but the runtime input schema doesn't enforce it, soperPage: 0reached the handler and was silently replaced with the default page size.Fixes #3647
What changed
listLabelsLegacyreadsperPageonly when it's present, so an explicit 0 is rejected instead of falling back to the default. Out-of-range values returnperPage value N is below minimum of 1orperPage value N exceeds maximum of 100fromToGraphQLParams. The default still applies when it's omitted.perPage: 0case to thelist_labelhandler tests.CursorPaginationParams.ToGraphQLParamstests for 1, 100, 0, -1 and 101 that check the exact error messages, plus a case with anAftercursor. The coverage is moved over from Fix #3647: reject perPage values below 1 in list_label #3659.MCP impact
list_labelreturns a tool error forperPage0 or below, matching the schema it already advertises. The schema is unchanged.Prompts tested (tool changes only)
Security / limits
Tool renaming
Lint & tests
./script/lint./script/testAlso ran
go test -v ./...,UPDATE_TOOLSNAPS=true go test ./...(no snapshot changes) andscript/generate-docs(no diff).Docs