-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
This issue is a follow-up to #11118.
We want to use the Actions API (here) as a fallback mechanism to retrieve job run logs when the current approach (extracting logs from a downloaded ZIP archive) fails.
Other context
- If there's 1 job log missing, there are probably others, but fixing that holistically is a larger conversation with the Actions team.
- It's common for projects to have a lot of logs for matrix workflows.
As a middle ground to avoid hitting the API too many times in case of huge runs (lots of jobs), we need to apply a restriction on the number of fallback API calls, and display an actionable error message to users.
Acceptance Criteria
1. Fallback to API call
Given I have a job run that is missing from the downloaded ZIP archive
When I run gh run view --log -j <JOB-RUN-ID>
Then I see the job logs, with the step name column filled with "UNKNOWN STEP"
Note
Reproducing this with read data is a bit tricky. Since this fix coincidentally fixes the cases reported in #10868, we can also use those cases to verify the current PR.
2. Error when too many API calls are needed
Given I have a workflow run where more than 25 job log files are missing from the downloaded ZIP archive
When I run gh run view --log <RUN-ID>
Then I get an error indicating I should use the --job option (without any API calls being made)