Commit graph

18 commits

Author SHA1 Message Date
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
vilmibm
00da7f9fc1 handle 404 for annotations 2021-04-26 16:55:08 -05:00
Mislav Marohnić
ae99ad4fbe
Merge pull request #3461 from cli/jobs-url-enterprise
Fix requesting REST sub-resources on GHE
2021-04-20 11:31:23 +02:00
Mislav Marohnić
ac348b0dec Fix requesting REST sub-resources on GHE
GitHub REST resources typically return full URLs to fetch related
resources at. We used to parse those URLs to find just the path portion
and pass that in to the `REST()` function, which only accepted paths. By
doing so, we are essential de-constructing a URL just to re-assemble it
again. While re-assembling it for Enterprise, though, we would
accidentally inject an extra `api/v3/` prefix where one was not needed.

The solution is just to use raw URLs as reported by the REST API with
no modifications. This extends the `REST()` function to accept full URLs
in addition to just paths to resources.
2021-04-19 12:41:09 +02:00
vilmibm
8458c5f95d use int64 explicitly in Actions support 2021-04-15 13:32:09 -05:00
Sam Coe
3f3c8f2b26
Add time since run to run selection survey options 2021-04-12 16:03:47 -07:00
Sam Coe
8a4a8dd451
Moar memory 2021-04-09 12:13:01 -07:00
Sam Coe
dc63480cf6
Add flag log-failed to display only logs of failed steps 2021-04-08 15:51:08 -07:00
Sam Coe
5566289d1c
workflow view 2021-04-02 09:36:57 -07:00
Nate Smith
216cfb631f
Merge pull request #3333 from cli/run-rerun
gh run rerun
2021-04-02 11:06:15 -05:00
vilmibm
8a60ea3c62 gh run rerun 2021-04-01 19:32:36 -05:00
vilmibm
1ddb33bf3c add GetRunsWithFilter 2021-04-01 19:32:36 -05:00
vilmibm
0d0ec84775 absorb gh job view into gh run view 2021-03-31 16:17:30 -05:00
vilmibm
0ecb04c687 small refactor around prompting for runs 2021-03-30 15:48:42 -05:00
Nate Smith
5a3641540f
Merge pull request #3318 from cli/list-by-workflow
support --workflow in run list
2021-03-29 16:59:37 -07:00
vilmibm
6f898dcbb3 share prForRun 2021-03-29 16:37:42 -05:00
vilmibm
a225173551 support --workflow in run list 2021-03-28 14:03:25 -05:00
Nate Smith
126b498e9f
Actions Support Phase 1 (#2923)
* Implement first round of support for GitHub Actions

This commit adds:

gh actions
gh run list
gh run view
gh job view

as part of our first round of actions support. These commands are
unlisted and considered in beta.

* review feedback

* tests for exit status on job view

* spinner tracks io itself

* review feedback

* fix PR matching

* enable pager for job log viewing

* add more colorf functions

* add AnnotationSymbol

* hide job, run

* do not add method to api.Client

* remove useless cargo coded copypasta
2021-03-16 13:59:34 -07:00