Skip to content

Use REST endpoints for PR draft state transitions - #2816

Open
aalmanasir wants to merge 10 commits into
github:mainfrom
aalmanasir:aalmanasir-fix-draft-pr-conversion
Open

Use REST endpoints for PR draft state transitions#2816
aalmanasir wants to merge 10 commits into
github:mainfrom
aalmanasir:aalmanasir-fix-draft-pr-conversion

Conversation

@aalmanasir

@aalmanasir aalmanasir commented Jul 5, 2026

Copy link
Copy Markdown

Summary

  • replace GraphQL draft-state mutations with REST draft-state transitions in update_pull_request
  • reuse the same REST draft-state helper in update_pull_request_draft_state
  • add tests for no-op behavior and REST 403/404 error handling in both general and granular paths

Notes

  • this branch removes convertPullRequestToDraft and markPullRequestReadyForReview usage from the two affected code paths
  • still needs authenticated runtime smoke test for app-token behavior

Abdulla Ahmed Al Mansoori and others added 4 commits July 5, 2026 10:20
Replace GraphQL draft-state mutations with REST calls in both update paths and add coverage for no-op and 403/404 handling in general and granular tools.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Replaces GraphQL pull-request draft transitions with a shared REST implementation.

Changes:

  • Adds REST draft-state lookup, no-op handling, and transitions.
  • Reuses the helper in general and granular tools.
  • Expands REST success and error tests.

Reviewed changes

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

Show a summary per file
File Description
pkg/github/pullrequests.go Adds and integrates the REST helper.
pkg/github/pullrequests_granular.go Reuses the REST helper.
pkg/github/pullrequests_test.go Updates general-path tests.
pkg/github/granular_tools_test.go Updates granular-path tests.
pkg/github/helper_test.go Adds REST route test helpers.
pkg/github/projects_resolver_test.go Removes trailing whitespace.

Comment thread pkg/github/pullrequests_test.go
Comment thread pkg/github/granular_tools_test.go
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.

3 participants