fix(provisioning): wait for asynchronous template copy before verification#235
Merged
Merged
Conversation
…ation GitHub's generate-from-template API returns before repository contents finish copying. The verification gate ran immediately and marked every freshly created learner failed (all 10 rooms in run 28615646165 were created fine but flagged missing workflows; the healing re-run passed). Verification now retries for up to 30 seconds on fresh creates and heals; already-exists verification stays single-shot. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Peer Review AssignedHi @accesswatch! Your PR has been automatically paired with @taylorarndt for peer review. For @taylorarndt:This is a great opportunity to practice code review skills! Here's what to look for: Content Quality:
Accessibility:
Documentation:
Review Guidelines:
Resources: Pairing by Learning Room Grouping Engine |
There was a problem hiding this comment.
Pull request overview
This PR improves provisioning reliability by accounting for GitHub’s asynchronous template-content copy: after creating (or healing) a learner repo, workflow verification now retries for a short period instead of failing immediately when workflows haven’t landed yet.
Changes:
- Add configurable verification retry behavior (
verifyRetries,verifyDelayMs) after create/heal, while keeping the already-exists path as a single-shot verification. - Inject
sleepinto the verification loop to make retry behavior testable without real delays. - Add unit tests covering both the “delayed arrival succeeds” case and the “never arrives fails” case.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/scripts/provisioning/provision-core.js | Retries required-workflow verification after create/heal to tolerate asynchronous template copying. |
| .github/scripts/provisioning/tests/provision-core.test.js | Adds tests validating the new verification retry behavior for delayed and never-arriving workflows. |
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.
Why
In provisioning run 28615646165, all 10 learner repositories were created successfully, but every learner was marked failed: GitHub's generate-from-template API returns before the content copy completes, and the verification gate listed workflows immediately and found none. The healing re-run a minute later passed for all 10.
What changed
provision-core.js: after a fresh create or heal, the required-workflows verification retries (default 10 attempts, 3s apart, injectable for tests) before declaring failure. The already-exists path keeps single-shot verification. Two new tests cover the delayed-copy success and the never-arrives failure.
Tests
npm run test:provisioning: 72/72 pass (2 new).
🤖 Generated with Claude Code