fix: Handle GitHub API artifact propagation delay #976
+128
−7
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.



Summary
Problem
When a GitHub Actions build completes, there can be a brief delay before the artifact is visible via the GitHub API. If the Sample Platform cron runs during this window:
find_artifact_for_commit()doesn't find artifact (API propagation delay)_diagnose_missing_artifact()sees build succeeded → marks as permanent failureThis was observed on CCExtractor/ccextractor#1913.
Solution
Grace period for recently-completed builds: If a build completed within the last 5 minutes but artifact isn't visible, treat as retryable instead of permanent failure
Retry logic for GitHub status updates: Use
retry_with_backoff()(3 attempts, 2s initial backoff) when updating GitHub status inmark_test_failed()to handle transient API failuresTest plan
test_recently_completed_build_is_retryable- verifies builds completed 1 minute ago are retryabletest_old_completed_build_is_not_retryable- verifies builds completed 10 minutes ago are not retryabletest_mark_test_failed_uses_retry_for_github- verifies retry logic is used for GitHub status updatesTestDiagnoseMissingArtifacttests passTestMarkTestFailedImprovedtests pass🤖 Generated with Claude Code