Commit graph

314 commits

Author SHA1 Message Date
vilmibm
551c3661cb linter appeasement 2020-07-24 12:29:06 -05:00
vilmibm
c34054bdc8 isolate repo create command 2020-07-24 12:26:27 -05:00
vilmibm
895af993a5 static not found error 2020-07-23 11:12:33 -05:00
vilmibm
a27c8a9c21 isolate repo view cmd 2020-07-22 15:54:11 -05:00
Mislav Marohnić
97350e87a1 Merge remote-tracking branch 'origin' into migrate-gist 2020-07-22 16:17:30 +02:00
Mislav Marohnić
e373195817 WIP migrate gist create to separate package 2020-07-21 18:13:16 +02:00
Mislav Marohnić
86eacc3789 Enable unwrapping api.NotFoundError 2020-07-21 13:59:05 +02:00
Mislav Marohnić
71b13a81d0 Correctly report HTTP and Markdown errors in repo view
Any errors from fetching and rendering the README were silenced and
ignored in `repo view`. This change:

- Tolerates HTTP 404, but will raise exceptions for any other error;
- Moves markdown rendering from `api` package to command implementation;
- Ensures markdown rendering errors are correctly reported.
2020-07-21 13:47:27 +02:00
Mislav Marohnić
2086ecb3d1 Fix printing network error in case for failed HTTP requests
The CheckScopes middleware tried to read from `res.Headers` before it
verified that `res` is available.
2020-07-17 18:24:13 +02:00
Mislav Marohnić
305cd290ee Fix pr checkout <owner>:<branch> when it matches the default branch
First, consolidate the functionality between `pr merge` and `pr
checkout` that resolves the default branch name of the base repo. With
an added bonus, the new approach avoids an API request when one isn't
necessary.

Then, ensure that checking out 3rd-party PRs will result in local branch
name such as `<owner>/<branch>` when the head branch of the repository
matches the default branch of the base repository. We already have had
code in place to take care of this, but it only took effect in the `pr
checkout <number>`-style invocation.
2020-07-15 15:35:42 +02:00
Mislav Marohnić
c8cf54c10c
Merge pull request #1258 from cli/ghe-remotes
Parse and respect non-github.com git remotes
2020-07-15 13:07:30 +02:00
Mislav Marohnić
28cd348176 Only check OAuth scopes when X-Oauth-Scopes header is present 2020-07-13 15:53:53 +02:00
Mislav Marohnić
55d31303ea Have admin:org scope satisfy read:org requirement
`admin:org` is inclusive of `read:org`, so if we find the former listed
in response headers, we can conclude that the token has necessary scopes
instead of letting a warning notice be shown.
2020-07-13 15:35:14 +02:00
Mislav Marohnić
87a9dc8d4b Merge remote-tracking branch 'origin' into ghe-remotes 2020-07-13 13:39:14 +02:00
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ć
a68cefadd9 Merge remote-tracking branch 'origin' into ghe-remotes 2020-07-02 20:37:33 +02:00
Mislav Marohnić
446a4111f7 Respect hostnames when resolving git remotes and URL args to repos 2020-07-02 20:36:10 +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ć
3ea71e6eb6 Add ability to parse non-GitHub.com git remotes 2020-06-23 19:51:26 +02: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