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

convert issue to pull request #2614

Closed
graingert opened this issue Dec 10, 2019 · 8 comments
Closed

convert issue to pull request #2614

graingert opened this issue Dec 10, 2019 · 8 comments

Comments

@graingert
Copy link

graingert commented Dec 10, 2019

by creating a PR with the API using {"issue": <issuenumber>} you can convert that issue into a PR

Here's an example of this undocumented API feature in use by Hub:

https://github.com/github/hub/blob/7b02a665ddacd885ad017a7c6904e662c8417bf8/commands/pull_request.go#L53-L59
https://github.com/github/hub/blob/7b02a665ddacd885ad017a7c6904e662c8417bf8/commands/pull_request.go#L350-L353

Example URL:

@graingert
Copy link
Author

Here's some discussion around that API mislav/hub@2a748a0

@fregante
Copy link
Member

Interesting, thanks for the links. However I can't find a way to do this outside hub; we can't use a command line tool.

@graingert
Copy link
Author

@fregante that's odd, hub is just using the v3 API which is available to refined-github

@fregante
Copy link
Member

No reference to it in its pages though

https://developer.github.com/v3/issues/
https://developer.github.com/v3/pulls/

@graingert
Copy link
Author

I think it's undocumented

@graingert
Copy link
Author

graingert commented Dec 10, 2019

Although it seems it was documented and marked deprecated, then the deprecation removed: mislav/hub#2038 (comment)

@graingert
Copy link
Author

Here's some more discussion about the API being un-deprecated mislav/hub#1927

@fregante
Copy link
Member

Honestly it's not a workflow I'd like to highlight on the web. It may sound good on private projects but sometimes an issue ends up with many PRs. The current "PR fixes Issue" standard is preferable on most projects.

If you need this feature, I'd suggest creating a separate extension so only those who need it have it.

From what I understand, you call the "update issue" API¹ and provide all the parameters you'd send to the "create PR" API ²

¹ https://github.com/github/hub/blob/7b02a665ddacd885ad017a7c6904e662c8417bf8/github/client.go#L778
² https://github.com/github/hub/blob/7b02a665ddacd885ad017a7c6904e662c8417bf8/commands/pull_request.go#L335-L353

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

No branches or pull requests

2 participants