Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enhance get_pull_request_diff tool with pagination and file filtering options#627

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
kaovilai wants to merge3 commits intogithub:main
base:main
Choose a base branch
Loading
fromkaovilai:diff-pagination

Conversation

kaovilai
Copy link

@kaovilaikaovilai commentedJul 1, 2025
edited
Loading

Signed-off-by: Tiger Kaovilaipassawit.kaovilai@gmail.com

Closes:#625

… optionsSigned-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
@kaovilaikaovilai marked this pull request as ready for reviewJuly 2, 2025 00:05
@CopilotCopilotAI review requested due to automatic review settingsJuly 2, 2025 00:05
@kaovilaikaovilai requested a review froma team as acode ownerJuly 2, 2025 00:05
Copilot

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kaovilaikaovilai requested a review fromCopilotJuly 2, 2025 01:32
Copilot

This comment was marked as outdated.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kaovilaikaovilai requested a review fromCopilotJuly 2, 2025 01:34
Copy link
Contributor

@CopilotCopilotAI 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

Enhance theget_pull_request_diff tool by adding pagination and file-filtering capabilities to handle large pull requests efficiently.

  • Introduces new parameters:fileList,files,pathPrefix,page, andperPage
  • Implements paginated list mode and specific-file/path-prefix diff modes
  • Updates tests, toolsnap, and README to cover new functionality

Reviewed Changes

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

FileDescription
pkg/github/pullrequests.goAdded imports, parameters, and logic for pagination and filters
pkg/github/pullrequests_test.goAdded tests for file list mode with pagination, path prefix, specific files, and full diff
pkg/github/toolsnaps/get_pull_request_diff.snapUpdated snapshot to include new input schema properties
README.mdDocumented new parameters (fileList,files,pathPrefix,page,perPage)
Comments suppressed due to low confidence (4)

pkg/github/pullrequests.go:1689

  • The branch handlingpathPrefix withoutfileList isn’t covered by tests; add a test case invokingpathPrefix alone to verify correct diff output.
if len(params.Files) > 0 || params.PathPrefix != "" {

pkg/github/pullrequests.go:9

  • The code uses json.Marshal in the fileList block but the import for "encoding/json" is missing; addimport "encoding/json".
"strings"

pkg/github/pullrequests.go:1694

  • Each call to ListFiles returns a Response with an open body; adddefer resp.Body.Close() inside the loop to avoid leaking HTTP connections.
files, resp, err := client.PullRequests.ListFiles(ctx, params.Owner, params.Repo, int(params.PullNumber), opts)

pkg/github/pullrequests.go:1660

  • [nitpick] Filtering byPathPrefix is duplicated in both the fileList and specific-files branches; consider extracting a reusable helper function.
if params.PathPrefix != "" {

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add pagination support for get_pull_request_diff to handle large PRs
1 participant
@kaovilai

[8]ページ先頭

©2009-2025 Movatter.jp