Skip to content

fix(provisioning): wait for asynchronous template copy before verification#235

Merged
accesswatch merged 1 commit into
mainfrom
fix/verify-waits-for-template-copy
Jul 2, 2026
Merged

fix(provisioning): wait for asynchronous template copy before verification#235
accesswatch merged 1 commit into
mainfrom
fix/verify-waits-for-template-copy

Conversation

@accesswatch

Copy link
Copy Markdown
Collaborator

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

…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>
@accesswatch
accesswatch requested a review from taylorarndt as a code owner July 2, 2026 19:24
Copilot AI review requested due to automatic review settings July 2, 2026 19:24
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Peer Review Assigned

Hi @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:

  • Does the change accomplish what the issue describes?
  • Is the writing clear and helpful?
  • Are there any typos or grammar issues?

Accessibility:

  • Proper heading hierarchy (H1 → H2 → H3, no skips)?
  • Descriptive link text (not "click here")?
  • Alt text on images?
  • [TODO] markers removed?

Documentation:

  • Code blocks are properly formatted?
  • Tables have headers?
  • References/links work correctly?

Review Guidelines:

  • Be kind and constructive
  • Suggest improvements, don't just point out problems
  • Ask questions if something is unclear
  • Approve when ready or request changes with explanation

Resources:


Pairing by Learning Room Grouping Engine

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 sleep into 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.

@accesswatch
accesswatch merged commit e1fd386 into main Jul 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants