Commit graph

357 commits

Author SHA1 Message Date
Mislav Marohnić
ff925fb480 Resolve @me to current username on GHE
It looks like GHE v2.20 does not support `@me` in search yet.
2020-09-30 19:05:06 +02:00
Mislav Marohnić
bed9d11f7a Avoid querying statusCheckRollup or reviewDecision on unsupported GHE
We first ask the GHE server for whether it supports these fields.
2020-09-30 19:04:09 +02:00
Mislav Marohnić
7a8db80420 Prompt for push target during pr create
We no longer guess the head repository using heuristics; instead, we
present the user with the choice of pushable repositories and an
additional option to create a new fork.

The new `pr create --head` flag is available for the user to specify the
head branch in `branch` or `owner:branch` format and completely skip any
forking or auto-pushing checks.
2020-09-16 14:49:36 +02:00
Mislav Marohnić
f30bc5bc64
Merge pull request #1552 from cli/release-cmd
Add commands for managing GitHub Releases
2020-09-09 18:07:19 +02:00
vilmibm
0c16a6b0b5 fix butchered query 2020-09-09 09:50:10 -05:00
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