Commit graph

84 commits

Author SHA1 Message Date
William Martin
e644dc50d6 Capture error on Run Log Cache Exists 2024-04-05 15:16:12 +02:00
William Martin
a89d50fc63 Rework Run Log Cache so that cache dir is injected 2024-04-05 14:59:24 +02:00
William Martin
90fc403813 Document run watch and view not supporting fine grained PATs 2024-03-19 14:52:43 +01:00
Andy Feller
3bb5f54073 Apply first round of owner/repo#number consistency
This commit expands on @nobe4 initial work by bringing the owner and repository name to the most obvious issue and PR number output use cases before making a second pass for any edge cases.
2024-03-01 14:03:18 -05:00
benebsiny
0b73f2af86 Verify the downloaded zip for gh run view --log 2023-12-14 01:54:16 +08:00
William Martin
8364301017 Simplify run view annotation fetch error handling 2023-11-06 12:40:13 +01:00
Arun Sathiya
9d04ee6c8d
update(run): Use attempt input when fetching jobs (#7831)
* 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>
2023-10-03 14:36:47 +02:00
Harvey Sanders
137da73642 Simplify mock jobs response 2023-09-03 20:32:41 -04:00
Harvey Sanders
acc362f9d8 Fix pagination resp with "Link" header 2023-09-03 19:55:27 -04:00
Harvey Sanders
44e1efc221 Fetch all jobs on a gh view run --json 2023-08-21 10:29:58 -04:00
William Martin
2d3047c7e3 Support viewing logs for jobs with composite actions 2023-06-02 13:40:53 +02:00
vilmibm
8a605fbaf5 Merge remote-tracking branch 'upstream/trunk' into run-prompts 2023-05-19 10:25:18 -07:00
Alexander Seiler
218f29f296
Correct some typos 2023-04-21 03:51:31 +02:00
nate smith
9010a2e12c use new prompter in run view 2023-04-10 16:21:47 -07:00
Wing-Kam Wong
48ed914d58 refactor: set the default case first 2023-03-28 21:21:11 +08:00
Wing-Kam Wong
cc554135e8 fix: change MaximumNArgs from 2 to 1 in run view.go 2023-03-28 21:16:04 +08:00
Wing-Kam Wong
0fa168b80b feat: add tests for attempt flag 2023-03-26 19:12:40 +08:00
Wing-Kam Wong
a4c77ffd92 feat: include attempt in getRunLog 2023-03-26 19:12:21 +08:00
Wing-Kam Wong
343e730016 feat: pass attempt to RenderRunHeader 2023-03-26 14:38:05 +08:00
Wing-Kam Wong
2894695652 feat: add attempt flag to run view 2023-03-26 14:11:03 +08:00
Natthakit Susanthitanon
8617eb7df9
Add jobs field for run view --json (#6507)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-11-03 12:59:35 +00:00
Isaac Shalom
f1be4dc51c
Fix looking up workflow name for workflow runs (#6266)
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>
2022-09-21 20:41:19 +02:00
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
Sam Coe
6a8deb1f5a
Integrate latest go-gh packages (#6084) 2022-08-18 09:04:13 +03:00
vilmibm
41385477c3 fix linting 2022-07-27 14:15:27 -05:00
vilmibm
d5334f4115 Revert "update linter checks"
This reverts commit 40ecb8c188.
2022-07-27 13:30:41 -05:00
vilmibm
40ecb8c188 update linter checks 2022-07-26 16:06:52 -05:00
Mislav Marohnić
02881b4783
Correctly determine run started/elapsed timestamps (#5945)
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.
2022-07-21 17:30:46 +02:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Cameron Booth
c38ca830be Extract shared.GetJob so we can use in rerun too 2022-03-03 11:10:22 -08:00
Mislav Marohnić
4a3ef50d2d
Standardize pager output across commands (#5141)
Add pager functionality to the following commands:
- gist list
- pr checks
- release list
- run list
- run view
- secret list
- workflow list
- workflow view

Additionally, normalize error handling when starting the pager has
failed: only print a non-fatal notice to stderr instead of aborting the
whole command.
2022-02-01 08:36:51 +01:00
yasudanaoya
b77c37df0f
feat: add job id, into run view suggest command (#5105)
* feat: add job id, into run view suggest command

* fix: dry

* fix: run id to job id

* Change "a" to "the" when referencing a single job

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-01-27 08:19:37 +00:00
Anton Baklanov
e28fa3c112
Add branch and actor filters to run list (#4100)
* 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>
2022-01-26 08:14:56 +02:00
Mislav Marohnić
44775f87c8 Add nolint directives to allow-list current lint violations 2022-01-14 19:52:52 +01:00
Cristian Dominguez
ddaef8baa4
Add --json export flag for workflow runs (#3869)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-17 15:55:45 +00:00
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Param Patidar
20f915d5ba escape metacharacters in job name 2021-06-02 17:20:31 +00:00
Sam
aea6163a83
Merge pull request #3445 from adamslc/log_fix
Fix `run view --log` when steps have slashes
2021-04-20 08:13:26 -07:00
Sam Coe
75227f44d1
linter 2021-04-20 08:05:19 -07: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
Sam Coe
c77c7ec7c9
Match logs based on job name and step number 2021-04-19 12:21:34 -07:00
Luke Adams
58d3aa878d Extract filename creation logic to seperate function 2021-04-19 10:59:36 -06: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
Luke Adams
0822e6b4ed Fix run view --log when steps have slashes 2021-04-16 23:37:24 -06:00
vilmibm
8458c5f95d use int64 explicitly in Actions support 2021-04-15 13:32:09 -05:00
vilmibm
a2f4f725af create cache dir 2021-04-15 11:15:03 -05:00
vilmibm
e10a3f164f minor usage improvements 2021-04-13 22:43:02 -05:00
vilmibm
04844256dd annotation fixes 2021-04-13 22:10:32 -05:00
vilmibm
efe7aa1f78 fix small bug with startup_failure conclusion 2021-04-13 22:03:59 -05:00