Repository navigation
Give failed GitHub runs with no failed job an error, and stop re-fetching their jobs [patch] - #356
Merged
Merged
Conversation
…-fetching their jobs [patch] Only jobs concluding `failure` were read for errors, so a startup_failure run (no jobs), a timed-out job, or a failed run whose jobs all ended cancelled showed an empty Errors column, and because it was empty the jobs endpoint was called again on every update. Timed-out jobs are now read like failed ones, a run with no job-level errors gets "Workflow failed: <conclusion>", and rate-limit ApiExceptions propagate to the request wrapper instead of being swallowed. Fixes #311 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017EaPNsXeyoDtKFxzXCwfq2
FetchRunErrorsAsync now takes the jobs client, so the whole fetch is covered: a startup failure with no jobs, a timed-out job read from its log, the step and conclusion fallbacks, jobs that are gone, other API failures, and rate limits from both the job list and a log read reaching the request wrapper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017EaPNsXeyoDtKFxzXCwfq2
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #311
Problem
FetchRunErrorsAsynconly read jobs that concludedfailure. Astartup_failurerun has no jobs, a timed-out job concludestimed_out, and a failed run can have every job end ascancelled. Each of these showed as Failure with an empty Errors column. BecauseErrorsstayed empty, theErrors.Count == 0re-fetch condition called the jobs endpoint again on every update, which spent rate-limit budget. The error fetch'scatch (ApiException) { }also swallowed rate-limit 403s, so the backoff never applied.Change
timed_outare read the same way asfailurejobs. With no log errors and no failed steps, they report[<job>] Timed out.Workflow failed: <conclusion>, for exampleWorkflow failed: startup_failure. A completed fetch therefore never leavesErrorsempty and doesn't repeat. ANotFoundExceptionon the jobs list also records that fallback.ApiExceptions (RateLimitExceededException,SecondaryRateLimitExceededException, 429, or 403 withX-RateLimit-Remaining: 0) are no longer swallowed by the job list or log fetch. They reachMakeGitHubRequestAsync, so its backoff applies. Other API failures are still swallowed and retried on the next update.internal staticmethods (ShouldFetchRunErrors,IsFailedJob,DescribeFailedJob,WithRunLevelFallback,IsRateLimitException) so they can be tested without a live client.Tests
New
GitHubRunErrorsTests(9 cases) covers each acceptance criterion: a startup failure with no jobs ends with a non-emptyErrors, a second update doesn't fetch the jobs again, timed-out jobs count as failed, and rate limits are told apart from other API failures. With the helpers temporarily reverted to the old behaviour, 4 of the 9 fail. With the fix, all pass.Full suite: 120/120 passing locally.
🤖 Generated with Claude Code
https://claude.ai/code/session_017EaPNsXeyoDtKFxzXCwfq2
Generated by Claude Code