Repository navigation
Fetch a re-run's errors again when the new attempt fails too [patch] - #397
Merged
Merged
Conversation
A GitHub re-run keeps the run id. When attempt 2 also failed and the app never saw it pending or running, the stored run was already a failure with attempt 1's errors, so ShouldFetchRunErrors returned false and the row kept showing the previous attempt's errors next to the new start time. UpdateRunFromWorkflowAsync now compares the stored start time with the run's run_started_at before overwriting it. A changed start time is a new attempt: the old errors are dropped and the jobs are fetched again if it failed. An unchanged failed run still isn't refetched on every update (#311). Fixes #394 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5KENnPmXEat6KQ92F
SonarCloud's quality gate failed at 33% coverage on new code because the attempt check lived in the private UpdateRunFromWorkflowAsync. StartAttempt now records the start time, drops a previous attempt's errors and reports whether the attempt is new, and is covered directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5KENnPmXEat6KQ92F
Clearing a new attempt's stale errors already makes ShouldFetchRunErrors fetch them, since a failure with no errors is always fetched. The extra newAttempt parameter is gone, StartAttempt just records the start time and drops the old errors, and UpdateRunFromWorkflowAsync changes by one line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5KENnPmXEat6KQ92F
|
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 #394
What was wrong
A GitHub re-run keeps its run id. When attempt 2 also failed and the app never saw it as Pending or Running, the stored run was already
Failurewith attempt 1's errors.ShouldFetchRunErrorstherefore returned false, and the row showed the new start time next to the previous attempt's errors indefinitely.Change
GitHub.IsNewAttempt(storedStarted, started): true when a run that was read before comes back with a differentrun_started_at. A run read for the first time (no stored start) doesn't count.GitHub.StartAttempt(run, started): records the start time and, on a new attempt, drops the previous attempt's errors.UpdateRunFromWorkflowAsynccalls it in place of assigningrun.Starteddirectly.ShouldFetchRunErrorsto read the new attempt's jobs. If that fetch hits an API error, the errors stay empty, and the next update retries, as it does today.Tests
GitHubRunErrorsTestsgains three tests:With the error-clearing in
StartAttemptdisabled,AFailedReRunOfAFailedRunFetchesItsJobsAgainfails. The full suite passes: 165/165.The companion issue #395 (a re-run that isn't among the workflow's 10 newest runs is never re-read) is separate and not covered here.
🤖 Generated with Claude Code
https://claude.ai/code/session_017vfJW5KENnPmXEat6KQ92F