Commit graph

818 commits

Author SHA1 Message Date
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
vilmibm
3a7f56456e tweak reauth code and request a new scope 2020-05-13 14:24:29 -05:00
vilmibm
ed1a3a60fd Merge remote-tracking branch 'origin/master' into wingkwong/master 2020-05-13 13:43:09 -05:00
Mislav Marohnić
57e60ab8a1 Merge remote-tracking branch 'origin/master' into issue-metadata-resolve-ids 2020-05-13 17:20:37 +02:00
Mislav Marohnić
c225d379a9 Preserve CODEOWNERS reviewers in pr create
When reviewers were requested on a PR, they would apparently
overwrite the current set of reviewers. A fresh PR will already have
reviewers if it was assigned some by CODEOWNERS rules.

The fix is to only ever add additional reviewers and not overwrite the
entire set.
2020-05-13 12:09:59 +02:00
Corey Johnson
ad3a5903b2
Merge pull request #873 from cli/the-merge-dubai
Add support for `gh pr merge`
2020-05-12 10:18:54 -07:00
Corey Johnson
9187efdc92 Merge remote-tracking branch 'origin/master' into merge-interactive-merge 2020-05-12 08:53:09 -07:00
Mislav Marohnić
386a53c34a Fix metadata resolver query 2020-05-12 16:48:30 +02:00
Mislav Marohnić
3abc2be0f7 Switch issue create to optimized resolver and update tests 2020-05-12 16:17:06 +02:00
Mislav Marohnić
6d57f2a91e Faster resolve GraphQL node IDs for assignees, reviewers, and labels 2020-05-12 15:33:51 +02:00
Nate Smith
c7f7bfc328
Merge pull request #787 from cli/issue-pr-create-metadata
Add flags to add additional metadata to `issue/pr create`
2020-05-08 15:04:15 -05:00
Nate Smith
5ba3baa3c8
Merge pull request #762 from doi-t/reviewers-in-pr-view
Add Reviewers to pr view in CLI
2020-05-08 14:46:08 -05:00
Nate Smith
77ed118022
Merge pull request #880 from cli/pr-status-crash
Fix `pr status -R` crash with closed PR on the default branch
2020-05-08 14:23:51 -05:00
Corey Johnson
43e15130f1 Use a var 2020-05-08 11:37:45 -07:00
Mislav Marohnić
1128439cd1 issue/pr create: hide "Add metadata" if viewer does not have triage permission 2020-05-08 18:37:08 +02:00
Mislav Marohnić
d7e6d21766 Order projects, teams, and labels by name 2020-05-08 18:22:14 +02:00
Mislav Marohnić
d0f168f4c3 Merge remote-tracking branch 'origin/master' into issue-pr-create-metadata 2020-05-08 17:46:17 +02:00
Mislav Marohnić
3000847bb2
Merge pull request #874 from cli/httpmock
Parallelism-safe mechanism for stubbing HTTP responses
2020-05-08 17:34:57 +02:00
vilmibm
c40f064baa sigh 2020-05-07 14:58:00 -05:00
Mislav Marohnić
93c61a83b2 Fix pr status -R crash with closed PR on the default branch
At the time we have a reference to `baseRepo`, we might still not have
contacted the API nor obtained any information about the default branch
for the repository. This expands the `PullRequests()` query to always
report the default branch so we may choose how to render entries that
belong on the current branch.
2020-05-07 20:53:03 +02:00
vilmibm
d81e622700 lightest weight reviewing
this commit add very basic non-interactive PR reviewing. You can either
review the "current" or a passed PR (number or URL) as approved, changes
requested, or commented via CLI flags.
2020-05-07 13:30:34 -05:00
Corey Johnson
5810acf6ac Use correct struct 2020-05-07 10:29:56 -07:00
Mislav Marohnić
0a4d4ee007 Replace FakeHTTP with httpmock which is now compatible 2020-05-07 15:19:14 +02:00
Mislav Marohnić
256d31950a Migrate a single test over to httpmock to demonstrate its use 2020-05-06 22:06:37 +02:00
Corey Johnson
8c85e14bac Make it work without a PR number 2020-05-06 11:19:00 -07:00
Corey Johnson
8681e7a7b6 Make squash and rebase work 2020-05-05 15:09:02 -07:00
Corey Johnson
c0831d4c4f Add merge api call 2020-05-05 11:56:45 -07:00
Nate Smith
1a1fc64fe4
Merge pull request #842 from foad/df-805-hide-closed-default
Hide closed/merged PRs from default branch
2020-05-04 20:17:53 -05:00
Corey Johnson
5cc60c669e Take in a pointer 2020-05-04 10:19:54 -07:00
Mislav Marohnić
b59407dd7d Merge remote-tracking branch 'origin/master' into issue-pr-create-metadata 2020-05-04 17:09:41 +02:00