Skip to content

fix(provisioning): seed Challenge 1 at provision time and tolerate pending invitations#236

Merged
accesswatch merged 1 commit into
mainfrom
fix/seed-first-challenge
Jul 2, 2026
Merged

fix(provisioning): seed Challenge 1 at provision time and tolerate pending invitations#236
accesswatch merged 1 commit into
mainfrom
fix/seed-first-challenge

Conversation

@accesswatch

Copy link
Copy Markdown
Collaborator

Summary

Provisioned learning rooms started with an empty Issues tab (#226, #216): the Student Progression Bot only fires on issue close or manual dispatch, so nothing ever created Challenge 1 and the progression chain never began. Every room in the self-paced-2026 cohort was affected.

Changes

  • provision-core.js: after content verification, seed the first challenge issue via an optional client capability. A seeding failure marks the learner failed and surfaces to the watchdog (SPEC 7.2b: never leave a half-seeded repo silently).
  • seed-first-challenge.js (new): runs the learning-room challenge-progression script against the student repo with the App installation token. Idempotent via the script's own duplicate check. The App's existing Issues write permission covers this; no new permissions.
  • learning-room/challenge-progression.js: validate assignability in the repository (GET /repos/{owner}/{repo}/assignees/{user}) instead of global user existence. At provision time the learner's collaborator invitation is still pending, so assigning them 422s; the issue is now created unassigned and later challenges are assigned to whoever closes the previous one.
  • SPEC.md 7.2a and 7.2b updated to match the implementation; HTML regenerated.

Testing

  • npm run test:provisioning: 80/80 pass (7 new tests, all watched fail first)
  • npm run test:automation: 81/81 pass
  • Live-verified: the fixed script created unassigned Challenge 1 issues in the waphi and accesswatch-student rooms (both have pending invitations) and skipped idempotently on rerun.

🤖 Generated with Claude Code

…nding invitations

Provisioned learning rooms started with an empty Issues tab: the Student
Progression Bot only fires on issue close or manual dispatch, so nothing
ever created Challenge 1 and the progression chain never began (reported
in #226 and #216; every room in the self-paced-2026 cohort was affected).

- provision-core: after content verification, seed the first challenge
  issue via an optional client capability; a seeding failure marks the
  learner failed and surfaces to the watchdog.
- seed-first-challenge: new provisioning module that runs the
  learning-room challenge-progression script against the student repo
  with the App installation token. Idempotent via the script's own
  duplicate check.
- challenge-progression: validate assignability in the repository
  (assignees endpoint) instead of global user existence. At provision
  time the collaborator invitation is still pending, so assignment 422s;
  the issue is now created unassigned and later challenges are assigned
  to whoever closes the previous one.
- SPEC.md 7.2a/7.2b updated to match; HTML regenerated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@accesswatch accesswatch requested a review from taylorarndt as a code owner July 2, 2026 22:16
Copilot AI review requested due to automatic review settings July 2, 2026 22:16
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Learning Room Validation Report

Great work. Your changes look good.

Resources

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Hi! I am Gandalf, your workshop agent. I bring a little magic to make this interaction clear, helpful, and fun. Here is my review of your pull request:

Report Status

Validation Needs Attention [ACTION REQUIRED]

Required Checks

  • Issue Reference
    PR should reference the issue it addresses (e.g., "Closes #12")
    Add "Closes #XX" to your PR description to automatically close the issue when merged. Learn more: docs/04-working-with-issues.md

  • PR Description

  • File Location
    Changes should be in learning-room/ directory only
    Student contributions should modify files in learning-room/docs/ only. Other directories are workshop infrastructure.

Learning Resources

Based on your changes, these guides might help:


Automated validation by Learning Room Bot. Gandalf generated this review. Last updated: 2026-07-02T22:17:13.716Z
Questions? Check PR Guidelines or mention @Facilitator

@github-actions github-actions Bot added documentation Improvements or additions to documentation needs-work labels Jul 2, 2026
@accesswatch accesswatch merged commit 2dca3f2 into main Jul 2, 2026
11 of 12 checks passed
@accesswatch accesswatch deleted the fix/seed-first-challenge branch July 2, 2026 22:17
@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

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Progress Update

Great work, @accesswatch!

Current Level: Explorer
Merged PRs: 29
Next Level: Contributor (NaN more merged PRs)

Available Challenges:

  • 01 Scavenger Hunt
  • 02 First Issue
  • 03 Join Conversation

Keep going!

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 fixes a provisioning dead-start where newly created learning-room repos had no Challenge 1 issue, so the Student Progression Bot never triggered and learners could not begin the progression chain. It adds a provisioning-time seeding step (using the same progression script the student repo uses) and updates the progression script to tolerate pending collaborator invitations by creating the first issue unassigned when necessary.

Changes:

  • Seed Challenge 1 during provisioning (post-workflow verification) by invoking the learning-room challenge-progression.js script with the App installation token.
  • Update challenge-progression.js to validate assignee repo assignability (assignees endpoint) rather than global user existence, and to be importable for unit testing.
  • Update SPEC docs and regenerate committed HTML/search index outputs to reflect the new non-deferrable seeding requirement.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
SPEC.md Updates provisioning spec to require seeding Challenge 1 at provision time and documents pending-invitation behavior.
learning-room/.github/scripts/challenge-progression.js Adds repo-level assignee validation + exports helper for tests; guards main execution.
html/SPEC.html Regenerated HTML to reflect SPEC updates.
html/search-index.json Regenerated search index output after docs changes.
.github/scripts/provisioning/seed-first-challenge.js New module that runs challenge-progression.js against the student repo to seed Challenge 1.
.github/scripts/provisioning/provision-core.js Calls client.seedFirstChallenge() after required workflow verification.
.github/scripts/provisioning/provision-cli.js Wires the seeder into the provisioning client used by the CLI.
.github/scripts/provisioning/tests/seed-first-challenge.test.js Unit tests for the new seeding module (spawn behavior, error surfacing).
.github/scripts/provisioning/tests/provision-core.test.js Adds provisioning tests for Challenge 1 seeding behavior and failure handling.
.github/scripts/tests/challenge-progression-assignee.test.js Regression tests for pending-invitation assignee handling via exported helper.

Comment on lines +287 to +291
} catch (error) {
log('WARN', `Assignee ${candidate} cannot be assigned yet (pending invitation or no repo access): ${error.message}`);
log('INFO', 'Issue will be created without an assignee.');
return null;
}
Comment on lines +1 to +3
/**
* First-challenge seeding for provisioning (SPEC.md section 7.2b step 3).
*
Comment on lines +11 to +21
process.env.GITHUB_TOKEN = 'test-token';
process.env.GITHUB_REPOSITORY = 'org/room';
process.env.START_CHALLENGE = '';
process.env.GITHUB_EVENT_NAME = '';
process.env.CLOSED_ISSUE_TITLE = '';

// The script resolves its issue-template directory from the working
// directory, so requiring it must happen from inside learning-room/.
process.chdir(path.join(__dirname, '..', '..', '..', 'learning-room'));

const { resolveValidAssignee } = require('../../../learning-room/.github/scripts/challenge-progression');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs-work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants