From 2a748a048d6903eca78332a484e63f8d647caf02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 28 Dec 2018 07:52:45 +0100 Subject: [PATCH] Un-deprecate converting issues to pull requests 5 years ago, in anticipation of an API change, I have made the call to deprecate issue-to-PR conversion in hub. 4f70dd126f46dec14fc341c97c18efae417743c7 Issue-to-PR conversion was wonky at those times, poorly understood, and was generating a lot of support requests to hub's issue tracker that I didn't want to deal with. In most cases, people tried to convert issues that they have no rights over and they would get a cryptic validation error in the API response. Since then, there was a consistent plea from the hub community to keep this feature as some teams seem to rely on this for their workflows. I have consulted with other GitHub employees about the stableness of this feature, and anecdotal evidence suggests that lately there haven't been as many problems around this as there have been in the past. Also, the GitHub API v3 will not be getting breaking changes, so it sounds like this feature is here to stay. Fixes #1927 Ref. #532, #410, #1806, #1770, #1628 --- commands/pull_request.go | 13 ++++++------- features/pull_request.feature | 6 ++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/commands/pull_request.go b/commands/pull_request.go index e1e53b4a..a44ba041 100644 --- a/commands/pull_request.go +++ b/commands/pull_request.go @@ -10,7 +10,6 @@ import ( "github.com/github/hub/git" "github.com/github/hub/github" - "github.com/github/hub/ui" "github.com/github/hub/utils" ) @@ -47,8 +46,12 @@ pull-request -i Further edit the contents of in a text editor before submitting. -i, --issue= - (Deprecated) Convert an issue to a pull request. may be an issue - number or a URL. + Convert an issue to a pull request. may be an issue number or a URL. + + You can only convert issues that you've opened or that which you have admin + rights over. In most workflows it isn't necessary to convert issues to pull + requests; you can simply reference the original issue in the body of the new + pull request. -o, --browse Open the new pull request in a web browser. @@ -443,10 +446,6 @@ of text is the title and the rest is the description.`, fullBase, fullHead)) } } - if flagPullRequestIssue != "" { - ui.Errorln("Warning: Issue to pull request conversion is deprecated and might not work in the future.") - } - args.NoForward() printBrowseOrCopy(args, pullRequestURL, flagPullRequestBrowse, flagPullRequestCopy) } diff --git a/features/pull_request.feature b/features/pull_request.feature index f7734978..f5bbe219 100644 --- a/features/pull_request.feature +++ b/features/pull_request.feature @@ -669,8 +669,7 @@ Feature: hub pull-request When I successfully run `hub pull-request -i 92` Then the output should contain exactly: """ - https://github.com/mislav/coral/pull/92 - Warning: Issue to pull request conversion is deprecated and might not work in the future.\n + https://github.com/mislav/coral/pull/92\n """ Scenario: Convert issue URL to pull request @@ -686,8 +685,7 @@ Feature: hub pull-request When I successfully run `hub pull-request https://github.com/mislav/coral/issues/92` Then the output should contain exactly: """ - https://github.com/mislav/coral/pull/92 - Warning: Issue to pull request conversion is deprecated and might not work in the future.\n + https://github.com/mislav/coral/pull/92\n """ Scenario: Enterprise host