Commit graph

54 commits

Author SHA1 Message Date
jack1142
6a74eb1262
Merge branch 'trunk' into patch-1 2021-06-02 11:10:25 +02:00
jack1142
184149b844
Add missing new line 2021-06-01 23:53:58 +02:00
jack1142
3943a8bb1f
Update PR tty view formatting and its tests 2021-05-29 04:44:34 +02:00
Mislav Marohnić
1a980e768c Fix how teams are displayed in requested reviewers
1. The `--json` export now only renders the `login` field for User types
   and `name` and `slug` fields for Team types.
2. The `pr view` command now renders team reviewers in the format of
   `ORG/SLUG` instead of the team name. This is so that the same value
    can be used in the `pr create -r` flag.
2021-05-28 14:32:31 +02:00
Mislav Marohnić
42155c7d2d Export more IDs in issue/pr JSON payload 2021-05-18 18:19:28 +02:00
Mislav Marohnić
e758f30073 Fix preloading of pr reviews, checks, and issue/pr comments 2021-05-18 17:13:27 +02:00
Mislav Marohnić
bc3bb97c43 Merge remote-tracking branch 'origin' into pr-lookup-refactor 2021-05-17 17:41:38 +02:00
Mislav Marohnić
5f0301c990 Have Exporter.Write automatically call ExportData on given data structure 2021-05-12 17:05:15 +02:00
Mislav Marohnić
c50d390cf5 Fix tests 2021-05-07 22:09:58 +02:00
Mislav Marohnić
9bdc63c4ca Eliminate API overfetching in pr commands
This completely rewrites the PR lookup mechanism so that the caller
must specify the GraphQL fields to query for each PR. Additionally, this
fixes some export problems with `pr view --json`.

Features:

- Each pr command now gets assigned a concept of a Finder. This makes it
  easier to stub the PR in tests without having to stub the underlying
  HTTP calls or git invocations.

- `pr view --web` is much faster since it only fetches the "url" field.

- `pr diff 123` now skips a whole API call where a whole PR was
  unnecessarily preloaded just to access its diff in a subsequent call.

- PullRequestGraphQL query builder is now used to construct queries.

- A bunch of individual commands are now freed of having to know about
  concepts such as BaseRepo, Branch, Config, or Remotes.
