Commit graph

352 commits

Author SHA1 Message Date
Mislav Marohnić
ad0bbde351 Merge remote-tracking branch 'origin' into release-cmd 2020-09-09 15:27:49 +02:00
Nate Smith
74614b13da
Merge pull request #1627 from giacomoalbe/add-commit-headline-to-pr-merge
Add PR Title to CommitHeadline during merge PR
2020-09-08 17:05:26 -05:00
Mislav Marohnić
d77a8c2e61 Scope pr merge commit headline to only squash method 2020-09-07 22:27:27 +02:00
Giacomo Alberini
cab0e0f43d Add pr Title and number to commitHeadline in merge request 2020-09-04 23:07:51 +02:00
vilmibm
eb132a1ae6 Merge remote-tracking branch 'origin/trunk' into checks 2020-09-03 14:48:32 -05:00
vilmibm
2961c655fb review feedback 2020-09-02 11:33:39 -05:00
Mislav Marohnić
6933c381bf Restore Go 1.13 compatibility 2020-09-01 19:12:02 +02:00
Nate Smith
734959c39d
Merge pull request #1603 from cli/create-pr-metadata-failure
Be transparent about which part of `pr create` flow failed
2020-09-01 10:51:55 -05:00
Mislav Marohnić
766e4950d9 Be transparent about which part of pr create flow failed
When applying metadata to the new PR such as assignees or reviewers, if
the operation fails, an error message would get printed:

    failed to create pull request: <API error text>

This was misleading, because the PR did get created; it's just that
updating it failed. The new error message is:

    https://github.com/OWNER/REPO/pull/123
    pull request update failed: <API error text>

The PR URL is printed on stdout and the error message is printed on
stderr. In case of any errors, the exit code is still non-zero.
2020-08-31 16:46:22 +02:00
vilmibm
8dd93e1748 gh pr checks
A basic first pass on gh pr checks that shows all check runs for a given
PR's latest commit.
2020-08-28 13:18:59 -05:00
Mislav Marohnić
9a4a5d86cb Merge remote-tracking branch 'origin' into release-cmd 2020-08-28 17:47:53 +02:00
Mislav Marohnić
d43d5e0bc9 Add release delete 2020-08-28 17:41:00 +02:00
Colin Shum
58f62a4a15 [Feature] Create repository from template
Co-authored-by: Mislav Marohnić <mislav@github.com>
2020-08-27 14:46:16 -04:00
Mislav Marohnić
cf46ae2db7 Log larger response bodies with DEBUG=api 2020-08-21 18:00:52 +02:00
Mislav Marohnić
33fd6b1149 Change API authentication to allow asset downloads
We install an HTTP middleware that adds the "Authorization" header on
every HTTP request. However, our asset download process might redirect
to a 3rd-party host (Amazon S3) and we want to allow those requests but
not require that they are authenticated.

Furthermore, we need the ability to specify the `Accept` request header
without it being overwritten by middleware, so now middleware only adds
headers that are not present in a request.
2020-08-21 18:00:52 +02:00
Mislav Marohnić
a00d927970 Add release download, upload files on create, upload retrying 2020-08-21 18:00:52 +02:00
vilmibm
2753f6fa48 Merge remote-tracking branch 'origin/trunk' into fix-milestone 2020-08-19 12:31:32 -05:00
Mislav Marohnić
c4f5d6db58 Preliminary gh release commands 2020-08-19 18:25:02 +02:00
Roy Ling
006426331c Fix gh pr diff with hostname override
Removed hardcoded url prefix in PR diff
2020-08-15 22:03:42 +08:00
vilmibm
6c64cb8d23 remove vestigial return from HasMinimumScopes 2020-08-11 16:33:13 -05:00
vilmibm
ec25b735ab gh auth status 2020-08-11 15:58:00 -05:00
Mislav Marohnić
e12c35cc17 Add ability to pass milestone by number 2020-08-11 19:27:26 +02:00
Mislav Marohnić
20ffa49d69 Merge remote-tracking branch 'origin' into fix-milestone 2020-08-11 19:01:58 +02:00
vilmibm
35f18b6c02 gh auth login 2020-08-06 12:43:35 -05:00
Francisco Miamoto
bbce1ba755 add check for milestone not found 2020-08-05 20:49:01 -03:00
Mislav Marohnić
a73584db72 Merge remote-tracking branch 'origin' into pr-commands-isolate 2020-08-04 15:01:30 +02:00
Francisco Miamoto
3caa7cc537 improve comments 2020-08-01 23:54:22 -03:00
Francisco Miamoto
9a5e69a8a4 use graphql for repo milestones on issue list
Since we can obtain the necessary ID for the query on
node ID from the GraphQL API, it makes sense to remove
the REST version.
2020-08-01 23:43:36 -03:00
Francisco Miamoto
75e8cb8f9c register mocks for the new request 2020-07-30 22:15:15 -03:00
Francisco Miamoto
3ce1de62a2 fix searching issues by the milestone name
This fix involves using the REST API since the GraphQL one doesn't
seem to return the necessary ID for the subsequent issues query.
2020-07-30 22:11:19 -03:00
Mislav Marohnić
487dd06bf3 Isolate pr checkout command 2020-07-29 22:50:34 +02:00
Mislav Marohnić
af68a749f0 Isolate pr diff command 2020-07-29 22:49:50 +02:00
Mislav Marohnić
c0b116b511 Merge remote-tracking branch 'origin' into ghe-api 2020-07-28 18:12:47 +02:00
Kumar Saurabh
78124a9716
API improvement : Drain response Body inside func HasScopes (#1428)
Ensure the response body is fully read and closed to reuse the same TCPconnection.

Co-authored-by: Kumar Saurabh <kumarsaurabh@Kumars-MacBook-Air.local>
2020-07-28 14:56:17 +02:00
Mislav Marohnić
dd0d236629 Merge remote-tracking branch 'origin' into ghe-api 2020-07-27 20:13:54 +02:00
Mislav Marohnić
c1c836a657 Remove hardcoded "github.com" 2020-07-27 16:31:05 +02:00
Mislav Marohnić
0cbcf8a7fa Merge remote-tracking branch 'origin' into ghe-api 2020-07-27 16:30:20 +02:00
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
Mislav Marohnić
288d01318b Respect the hostname of current repository in queries 2020-07-23 22:31:08 +02: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