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

feat: add reviewers parameter to UpdatePullRequest#285

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

Merged
mattdholloway merged 32 commits intogithub:mainfromMayorFaj:feat/259/assign-reviewers
Jul 31, 2025

Conversation

@MayorFaj
Copy link
Contributor

This pull request introduces the ability to request reviewers when updating a pull request. The changes include updates to theUpdatePullRequest function to handle reviewers, modifications to the test cases to cover the new functionality, and updates to the documentation.

Enhancements toUpdatePullRequest function:

  • Added support for specifying GitHub usernames to request reviews from in theUpdatePullRequest function. (pkg/github/pullrequests.go)[1][2][3]
  • Ensured the function handles cases where no update is needed but reviewers are specified. (pkg/github/pullrequests.go)

Documentation updates:

  • UpdatedREADME.md to include the newreviewers parameter in the documentation for updating pull requests. (README.md)

Test case updates:

  • Added new test cases to cover scenarios with reviewers, including successful updates and failure cases. (pkg/github/pullrequests_test.go)[1][2][3][4][5]

updatereview

Closes:#259

CopilotAI review requested due to automatic review settingsApril 15, 2025 23:15
Copy link
Contributor

CopilotAI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

@MayorFajMayorFaj requested a review froma team as acode ownerApril 17, 2025 11:26
@MayorFajMayorFaj changed the titlefeat: add reviewers parameter to UpdatePullRequest and update testsfeat: add reviewers parameter to UpdatePullRequestApr 19, 2025
JoannaaKL
JoannaaKL previously approved these changesJun 24, 2025
@JoannaaKL
Copy link
Contributor

Hi@MayorFaj, can you please update the pr so we can get it merged? :)

MayorFaj reacted with thumbs up emoji

@MayorFajMayorFaj requested a review fromJoannaaKLJune 25, 2025 20:48
@MayorFaj
Copy link
ContributorAuthor

@JoannaaKL the PR has been updated

@deivyrene
Copy link

@JoannaaKL the PR has been updated

Could you update again because is out-of-date? Great PR!

MayorFaj reacted with thumbs up emoji

}

// If no updates and no reviewers, return error
if!updateNeeded&&len(reviewers)==0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we move this check before the line 316?

}else {
// If no update needed, just get the current PR
varghResp*github.Response
pr,ghResp,err=client.PullRequests.Get(ctx,owner,repo,pullNumber)
Copy link
Contributor

Choose a reason for hiding this comment

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

We we need this else? If no updates are needed and no new reviewers were requested we will just return an error (please see comment below).

Copy link
Contributor

@JoannaaKLJoannaaKL left a comment

Choose a reason for hiding this comment

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

Looks good! I'd update the part where we're fetching the pull request - I don't think we need that :)

MayorFaj reacted with thumbs up emojideivyrene and gustinn reacted with rocket emoji
@MayorFajMayorFaj requested a review fromJoannaaKLJuly 25, 2025 13:54
mattdhollowayand others added6 commitsJuly 29, 2025 19:07
* initial impl of pull request draft state update* appease linter* update README* add nosec* fixed err return type for json marshalling* add gql test
…b#775)* make repo optional, and default to .github when not provided. improve tool description* autogen* update tests* small copy paste error fixes
@MayorFaj
Copy link
ContributorAuthor

@JoannaaKL , if you get the chance could you please review this PR again so it can be merged asap. Has changes get merged to main, I am having to resolve conflicts, which is time consuming

JoannaaKL reacted with heart emoji

Copy link
Contributor

@mattdhollowaymattdholloway left a comment

Choose a reason for hiding this comment

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

Mostly looks good, just a few changes in reference to the recent draft updates to the PR tool

MayorFaj reacted with thumbs up emoji
Comment on lines 618 to 633
iftc.expectedPR.Title!=nil {
assert.Equal(t,*tc.expectedPR.Title,*returnedPR.Title)
}
iftc.expectedPR.Body!=nil {
assert.Equal(t,*tc.expectedPR.Body,*returnedPR.Body)
}
iftc.expectedPR.State!=nil {
assert.Equal(t,*tc.expectedPR.State,*returnedPR.State)
}
iftc.expectedPR.Base!=nil&&tc.expectedPR.Base.Ref!=nil {
assert.NotNil(t,returnedPR.Base)
assert.Equal(t,*tc.expectedPR.Base.Ref,*returnedPR.Base.Ref)
}
iftc.expectedPR.MaintainerCanModify!=nil {
assert.Equal(t,*tc.expectedPR.MaintainerCanModify,*returnedPR.MaintainerCanModify)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This change is out of scope for this PR

MayorFaj reacted with thumbs up emoji
Comment on lines 342 to 345
mock.WithRequestMatch(
mock.GetReposPullsByOwnerByRepoByPullNumber,
mockNoUpdatePR,
),
Copy link
Contributor

Choose a reason for hiding this comment

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

Getting the PR here is not needed

MayorFaj reacted with thumbs up emoji
Comment on lines 178 to 182
mockNoUpdatePR:=&github.PullRequest{
Number:github.Ptr(42),
Title:github.Ptr("Test PR"),
State:github.Ptr("open"),
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed as well due to the referencing test not being required

@MayorFaj
Copy link
ContributorAuthor

@mattdholloway Thanks for the feedback, changes updated, unused mock test removed

}

// If no updates, no draft change, and no reviewers, return error early
if!restUpdateNeeded&&!draftProvided&&len(reviewers)==0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

We could simplify it to
!(restUpdateNeeded || draftProvided || len(reviewers) != 0)

@mattdhollowaymattdholloway merged commit45e90ae intogithub:mainJul 31, 2025
10 checks passed
nickytonline pushed a commit to nickytonline/github-mcp-http that referenced this pull requestOct 4, 2025
* feat: add reviewers parameter to UpdatePullRequest and update tests* Update pullrequests.go* feat: enhance update pull request functionality with reviewers support* update README to clarify optional reviewers parameter in API documentation- go run ./cmd/github-mcp-server generate-docs* feat: enhance UpdatePullRequest to return early if no updates or reviewers are provided* Add updating draft state to `update_pull_request` tool (github#774)* initial impl of pull request draft state update* appease linter* update README* add nosec* fixed err return type for json marshalling* add gql test* Add support for org-level discussions in list_discussions tool (github#775)* make repo optional, and default to .github when not provided. improve tool description* autogen* update tests* small copy paste error fixes* refactor: streamline UpdatePullRequest logic and enhance test cases for reviewer updates* refactor: remove redundant draft update tests and streamline UpdatePullRequest logic* test: add unit tests for updating pull request draft state* refactor: simplify UpdatePullRequest tests by removing unused mock data---------Co-authored-by: Matt Holloway <mattdholloway@github.com>Co-authored-by: Tommaso Moro <37270480+tommaso-moro@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@JoannaaKLJoannaaKLJoannaaKL approved these changes

@juruenjuruenAwaiting requested review from juruen

@SamMorrowDrumsSamMorrowDrumsAwaiting requested review from SamMorrowDrums

@williammartinwilliammartinAwaiting requested review from williammartin

@tobytobyAwaiting requested review from toby

@mattdhollowaymattdhollowayAwaiting requested review from mattdholloway

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add functionality to assign reviewers to pull requests

5 participants

@MayorFaj@JoannaaKL@deivyrene@mattdholloway@tommaso-moro

[8]ページ先頭

©2009-2025 Movatter.jp