fix(ci): retry template scaffolding on transient network failures - #6039
Conversation
Each Test Templates leg scaffolds a fresh module and a fresh node_modules, so every dependency is re-resolved from the Go checksum DB and the npm registry. A single transient error there fails the whole matrix. Retry the generate + build step up to three times, but only when the output matches a known transient signature, so genuine template breakage still fails on the first attempt.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe Test Templates workflow now runs template initialization and build commands through a retry loop. It retries recognized transient Go, npm, network, gateway, service, and native-binding errors up to three times while preserving other failure statuses. ChangesTemplate Build Reliability
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized CI change adds gated retries for known transient scaffolding failures without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Linked Issues checkExplanation The implementation satisfies issue Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR hardens the Test Templates CI job by adding a targeted retry loop around the template scaffold + build step, to reduce flaky failures from transient Go checksum DB and npm registry/network issues while still failing fast on real template breakage.
Changes:
- Wraps template generation + build into a
generate_and_buildfunction and retries it up to 3 times. - Retries are gated on a regex of known transient failure signatures, with exponential-ish backoff (
attempt * 15seconds).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
Test Templatesscaffolds a new module on every leg, so all dependencies are re-resolved fromsum.golang.organd the npm registry. Before this change one failed request reded the leg and the whole run. Now the scaffold-and-build step retries up to three times, gated on known transient signatures, so real breakage still fails on the first attempt.Two classes hit this step on 2026-08-26:
Warming the module cache doesn't help. The tile fetch comes from the template writing a new
go.sum, not from the module download, and building v3 first verifies against its existinggo.sumso it leaves the tile cache cold.GOSUMDB=offwould work but drops verification.Follows 55c8d9a, which hardened the same job against partial npm publishes. That doesn't cover transport errors.
Two notes for review:
set +eplus${PIPESTATUS[0]}is deliberate. Bash suppressesset -einside a subshell called as anifcondition, soif generate_and_buildwould run past a failingwails3 init.Fixes #6038
Type of change
How Has This Been Tested?
CI on this PR runs the new step across all 24 legs, since the workflow triggers on changes to itself.
Locally I stubbed
generate_and_buildand drove the loop: success gives 1 attempt and exit 0; transient then success gives 2 and 0; genuine error gives 1 and 1; always transient gives 3 and 1.Classifier checked against real output. Retried: the sumdb error above,
Cannot find native binding,502 Bad Gateway,503 Service Unavailable,i/o timeout. Not retried:added 504 packages, and audited 505 packages in 12s(an earlier draft matched a bare50[234]and would have),undefined: SomeSymbol,error TS2304,Could not resolve.macOS only because that is where the shell tests ran. The full matrix is the PR's CI run.
Test Configuration
Not applicable. Workflow-only change with no runtime or CLI code.
Checklist:
website/src/pages/changelog.mdxwith details of this PR (v3 changelog entries are added automatically)Docs and tests unticked on purpose: no docs describe this workflow, and CI workflows have no test harness here.
Happy to drop the gating for a plain retry if you'd prefer the simpler step.