Commit graph

297 commits

Author SHA1 Message Date
Mislav Marohnić
7a289861d2 Name more queries in test stubs 2020-07-10 20:20:33 +02:00
Mislav Marohnić
13b9c98b2b Match named queries in test stubs 2020-07-10 20:04:54 +02:00
Mislav Marohnić
d96e88c223 Rename IssueCreate mutation
This follows the "NounVerb" convention we got going on
2020-07-10 18:08:16 +02:00
Mislav Marohnić
f4c4ce0b0a Add names to GraphQL queries made over shurcooL adapter 2020-07-07 17:53:40 +02:00
Mislav Marohnić
a7806a3e78 Add names to queries made over our homegrown GraphQL adapter 2020-07-07 17:53:40 +02:00
Mislav Marohnić
ed781103c7
Merge pull request #644 from eddumelendez/add_filters_issues
Add filters issues
2020-07-02 12:24:30 +02:00
Mislav Marohnić
1ca3d171e6 Tweak HTTP 422 handling when deleting branches 2020-06-30 19:21:39 +02:00
Mislav Marohnić
6ac61e90b7 Merge remote-tracking branch 'origin' into add_filters_issues 2020-06-30 14:24:30 +02:00
Pavel Borzenkov
3afec6f90a api: gracefully handle already deleted remote refs
If a GitHub repo is configured to automatically delete branches after PR
is merged, `gh pr merge` fails with error like:

failed to delete remote branch: ... (422): 'Reference does not exist'

Gracefully handle such case and don't report the error.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
2020-06-27 19:10:42 +03:00
Pavel Borzenkov
c66eebc6fb api: return structured error for failed API calls
`fmt.Errorf` hides information and makes it hard to test for specific
conditions in returned error. Return a structured error instead.

Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com>
2020-06-27 18:47:34 +03:00
Mislav Marohnić
e084a4563f Fix pr checkout OWNER:BRANCH when maintainer can modify
We did not use to request the necessary GraphQL fields to determine
whether the PR in question can be modified by maintainers (i.e. pushed
back to).
2020-06-22 19:36:55 +02:00
Eddú Meléndez
cffd56f717 Rename to mention 2020-06-15 16:08:10 -05:00
Eddú Meléndez
a16405650f Define query variables 2020-06-13 20:55:55 -05:00
Eddú Meléndez
9aebb66a3c Add milestone filter 2020-06-13 20:53:41 -05:00
Eddú Meléndez
2943703d4a Add mentioned flag 2020-06-13 20:53:03 -05:00
Mislav Marohnić
b099bb3037 api command: accept full URLs as path input
This is to allow file uploads to `https://uploads.github.com`
2020-06-10 16:26:23 +02:00
Corey Johnson
ee2b38df68
Merge pull request #1020 from cli/pr-lookup-v2
Consistent PR lookup interface
2020-06-04 10:42:55 -07:00
Corey Johnson
4c75c8bccc Reset base branch when URL is used 2020-06-03 14:34:13 -07:00
Mislav Marohnić
1595d3b950 Handle HTTP errors in HasScopes 2020-06-02 13:24:46 +02:00
Mislav Marohnić
d026d6af2d Use githubv4.MarkPullRequestReadyForReviewInput
This is available now that we've bumped githubv4
2020-05-28 15:38:46 +02:00
Corey Johnson
a7e8d6fba8 Make PullRequestDiff take a pr 2020-05-27 10:10:21 -07:00
Corey Johnson
4b03cb112c Update test stubs 2020-05-27 09:21:02 -07:00
Mislav Marohnić
2e93a065b1 Merge remote-tracking branch 'origin/master' into api-command 2020-05-27 12:56:06 +02:00
Mislav Marohnić
ab0e43c6c8 Merge remote-tracking branch 'origin/master' into auth-from-env 2020-05-27 11:44:19 +02:00
Corey Johnson
8d1f2745a4 wip 2020-05-26 16:35:35 -07:00
Corey Johnson
3122696140
Merge pull request #982 from cli/remote-delete
Remote delete
2020-05-26 09:10:12 -07:00
Corey Johnson
be5fc07928
Merge pull request #899 from cli/merge-interactive-merge
Interactive merge
2020-05-26 08:33:47 -07:00
Corey Johnson
909e177a74 remove mergeable from queries that don't need it 2020-05-26 08:20:43 -07:00
Corey Johnson
9c48e2da14 Delete the branch 2020-05-22 15:25:25 -07:00
Corey Johnson
9c88cd67ee Whoops 2020-05-22 15:21:51 -07:00
Corey Johnson
9113092f5c Delete via api 2020-05-22 15:19:39 -07:00
vilmibm
5f28751555 just use a map + stdin test 2020-05-20 17:44:09 -05:00
vilmibm
509be34af6 Merge remote-tracking branch 'origin/master' into wingkwong/master 2020-05-20 17:08:31 -05:00
vilmibm
466edf8d0e take files as args. handle - 2020-05-20 16:27:28 -05:00
Corey Johnson
46a1e3cd53 Remove convertRepoInterfaceToRepository 2020-05-20 11:19:31 -07:00
Corey Johnson
c3c3058b96 Merge remote-tracking branch 'origin/master' into merge-interactive-merge 2020-05-20 08:30:17 -07:00
Mislav Marohnić
767521c055 Stop providing AuthLogin from context
The login name of the authenticated user will be readily available only
if authentication info comes from the config file. With other upcoming
authentication modes (for example, the GITHUB_TOKEN environment
variable), the token is the only piece of information we got, so we
would need to additionally query for the login name.

Since `issue status` and `pr status` are the only commands that need the
name of the authenticated user right now, have those commands explicitly
query for the login name. This results in an additional API query, but
simplifies Context implementation and future authentication approaches.
2020-05-20 17:09:13 +02:00
Mislav Marohnić
90fa193eaf Promote api command to a pkg/cmd/api package 2020-05-20 15:21:31 +02:00
Mislav Marohnić
fa3e25bb4d Serialize GraphQL parameters under variables 2020-05-20 15:21:31 +02:00
Mislav Marohnić
1609afe993 Add api command 2020-05-20 15:21:31 +02:00
Nate Smith
45dec1b3e0
Merge pull request #962 from cli/pr-diff
pr diff
2020-05-19 14:11:36 -05:00
Corey Johnson
6666adbdce Deal with merge conflicts 2020-05-19 11:29:00 -07:00
vilmibm
c98b0924dc properly handle REST errors 2020-05-19 11:58:49 -05:00
vilmibm
aaebdfc46f working with gross colorize hack + no pager 2020-05-18 16:49:51 -05:00
Corey Johnson
922b6e06e0 Can be marked ready for review 2020-05-18 12:42:16 -07:00
Corey Johnson
fad9f24f39 Make reopen work 2020-05-18 11:11:13 -07:00
Kevin Bluer
d440a95aed
Improved error message when "owner/repo" format not provided (#919)
Fixes #882
2020-05-18 11:13:48 +02:00
vilmibm
96ba1eacef undo initial thing 2020-05-15 16:44:51 -05:00
vilmibm
7decae71fc untested first pass on ensureScopes 2020-05-15 16:40:13 -05:00
vilmibm
cc1ffb0aea pass apiClient to determineBaseRepo
Our code had an unspoken assumption that only one apiClient is created
during the course of a command. Violating this assumption is fine in
almost all cases, but not when we need to do a re-auth to add a new
oauth scope to a user's token.

There is likely a more elegant solution to the problem but until then
this changes determineBaseRepo to use an existing apiClient.
2020-05-13 14:55:49 -05:00