Skip to content

fix(#6105): retry GetFileContent on 404 in post-install validation - #6106

Merged
ralphbean merged 1 commit into
mainfrom
agent/6105-validate-retry-on-404
Aug 13, 2026
Merged

fix(#6105): retry GetFileContent on 404 in post-install validation#6106
ralphbean merged 1 commit into
mainfrom
agent/6105-validate-retry-on-404

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

  • Add retry-on-404 logic to ValidatePerRepoPostInstall in pkg/behaviourtest/drivers/install/validate.go to tolerate GitHub API read-after-write eventual consistency
  • New getFileWithRetry helper retries GetFileContent up to 5 times with 2-second backoff when the error is a 404 (forge.IsNotFound); non-404 errors fail immediately
  • Add unit tests covering retry success, retry exhaustion, non-404 immediate failure, and context cancellation; add integration-level tests for ValidatePerRepoPostInstall with transient 404s

Context

TestBehaviourSuite intermittently fails during post-install validation with a 404 reading back .github/workflows/fullsend.yaml immediately after fullsend github setup commits it. This caused merge queue ejections (e.g., PR #5736). The retry budget (5 attempts, 2s apart = ~8s max) matches the existing waitForFileAccessible pattern in url_dispatch.go.

Test plan

  • All new getFileWithRetry unit tests pass (transient 404, exhausted retries, non-404 immediate failure, context cancellation)
  • ValidatePerRepoPostInstall integration tests pass (retry success, clear error on exhaustion)
  • All existing tests in pkg/behaviourtest/drivers/install/... pass (42 tests, 0.078s)
  • go vet passes
  • CI e2e behaviour suite validates the fix under real GitHub API conditions

Closes #6105

Post-script verification

  • Branch is not main/master (agent/6105-validate-retry-on-404)
  • Secret scan passed (gitleaks — d62fc7141712252d51853fa6a9be5af6b929251b..HEAD)
  • PR body secret scan passed (gitleaks — no-git)

ValidatePerRepoPostInstall reads back files immediately after
fullsend github setup commits them. The GitHub API can return
transient 404s due to read-after-write eventual consistency,
causing TestBehaviourSuite to fail intermittently and ejecting
PRs from the merge queue.

Add a getFileWithRetry helper that retries GetFileContent up to
5 times with 2-second backoff when the error is a 404
(forge.IsNotFound). Non-404 errors fail immediately. The retry
budget (5 attempts, 2s apart = ~8s max) matches the existing
waitForFileAccessible pattern in url_dispatch.go.

The retry delay is a package-level var overridden to zero in
tests to keep the suite fast. Added speedUpValidateRetries to
existing ensure_test.go tests that exercise the validation path
with installed=false to prevent the new retries from slowing
them down.

Note: pre-commit could not run (sandbox network policy blocks
git fetch for hook environment setup). go vet and tests passed.

Closes #6105
@fullsend-ai-coder
fullsend-ai-coder Bot requested a review from a team as a code owner August 11, 2026 15:22
@fullsend-ai-review

fullsend-ai-review Bot commented Aug 11, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:23 PM UTC · Completed 3:34 PM UTC

Commit: b27be69 · View workflow run →

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/behaviourtest/drivers/install/validate.go 89.47% 0 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

Copy link
Copy Markdown

Looks good to me


Labels: PR fixes e2e test flakiness in the install driver's post-install validation

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge component/e2e End-to-end tests component/install CLI install and app setup type/bug Confirmed defect in existing behavior labels Aug 11, 2026
@ralphbean
ralphbean enabled auto-merge August 11, 2026 21:08
@ralphbean
ralphbean added this pull request to the merge queue Aug 11, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 11, 2026
@ralphbean
ralphbean added this pull request to the merge queue Aug 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 12, 2026
@ralphbean
ralphbean added this pull request to the merge queue Aug 13, 2026
Merged via the queue into main with commit 091ee92 Aug 13, 2026
35 of 37 checks passed
@ralphbean
ralphbean deleted the agent/6105-validate-retry-on-404 branch August 13, 2026 16:00
@fullsend-ai-retro

fullsend-ai-retro Bot commented Aug 13, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 4:03 PM UTC · Completed 4:19 PM UTC

Commit: b27be69 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #6106 — retry GetFileContent on 404 in post-install validation

Workflow quality: Excellent. This was a clean end-to-end autonomous workflow with zero rework, first-attempt code success, and full agent–human alignment on review.

Timeline

Time (Aug 11) Event
15:01 ralphbean filed #6105 — post-install validation races GitHub API eventual consistency
15:02–15:06 Triage agent (run 31504842381) — labeled type/bug, component/e2e, component/install, applied ready-to-code
15:06–15:22 Code agent (run 31505271442) — produced single-commit fix, opened PR #6106
15:22–15:34 Review agent (run 31506647181) — approved after correctness/intent-coherence/style sub-agents found no issues
15:26 Codecov: 89.47% patch coverage (above 80% threshold)
21:08 ralphbean approved (human review), added to merge queue
21:36 Merge queue rejection #1 — GCP WIF quota exhaustion in E2E tests
Aug 12 21:07 Re-queued; rejection #2 at 21:13 — same WIF quota issue
Aug 13 15:49 Re-queued; merged at 16:00

What went well

  • First-attempt success. Code agent produced correct, well-tested code in ~15 minutes. The getFileWithRetry helper correctly matches the existing waitForFileAccessible pattern. No fix agent runs needed.
  • Proactive test discipline. The agent noticed retry delays slowed 11 existing tests from 0s to ~8s each and added speedUpValidateRetries(t) to all affected tests, keeping the package at 0.078s.
  • Thorough review. The correctness sub-agent made 20 tool calls verifying retry bounds, context cancellation, cleanup ordering, and test double embedding. The challenger pass validated both info-level findings.
  • Zero agent–human delta. Both the review agent and ralphbean approved with no substantive findings. Independent code analysis confirms no missed issues.

Merge queue delay (not an agent workflow issue)

The 48-hour gap between human approval and merge was caused by two merge queue ejections from GCP WIF quota exhaustion (HTTP 429) in E2E test setup, plus a GitHub API timeout. The PR's own code was not the cause. Re-queuing happened manually ~once per day.

Evidence for existing open issues

Autonomy readiness

This PR demonstrates zero agent–human review delta on a well-scoped test-infrastructure bug fix with comprehensive tests and all CI green. The class of change — single-issue driver fix following established patterns, with 89% patch coverage — is a candidate for reduced human review requirements. See #3026 for the broader tracking effort.

No proposals filed

All improvement areas identified are already tracked by existing open issues. No new proposals are warranted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/e2e End-to-end tests component/install CLI install and app setup ready-for-merge All reviewers approved — ready to merge type/bug Confirmed defect in existing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(behaviour): post-install validation races GitHub read-after-write, 404s on .github/workflows/fullsend.yaml

1 participant