2021-04-30 20:34:36 +02:00
Mislav Marohnić
516ea8691e Fix whitespace formatting of issue/pr view help text 2021-04-14 20:04:47 +02:00
Mislav Marohnić
56cdbb643f Fix pr view tests broken by createdAtsubmittedAt switch 2021-04-14 19:41:55 +02:00
Mislav Marohnić
3ad41e3e65 Change JSON Exporter to an interface 2021-04-14 18:15:52 +02:00
Mislav Marohnić
abe452bb19 Add --json export flag for issues and pull requests
The `--json` flag accepts a list of GraphQL fields to query for and
output in JSON format. To get the list of available flags, run the
command with a blank value for `--json`. Additional `--jq` and
`--template` flags are available just like in `gh api`.
2021-04-13 20:29:31 +02:00
Mislav Marohnić
111e8dbcf2 Pass web browser to each individual command
This removes sensitivity to the BROWSER environment variable in tests
and makes it easier to verify the URL that the browser was invoked with
without having to stub sub-processes.
2021-03-19 21:22:37 +01:00
Nate Smith
2ab073d599
Refactor use of glamour to allow style overrides (#3243)
* Refactor use of glamour to allow style overrides

* leave the things the way they were and just expose the ability to set overrides
2021-03-19 16:29:32 +00:00
Gowtham Munukutla
1d8dd2f1e9 add tests for additions and deletions 2021-03-06 15:02:16 +05:30
Gowtham Munukutla
f2489ed22f reduce arg length to fprintf 2021-03-05 14:05:41 +05:30
Gowtham Munukutla
bdd663e658 Add additions and deletions in pr view raw as well 2021-03-05 13:41:25 +05:30
Gowtham Munukutla
9944698665 Add additions and deletions in pr view 2021-03-05 11:20:49 +05:30
Mislav Marohnić
051fbbc1e1 Merge remote-tracking branch 'origin' into dpromanko/remove-set-cmd-prepare 2021-01-28 22:00:08 +01:00
Devon Romanko
2964895a77 fix test behavior changes from migration to run.Stub 2021-01-27 18:46:29 -05:00
Sam Coe
52bdcad8ea
Do not display minimized comments 2021-01-27 08:14:46 -08:00
Devon Romanko
45bc1d787c use Stub instead of SetPrepareCmd in 'pr view' tests 2021-01-27 07:23:49 -05:00
Sam Coe
3f172ad991
Add contional and tests 2021-01-25 13:27:32 -08:00
Mislav Marohnić
06cf2c9f81 Merge remote-tracking branch 'origin' into cmd-stub-new 2021-01-22 16:31:29 +01:00
Mislav Marohnić
4158209d50
Merge pull request #2811 from cli/utils-spinner-buh-bye
Retire utils.Spinner in favor of IOStreams.StartProgressIndicator
2021-01-21 17:34:39 +01:00
Sam Coe
b9b1079493
Display reviews when viewing pull requests 2021-01-20 12:15:25 -08:00
Mislav Marohnić
a2bee1fad3 🔥 utils.Spinner 2021-01-20 14:48:14 +01:00
Mislav Marohnić
fc77cbc964 Deprecate test.ExpectLines
For asserting command output, exact string matches are preferred in most cases. In cases when a pattern match is needed, the test can use regexp ad hoc.
2021-01-18 23:25:45 +01:00
Mislav Marohnić
c308f1cd91 Prevent further use of SetPrepareCmd and InitCmdStubber 2021-01-18 22:44:53 +01:00
Cristian Dominguez
ce151420f3 Migrate legacy tests 2021-01-11 21:07:19 -03:00
Camelid
8ff4cc40e6 view: Add missing newline
Add a newline at the end of the 'View this {issue, pull request} on
GitHub' message. `gh repo view` already had a newline at the end, so
this only changes `issue view` and `pr view`.
2020-12-27 11:37:59 -08:00
Sam Coe
dee7077fcf
Extract shared comment and reaction group code 2020-12-09 14:35:29 -05:00
Sam Coe
9f101ff0a2
Add comments to pr view 2020-12-08 14:18:05 -05:00
Josh Soref
ddd438d5e1 spelling: dismissed 2020-11-21 21:43:51 -05:00
Cristian Dominguez
fa8674386b
Render links as absolute URLs in repo view (#2363)
Co-authored-by: Cristian Dominguez <cristiand391@users.noreply.github.com>
2020-11-11 13:13:19 +01:00
vilmibm
47eef416b3 more iostreams passing 2020-11-02 11:47:12 -08:00
vilmibm
a2aa154794 port entirely to ColorScheme 2020-10-29 12:37:45 -07:00
Mislav Marohnić
2ac68cc534 PullRequestForBranch: fix outdated error message
This method doesn't necessarily search through open pull requests.
2020-10-28 15:50:59 +01: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
Sam Coe
f0d4fbf84f
Address PR comments around style and naming 2020-09-24 19:27:29 +02:00
Sam Coe
ed4075517c
Check for terminal background color before starting pager 2020-09-24 13:06:28 +02:00
Mislav Marohnić
b2e7f0c1e2 Merge remote-tracking branch 'origin' into pager-for-everyone 2020-09-14 14:18:42 +02:00
Mislav Marohnić
9040f6adc6 Fix view tests 2020-09-09 17:40:04 +02:00
Mislav Marohnić
fda9659e4a Consistently print browsed URL across commands 2020-09-09 17:02:02 +02:00
Mislav Marohnić
ccfe38de26 Add PAGER support to commands that produce significant output 2020-09-04 23:36:14 +02:00
Mislav Marohnić
c21caf5b2b Disallow pr -R flag for commands that operate on the current branch
If the `--repo` flag is specified, then the user intends to select a
repository other than the current one. In that case, it doesn't make
sense to fall back to detecting the PR belonging to the current branch,
so throw a descriptive error instead.
2020-08-27 16:30:34 +02:00