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 mark_pr_ready_for_review tool#423

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
efouts wants to merge3 commits intogithub:main
base:main
Choose a base branch
Loading
fromefouts:feat/mark-pr-ready-for-review

Conversation

efouts
Copy link

This commit introduces a new tool,mark_pr_ready_for_review, which allows changing a GitHub pull request from a draft state to ready for review.

This tool utilizes the GitHub GraphQL API'smarkPullRequestReadyForReview mutation, as the REST API does not support this specific state transition for existing draft PRs.

The implementation includes the tool logic, its registration in the pull_requests toolset, and comprehensive tests.

@CopilotCopilotAI review requested due to automatic review settingsMay 22, 2025 06:25
@efoutsefouts requested a review froma team as acode ownerMay 22, 2025 06:25
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

Introduce a new tool to transition draft GitHub pull requests to ready-for-review state via GraphQL, including command registration, implementation, and tests.

  • Register themark_pr_ready_for_review tool in the server toolset.
  • Implement the GraphQL query and mutation for marking a PR as ready for review.
  • Add comprehensive unit tests for success and failure scenarios.

Reviewed Changes

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

FileDescription
pkg/github/tools.goRegister newmark_pr_ready_for_review tool.
pkg/github/pullrequests.goImplement GraphQL logic for marking draft PRs as ready for review.
pkg/github/pullrequests_test.goAdd unit tests covering various success/failure cases for the new tool.
Comments suppressed due to low confidence (2)

pkg/github/pullrequests_test.go:2295

  • Add a test case for failure to obtain the GraphQL client (e.g., havegetGQLClient return an error) to verify the handler surfaces this as a tool error instead of returning a raw error.
func TestMarkPullRequestReadyForReview(t *testing.T) {

pkg/github/pullrequests.go:1638

  • Add a test to cover parameter decoding failures (e.g., missing or wrong-typeowner/repo/pullNumber) so you can confirm those errors are returned as tool errors.
if err := mapstructure.Decode(request.Params.Arguments, &params); err != nil {

@efoutsefouts requested a review fromCopilotMay 22, 2025 23:51
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

Adds a new CLI tool (mark_pr_ready_for_review) that transitions a draft GitHub pull request to ready-for-review via the GraphQL API.

  • Registers the new tool in the existing toolset.
  • Implements the GraphQL query/mutation logic inpullrequests.go.
  • Provides comprehensive unit tests for success and failure scenarios.

Reviewed Changes

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

FileDescription
pkg/github/tools.goRegistersMarkPullRequestReadyForReview in toolset
pkg/github/pullrequests.goImplements the new GraphQL-based ready-for-review tool
pkg/github/pullrequests_test.goAdds tests covering all new tool behaviors
Comments suppressed due to low confidence (1)

pkg/github/pullrequests.go:1664

  • The local variablesowner,repo, andpullNumber are parsed above, but the code mistakenly references an undefinedparams struct here. Update thevariables map to use the parsed locals, e.g.:"owner": githubv4.String(owner),"repo": githubv4.String(repo), and"prNum": githubv4.Int(pullNumber).
"owner": githubv4.String(params.Owner),

@efoutsefoutsforce-pushed thefeat/mark-pr-ready-for-review branch from8731a4c to43d6692CompareMay 23, 2025 00:41
@efoutsefouts requested a review fromCopilotMay 23, 2025 00:42
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

This PR introduces a new tool, mark_pr_ready_for_review, to change a draft pull request into a ready for review state by using the GitHub GraphQL API.

  • Registers the new tool in the toolset.
  • Implements the GraphQL mutation to mark PRs as ready.
  • Adds comprehensive tests to validate the tool's behavior.

Reviewed Changes

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

FileDescription
pkg/github/tools.goRegisters the new MarkPullRequestReadyForReview tool
pkg/github/pullrequests_test.goAdds tests covering success and various failure scenarios for the new tool
pkg/github/pullrequests.goImplements the GraphQL logic for marking a pull request ready for review

@efoutsefoutsforce-pushed thefeat/mark-pr-ready-for-review branch from43d6692 to2b5ec67CompareMay 23, 2025 05:07
@SamMorrowDrums
Copy link
Collaborator

Thanks very much for the contribution@efouts I was thinking about this PR and wondering if it might make sense to convert it toset_pr_state and provide an enum for setting the PR to draft, as well as marking as ready tor review. WDYT?

@efouts
Copy link
Author

efouts commentedMay 23, 2025
edited
Loading

Thanks very much for the contribution@efouts I was thinking about this PR and wondering if it might make sense to convert it toset_pr_state and provide an enum for setting the PR to draft, as well as marking as ready tor review. WDYT?

@SamMorrowDrums happy to do that or add another tool mirroring theconvertpullrequesttodraft mutation. which is most in line with the project?

(edit) I went ahead and updated to beset_pr_state with the guess that is the preference.

SamMorrowDrums reacted with heart emoji

This commit introduces a new tool that allows changing a GitHub pullrequest from draft state to ready for review.The implementation uses GitHub's GraphQL API with the'markPullRequestReadyForReview' mutation, as the REST API doesn'tsupport this state transition for existing draft PRs.Also fixes the GraphQL query by correcting 'Draft' to 'IsDraft' fieldname, ensuring proper detection of a PR's draft status.The changes include:- New tool implementation in the pull_requests toolset- Comprehensive tests- GraphQL query field correction
Based on code review feedback, made the following improvements:- Rename 'variables' to 'vars' for consistency with other GraphQL functions- Improve comment precision for GraphQL schema requirementsThese changes enhance code consistency and documentation clarity whilemaintaining full functionality. All tests, linting, and build checks pass.
- Replace mark_pr_ready_for_review with set_pr_status tool- Add bidirectional PR status changes (draft ↔ ready_for_review)- Use enum parameter for status: "draft", "ready_for_review"- Implement GraphQL mutations for both directions- Add comprehensive test suite with 8 test scenarios- Remove deprecated MarkPullRequestReadyForReview functionAddresses user feedback to provide enum-based PR status managementwith support for setting PRs to both draft and ready-for-review states.
@efoutsefoutsforce-pushed thefeat/mark-pr-ready-for-review branch from2b5ec67 to650aac6CompareMay 23, 2025 16:38
@efoutsefouts requested a review fromCopilotMay 23, 2025 16:41
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

This PR adds a new tool, mark_pr_ready_for_review, to allow changing a GitHub pull request's state from draft to ready-for-review (and vice versa), using the GitHub GraphQL API.

  • Added a new tool registration (SetPRStatus) in pkg/github/tools.go.
  • Implemented the tool logic in pkg/github/pullrequests.go with corresponding tests in pkg/github/pullrequests_test.go.

Reviewed Changes

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

FileDescription
pkg/github/tools.goRegisters the new SetPRStatus tool in the toolset.
pkg/github/pullrequests_test.goAdds comprehensive tests for both state transition paths.
pkg/github/pullrequests.goImplements the GraphQL logic for setting the pull request status.

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.

2 participants
@efouts@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp