Commit graph

101 commits

Author SHA1 Message Date
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ć
b75c4a812d Guard against leaked parameters in issue/pr create tests 2020-05-12 16:54:54 +02:00
Mislav Marohnić
3abc2be0f7 Switch issue create to optimized resolver and update tests 2020-05-12 16:17:06 +02:00
Mislav Marohnić
c682d90466 Add tests for issue/pr create with metadata 2020-05-08 20:32:46 +02:00
Corey Johnson
4ef73a723d Update all calls to RunCommand 2020-05-05 09:20:01 -07:00
Corey Johnson
a9f34069f1 Add "issues disabled" test 2020-04-29 13:58:47 -07:00
Corey Johnson
7df1b992db Add "already open" test 2020-04-29 13:57:53 -07:00
Corey Johnson
49e5ef757f Fix test 2020-04-29 12:29:32 -07:00
Corey Johnson
b0eba939e6 Add test 2020-04-29 12:21:44 -07:00
Corey Johnson
28b35aa333
Merge pull request #843 from cli/when-god-closes-an-issue-he-opens-a-pull-request
Add `gh issue close <urlOrNumber>`
2020-04-29 11:54:48 -07:00
Corey Johnson
c78c30b32f Add already closed test 2020-04-29 11:33:16 -07:00
Corey Johnson
83ec49582b get rid of fixture 2020-04-29 11:31:40 -07:00
Corey Johnson
1b37681a6f Fix test 2020-04-28 12:57:24 -07:00
Corey Johnson
69b58b95a3 Fix linter errors 2020-04-28 12:25:25 -07:00
Corey Johnson
99940fa062 Update test 2020-04-28 12:15:37 -07:00
Corey Johnson
bf94a31619 not on issues disabled
Co-Authored-By: Nate Smith <vilmibm@neongrid.space>
2020-04-28 10:05:56 -07:00
Corey Johnson
7ba6615919 Close test now works
Co-Authored-By: Nate Smith <vilmibm@neongrid.space>
2020-04-28 09:51:28 -07:00
Corey Johnson
e5fc3e9bbd Update issue_test.go
Add test for closing issue

Co-Authored-By: Nate Smith <vilmibm@neongrid.space>
2020-04-28 09:11:19 -07:00
rista404
a2a6036c65
Add tests 2020-04-25 23:12:51 +02:00
vilmibm
a325db3051 new config infrastructure
- adds config get and config set commands
- supports arbitrary k/v strings set at top and host level
- supports writing an updated config, preserving comments
- supports mostly lazy evaluation of yaml
2020-04-17 15:17:44 -05:00
Toshiya Doi
9169c8d0eb Update unit tests for issue metadata 2020-04-08 14:48:08 +09:00
Toshiya Doi
5a17962188 Add a new line to test a dynamic string of metadata 2020-04-04 12:53:22 +09:00
Toshiya Doi
8c697a0d99 Test issue metadata in CLI preview 2020-04-04 11:28:52 +09:00
Mislav Marohnić
e10ccefaf5
Merge pull request #667 from doi-t/view-the-current-state
Show the state (open, closed, merged) in issue view and pr view
2020-04-03 19:41:29 +02:00
Mislav Marohnić
734497a8d8
Code fixes informed by golangci-lint failures (#738) 2020-04-03 16:33:34 +02:00
Toshiya Doi
7eabbf5881 Simplify expected output definitions with new line testing helper 2020-04-03 00:35:48 +09:00
Toshiya Doi
0095fe9a13 Merge branch 'master' into view-the-current-state 2020-04-02 23:52:41 +09:00
vilmibm
f4b8851011 Merge remote-tracking branch 'origin/master' into pr-status-no-commits 2020-03-25 12:00:58 -05:00
Nate Smith
e4b8ae0ec4
Merge pull request #665 from cli/preview-default
switch {pr,issue} view default
2020-03-25 11:32:46 -05:00
vilmibm
5187ad4431 move preparecmd and Runnable to its own package 2020-03-23 16:32:29 -05:00
vilmibm
ff96f48479 add ExpectLines helper 2020-03-20 16:26:49 -05:00
Toshiya Doi
0ba0a0757d Merge branch 'master' into view-the-current-state 2020-03-20 18:16:47 +09:00
Toshiya Doi
1a5e9f1b61 Apply table driven testing for pr/issue preview commands 2020-03-20 16:32:52 +09:00
Nate Smith
51eb2cb345
Merge branch 'master' into pr-count 2020-03-18 09:26:05 -07:00
Mislav Marohnić
cb06812d19
Merge pull request #532 from mingrammer/consistent-printing
fix: inconsistent format between issue list and status
2020-03-18 11:59:17 +01:00
Toshiya Doi
a5bd3130c4 Cleanup 2020-03-18 10:03:04 +09:00
Toshiya Doi
7ceffd0827 Merge branch 'master' into view-the-current-state 2020-03-18 08:51:04 +09:00
Toshiya Doi
0cfa4be86a Add tests for utilities of PR/issue state format 2020-03-18 07:30:28 +09:00
vilmibm
00de6b9c09 switch defaults for issue view 2020-03-17 17:06:42 -05:00
Toshiya Doi
e85259d84f Remove labels from the issue preview header
See https://github.com/cli/cli/issues/652#issuecomment-598940740
2020-03-18 04:42:50 +09:00
Toshiya Doi
9a6026e9fc Format PR/Issue states with color 2020-03-16 04:32:41 +09:00
Toshiya Doi
c8a72c3bcb Add a test for viewing an issue without labels in CLI 2020-03-16 04:26:32 +09:00
Toshiya Doi
8cd6932f9e Add a test for the closed issue preview 2020-03-16 04:12:26 +09:00
Toshiya Doi
0475cf0112 Extract test fixtures for 'issue view --preview' 2020-03-16 03:21:03 +09:00
Toshiya Doi
e0bfd67c69 Fix tests for preview messages with a issue/PR state 2020-03-16 03:13:05 +09:00
UmairShahzad
f51669e228 Merge remote-tracking branch 'origin/master' into pr-count 2020-03-14 19:02:51 +05:00
vilmibm
ed8aaa83e3 add CmdStubber 2020-03-13 15:12:09 -05:00
Eddú Meléndez
8e7ba907b1 Add filter issues by author 2020-03-09 18:50:23 -06:00
Mislav Marohnić
9cd53b8f19 Simplify listHeader tests 2020-03-05 13:32:01 +01:00
UmairShahzad
77a6caa84d test for all possible titles 2020-03-04 01:47:30 +05:00