Commit graph

372 commits

Author SHA1 Message Date
Sam
becb316308
Merge pull request #2177 from jonathanlloyd/use-canonical-capitalization-in-remotes
Clone repos using canonical username/repo name capitalization
2020-10-20 09:23:21 +02:00
Sam
869f5118c6
Merge pull request #2178 from quiye/milestone-int32-validation
Add int32 validation to milestone numbers
2020-10-20 09:17:22 +02:00
Mislav Marohnić
e270cdb29e Simplify test to avoid use of reflect 2020-10-14 15:54:42 +02:00
Mislav Marohnić
813fbc9b8d Ensure that we don't reuse the same deserialization struct over pagination iterations
This is to avoid subtle deserialization issues in nested slices.
2020-10-14 15:38:21 +02:00
zamasu
a90b62fb6c Fix parsing labels in paginated IssueList 2020-10-14 15:32:45 +02:00
Jonathan Lloyd
8f44aee76a Load repo and parent in single query 2020-10-13 20:41:16 +01:00
zamasu
d4e6fc11d7 Add int32 validation to milestone numbers 2020-10-13 08:36:47 +09:00
Pushpamk
581783176a deleted comment 2020-10-08 20:34:10 +05:30
Pushpamk
f8a49ca624 updated reference comment 2020-10-08 16:04:28 +05:30
Pushpamk
40a0b0d511 updated new github doc. link 2020-10-08 00:55:44 +05:30
Mislav Marohnić
7663acdc29 Improve HTTP caching layer
- make thread-safe
- only cache GET, HEAD, and GraphQL requests
- only cache non-5xx, non-403 responses
- include `Accept` and `Authorization` headers in cache key
2020-10-02 15:19:40 +02:00
Mislav Marohnić
f7a82a216b Avoid error from cache file being prematurely closed
I have no idea what's going on there, so I'll just give up the streaming
approach and read the entire contents of the cache file to memory.

https://github.com/cli/cli/pull/2035/checks?check_run_id=1194798056
2020-10-01 22:06:15 +02:00
Mislav Marohnić
1d435a3e2e Ensure that cache file is closed after reading 2020-10-01 19:18:11 +02:00
Mislav Marohnić
93c8fc1e98 Add tests for GraphQL introspection 2020-10-01 16:33:56 +02:00
Mislav Marohnić
0ef2863ede Cache GHE responses for schema queries
This speeds up `pr`-related commands for GHE by caching schema
introspection queries for 24h.
2020-09-30 19:09:15 +02:00
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