Skip to content

fix(provisioning): auto-discover App installation, alert on failure, close registration-to-roster gap#232

Merged
accesswatch merged 1 commit into
mainfrom
fix/provisioning-robustness
Jul 2, 2026
Merged

fix(provisioning): auto-discover App installation, alert on failure, close registration-to-roster gap#232
accesswatch merged 1 commit into
mainfrom
fix/provisioning-robustness

Conversation

@accesswatch

Copy link
Copy Markdown
Collaborator

Why

The Provision Learning Rooms workflow has failed on every real run since June 2 (280 runs, 1 success - a dry run). Root cause: the provisioning GitHub App was created but never installed on the Community-Access org, so minting an installation token 404s. Two enrolled learners have been pending for a month with no alert. Full incident review: REVIEW-2026-07-02.md (included in this PR).

What changed

Provisioning subsystem:

  • Installation ID is now optional: when the secret is unset, provisioning discovers the installation from the App at runtime (and installation-settings URLs are accepted where an ID is given). 404s now come with actionable guidance.
  • provision-cli gains --check-auth (credentials canary) and a template-repo preflight before the per-learner loop.
  • New sync-intake-to-roster script: open [ENROLL-INTAKE] issues in the admin repo are upserted into roster.json as pending learners (idempotent; never touches existing entries). This closes the manual hop that left about 8 real enrollees out of the roster.

Workflows:

  • provision-learning-rooms: intake sync step, early exit when no pending work, roster committed even when provisioning fails, watchdog provisioning-alert issue on failure (auto-closed on success), repository_dispatch trigger, healing-sweep cron (every 6h) instead of 30-minute polling, actions-bot spike mode removed.
  • New provisioning-health-check: weekly token mint + template access verification with the same alerting.
  • registration: dispatches provisioning the moment an enrollment lands; dead GitHub Classroom assignment links removed; [REGISTER] intake is now stored privately and the public issue body redacted (PII hygiene, mirroring the [ENROLL] path).

Docs and hygiene:

  • SPEC 7.2a, admin/OWNED_PROVISIONING.md, admin/HYBRID_DEPLOYMENT_GUIDE.md updated to match (org-wide install requirement, optional installation ID, health check as a phase gate).
  • DEPLOYMENT_ASSESSMENT.md: emoji replaced with ASCII labels, July 2026 correction appended.
  • Scratch files (tmp-*, fix.md/fix.html, e2e JSON logs) removed and gitignored; validate-authoritative-sources is green at HEAD; HTML regenerated.

Tests

  • npm run test:provisioning: 70/70 pass (12 new tests: installation discovery, resolveToken fallback, check-auth flag, intake sync parsing/merging/idempotency)
  • npm run test:automation: 78/78 pass (registration readiness test updated: asserts Classroom links are gone, provisioning dispatch and redaction are present)
  • node scripts/validate-authoritative-sources.js: pass

Remaining manual step (blocking for provisioning to work)

Install the GitHub App on the Community-Access org (org-wide access), then run the Provisioning Credentials Health Check workflow. The PROVISIONING_APP_INSTALLATION_ID secret can be left unset after this PR.

🤖 Generated with Claude Code

…close registration-to-roster gap

Root cause of a month of failed runs: the provisioning GitHub App was never
installed on the org, and the 30-minute schedule failed silently 280 times
while two enrolled learners waited unprovisioned.

- github-app-auth: normalize installation IDs (accept settings URLs) and
  discover the installation from the App when the secret is unset, with
  actionable 404 guidance
- provision-cli: --check-auth credentials canary; template-repo preflight
  before the provisioning loop
- new sync-intake-to-roster: [ENROLL-INTAKE] issues in the admin repo flow
  into roster.json automatically (idempotent, never touches existing entries)
- provision-learning-rooms workflow: intake sync step, work-free early exit,
  roster commit on failure too, watchdog provisioning-alert issue opened on
  failure and closed on success, repository_dispatch trigger, healing-sweep
  cron instead of 30-minute polling, actions-bot spike mode removed
- new provisioning-health-check workflow: weekly token mint + template
  access check with the same alerting
- registration workflow: dispatches provisioning on enrollment, drops dead
  GitHub Classroom assignment links, stores [REGISTER] intake privately and
  redacts PII from public issue bodies
- docs: SPEC 7.2a, OWNED_PROVISIONING, HYBRID_DEPLOYMENT_GUIDE updated;
  DEPLOYMENT_ASSESSMENT de-emojied with a July 2026 correction; full
  incident review in REVIEW-2026-07-02.md
