Skip to content
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

pulls.update: Change pull-request draft status #69

Closed
peaceiris opened this issue Jun 18, 2021 · 4 comments
Closed

pulls.update: Change pull-request draft status #69

peaceiris opened this issue Jun 18, 2021 · 4 comments
Labels
Status: Blocked Some technical or requirement is blocking the issue Type: Feature New feature or request

Comments

@peaceiris
Copy link

peaceiris commented Jun 18, 2021

What’s missing?

The pulls.create has the draft parameter in v5.3.1, but the pulls.update does not have that.

Why?

We want to change the draft status using octokit.

Related issue: peaceiris/actions-label-commenter#436

Alternatives you tried

First, I apologize to maintainers. I understand that this repository is not good for this type of request. The GitHub REST API v3 will need to implement this capability before the octokit client.

@gr2m
Copy link
Contributor

gr2m commented Jun 18, 2021

Did you try if setting draft with pulls.update works? Maybe it's just not documented. I'd try to do it using curl.

If it doesn't work, the best place to bring it up is https://github.com/github/rest-api-description/. That's GitHub's official OpenAPI spec, and all the methods you see in @octokit/rest are generated from it.

@gr2m gr2m added the Status: Blocked Some technical or requirement is blocking the issue label Jun 18, 2021
@gr2m gr2m added Status: Needs info Full requirements are not yet known, so implementation should not be started and removed Status: Blocked Some technical or requirement is blocking the issue labels Jun 27, 2021
@peaceiris
Copy link
Author

peaceiris commented Jul 11, 2021

I have tried it in peaceiris/actions-label-commenter#454, pulls.update seems not to have the ability to toggle pull-request draft state. Should I open another issue to report this at github/rest-api-description?

@gr2m gr2m added Status: Blocked Some technical or requirement is blocking the issue and removed Status: Needs info Full requirements are not yet known, so implementation should not be started labels Jul 13, 2021
@gr2m
Copy link
Contributor

gr2m commented Jul 13, 2021

I think in this case it's best to contact support at https://support.github.com/contact. It sounds like the feature is simply not yet implemented. You can also search if there is an open discussion on https://github.51.almunity/c/github-ecosystem/37 or create one there, it's more likely to be notified once the feature is implemented that way.

I'll close the issue for now as there is nothing actionable we can do on our side at this point

@gr2m gr2m closed this as completed Jul 13, 2021
@gr2m gr2m added Status: Blocked Some technical or requirement is blocking the issue and removed Status: Blocked Some technical or requirement is blocking the issue labels Jul 13, 2021
peaceiris added a commit to peaceiris/actions-label-commenter that referenced this issue Aug 11, 2021
Close #436

## Overview

My proposal about a REST API to toggle pull-request draft status ([pulls.update: Change pull-request draft status · Issue #69 · octokit/rest.js](octokit/rest.js#69)) has been rejected since the GitHub API v4 (GraphQL API) has the ability to do that.

Unfortunately, an auto-generated access token called `GITHUB_TOKEN` seems not to have full control permission of the GraphQL API. We got the error `Resource not accessible by integration` with the GitHub API v4 and `GITHUB_TOKEN`. This problem may be related to the following thread.

- [API v4 - Unable to Retrieve Email - Resource not accessible by integration - GitHub Ecosystem - GitHub Support Community](https://github.51.almunity/t/api-v4-unable-to-retrieve-email-resource-not-accessible-by-integration/13831/3)

This pull-request uses a personal access token with a `public_repo` scope (for a public repository) as a workaround.

## References

- [convertPullRequestToDraft - Mutations - GitHub Docs](https://docs.github.com/en/graphql/reference/mutations#convertpullrequesttodraft)
- [markPullRequestReadyForReview - Mutations - GitHub Docs](https://docs.github.com/en/graphql/reference/mutations#markpullrequestreadyforreview)
- https://github.com/actions/toolkit/blob/%40actions/tool-cache%401.1.1/packages/github/README.md?plain=1#L32
	- [octokit/graphql.js: GitHub GraphQL API client for browsers and Node](https://github.com/octokit/graphql.js)
	- [octokit/graphql-schema: GitHub’s GraphQL Schema with validation. Automatically updated.](https://github.com/octokit/graphql-schema)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Blocked Some technical or requirement is blocking the issue Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants