Skip to content

Add boundaries to pagination #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 3, 2025
Merged

Add boundaries to pagination #86

merged 4 commits into from
Apr 3, 2025

Conversation

williammartin
Copy link
Collaborator

Description

Fixes #80

Reviewer Notes

There are no tests for this, also, it's not clear to me why search_repositories and list_commits have no minimum bounds on page but I'm doing the minimum to match anthropic right now.

@Copilot Copilot AI review requested due to automatic review settings April 3, 2025 20:00
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds boundaries to pagination parameters to ensure that the "per_page" values remain between 1 and 100 and that the "page" value is at least 1.

  • Enforces minimum and maximum limits on the "per_page" parameter for code search, user search, and issues search.
  • Enforces a minimum bound on the "page" parameter in each function.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/github/search.go Added mcp.Min and mcp.Max validations for pagination options in searchCode and searchUsers functions.
pkg/github/issues.go Added mcp.Min and mcp.Max validations for pagination options in searchIssues function.
Comments suppressed due to low confidence (2)

pkg/github/search.go:91

  • The new pagination boundary validations in this file are not covered by tests. Consider adding test cases to ensure the validations behave as expected.
mcp.Min(1),

pkg/github/issues.go:167

  • The pagination validation changes in this file lack test coverage. It is recommended to add tests verifying that the minimum and maximum boundaries are enforced correctly.
mcp.Min(1),

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

Copy link
Collaborator

@SamMorrowDrums SamMorrowDrums left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow-oh

SamMorrowDrums
SamMorrowDrums previously approved these changes Apr 3, 2025
Base automatically changed from wm-kw/enum-strings to main April 3, 2025 21:31
@SamMorrowDrums SamMorrowDrums dismissed their stale review April 3, 2025 21:31

The base branch was changed.

@SamMorrowDrums SamMorrowDrums merged commit 87d4407 into main Apr 3, 2025
16 checks passed
@SamMorrowDrums SamMorrowDrums deleted the wm/boundaries branch April 3, 2025 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Various tools are missing pagination property bounds or are not using matching case
2 participants