- hygiene: scratch tmp-* files and fix.md/fix.html removed and gitignored;
  authoritative-sources gate green at HEAD; HTML regenerated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 2, 2026 19:01
@accesswatch
accesswatch requested a review from taylorarndt as a code owner July 2, 2026 19:01
@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 hardens the “Hybrid provisioning” subsystem and workshop enrollment pipeline by removing the “installation ID as a required secret” failure mode, adding health checks and watchdog alerting, and closing the intake-to-roster gap that previously required manual updates.

Changes:

  • Add GitHub App installation auto-discovery, --check-auth credentials canary, and template-repo preflight to provisioning CLI/auth.
  • Update workflows to be event-driven (dispatch on enrollment), reduce polling (6h healing sweep), sync intake issues into the roster, and open/close a provisioning-alert watchdog issue.
  • Improve PII hygiene for [REGISTER] by storing intake privately and redacting the public issue body; remove/ignore scratch artifacts and regenerate HTML/docs to match.

Reviewed changes

Copilot reviewed 33 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tmp-rename-audit.log Removed scratch log file from repo root.
tmp-proposed-stage-1-1.csv Removed scratch CSV artifact.
tmp-proposed-rename.csv Removed scratch CSV artifact.
tmp-proposed-feed-order.csv Removed scratch CSV artifact.
tmp-learning-room-smoke-wrapper.ps1 Removed scratch smoke-test script.
tmp-learning-room-smoke-test.ps1 Removed scratch smoke-test script.
tmp-crosslink-rewrite-report.txt Removed scratch report artifact.
tmp-audio-inventory.csv Removed scratch inventory artifact.
SPEC.md Document updated provisioning requirements (org-wide install, optional installation ID, watchdog).
scripts/validate-authoritative-sources.js Exclude CLAUDE.md from authoritative-sources validation targets.
REVIEW-2026-07-02.md Added incident/operations review documenting the failure mode and remediations.
html/SPEC.html Regenerated HTML for updated spec.
html/REVIEW-2026-07-02.html Added generated HTML for the new ops review.
html/DEPLOYMENT_ASSESSMENT.html Added generated HTML reflecting assessment correction.
html/CLAUDE.html Added generated HTML for new tooling guidance doc.
html/admin/OWNED_PROVISIONING.html Regenerated HTML for updated admin runbook content.
html/admin/HYBRID_DEPLOYMENT_GUIDE.html Regenerated HTML for updated deployment guide content.
fix.md Removed scratch/temporary doc.
fix.html Removed scratch/temporary HTML doc.
DEPLOYMENT_ASSESSMENT.md Replace emoji markers with ASCII labels; add July 2026 correction + source sections.
CLAUDE.md Added repo/tooling guidance (commands, architecture, conventions).
admin/OWNED_PROVISIONING.md Update operator runbook for org-wide install, health check, intake sync, watchdog.
admin/HYBRID_DEPLOYMENT_GUIDE.md Update deployment guide for org-wide install, optional installation ID, health check gate.
.gitignore Ignore scratch artifacts (tmp-*) and related generated logs.
.github/workflows/registration.yml Remove Classroom links, dispatch provisioning on enrollment, store/redact registration intake.
.github/workflows/provisioning-health-check.yml New weekly credentials canary workflow with alerting.
.github/workflows/provision-learning-rooms.yml Intake sync + early exit + commit-on-failure + watchdog alert issue + reduced cron polling.
.github/scripts/provisioning/sync-intake-to-roster.js New script to upsert open [ENROLL-INTAKE] issues into roster.json as pending learners.
.github/scripts/provisioning/provision-cli.js Add --check-auth, installation discovery fallback, and template access preflight.
.github/scripts/provisioning/github-app-auth.js Add installation-ID normalization, discovery via /app/installations, improved 404 guidance.
.github/scripts/provisioning/tests/sync-intake-to-roster.test.js New tests for intake parsing and idempotent roster merging.
.github/scripts/provisioning/tests/provision-cli.test.js New tests for --check-auth parsing and installation discovery behavior.
.github/scripts/provisioning/tests/github-app-auth.test.js New tests for installation URL normalization + discovery error modes.
.github/scripts/tests/registration-workflow-readiness.test.js Update readiness checks to enforce no Classroom links + verify dispatch/redaction markers.

Comment on lines +182 to +184
- name: Close provisioning alert issue on success
if: ${{ success() }}
uses: actions/github-script@v8
Comment on lines 8 to +12
permissions:
contents: write
issues: write
# Needed to dispatch the provisioning workflow when an enrollment lands.
actions: write
@accesswatch
accesswatch merged commit c4eb618 into main Jul 2, 2026
5 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