This commit converts all of the places using ColorScheme.Gray and ColorScheme.Grayf to Muted and Mutedf.
There is a little extra tidying up with local variable names or converting code to use Mutedf format.
This commit expands the `Step` structure used with GitHub Actions workflow runs to include fields indicating when steps start and complete.
This information is already provided by the GitHub API, so this only involves expanding the structure, fields exported, and the associated tests.
In the future, I could see `gh` including the duration calculation which is used when viewing workflow or workflow run.
* Introduce attempt flag for run watch and use attempt input when fetching jobs
* Handle attempt input for 'run watch' commands instead of using the latest attempt
* Revert attempt flag implementation for 'run watch' command because it is intended only for the latest attempt
* Fix tests for cases when attempt flag is used on 'run view' command
---------
Co-authored-by: Andy Feller <andyfeller@github.com>
The API field `WorkflowRun.name` is not guaranteed to correspond to the workflow name anymore. This introduces additional API lookups that resolve Workflows by their ID and look up their name in a future-proof fashion.
It also adds two new JSON fields for export: `displayTitle` and `workflowName`.
Co-authored-by: Christina Guo <61271066+guo-chris@users.noreply.github.com>
Co-authored-by: Mislav Marohnić <mislav@github.com>
This switches `run list` and `run view` commands to measure how long ago did the run happen by using `run_started_at`, which is the timestamp of the latest run in a series, instead of `created_at`, which is the timestamp of the first run. This change also fixes accurate duration for in-progress runs.
* Add branch and actor filters to `run list`
* Simplify what FilterOptions can do
* Check not only limit in TestNewCmdList
* Verify that branch/actor params are parsed properly
* Verify that API requests have proper query parameters
* Change flag name from actor to user
Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
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.