Skip to content

feat: workshop operator guide and provisioning scripts#3

Merged
DhrovS merged 7 commits into
mainfrom
devin/1777767476-operator-guide-and-scripts
May 4, 2026
Merged

feat: workshop operator guide and provisioning scripts#3
DhrovS merged 7 commits into
mainfrom
devin/1777767476-operator-guide-and-scripts

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 3, 2026

Summary

Workshop operator toolkit for automating the full lifecycle of Devin Enterprise workshops using the v3 API. Covers provisioning, participant management, environment setup, and post-workshop cleanup.

Core provisioning (Devin v3 API):

  • provision-workshop.sh — Config-driven end-to-end: create org → set git permissions → invite participants → invoke setup sessions
  • teardown-workshop.sh — Clear permissions and optionally delete the org
  • verify-auth.sh — Verify API credentials and list enterprise state
  • invite-participants.sh — Batch invite users by email to enterprise + org

Shared library (scripts/lib/):

  • common.sh — HTTP helpers, logging, config readers
  • manage-org.sh — Create/update/delete/list organizations
  • manage-repos.sh — Git permission management (add/replace/clear)
  • manage-members.sh — Invite users, assign to orgs with roles
  • invoke-setup.sh — Create Devin sessions to configure env YAML

GitHub operations:

  • mirror-github-org.sh — Mirror repos between orgs with workflow stripping, include/exclude, config file support
  • cleanup-all.sh — Run all post-workshop cleanup tasks (PII + close PRs + delete branches)
  • sanitize-pr-pii.sh — Remove "Requested by" PII from PRs
  • close-old-prs.sh — Close stale open PRs
  • delete-stale-branches.sh — Delete branches with no recent commits
  • deploy-pr-pii-check.sh — Roll out PII check CI workflow to all repos in an org
  • .github/workflows/pr-pii-check.yml — The CI workflow itself

Config & docs:

  • configs/ — JSON config templates per workshop event (with participant invite support)
  • docs/api-reference-cheatsheet.md — Quick reference for all v3 API endpoints

Review & Testing Checklist for Human

  • Run ./scripts/verify-auth.sh with a valid DEVIN_API_KEY and confirm it lists orgs, connections, and members
  • Run ./scripts/provision-workshop.sh --config configs/dc-april-2026.json --org-id <mirror-org-id> --skip-sessions --skip-invites and confirm git permissions are set correctly
  • Review scripts/lib/manage-members.sh invite flow — the two-step enterprise invite + org assignment matches v3 API behavior but has not been tested against a live invite (no test emails available)
  • Review cleanup scripts (sanitize-pr-pii.sh, close-old-prs.sh, delete-stale-branches.sh) — these use gh CLI and operate destructively. Verify with --dry-run first
  • Run ./scripts/mirror-github-org.sh <source> <target> --dry-run to confirm repo listing and filter logic

Recommended test plan: Run verify-auth.shprovision-workshop.sh --skip-sessions --skip-invites against the mirror org → cleanup-all.sh --dry-run against the mirror GitHub org. This validates the Devin API integration and GitHub CLI operations without side effects.

Notes

Key findings from live API testing:

  • max_cycle_acu_limit must be > 0 or sessions are immediately suspended (org_usage_limit_exceeded)
  • Git permissions are per-org even though the GitHub App connection is enterprise-wide
  • Replace (PUT) is idempotent for permissions — safer than incremental POST for reproducible provisioning
  • Participant invitation is two-step: enterprise invite → org assignment

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/15d32ff046664f089dafa7dca446bd6c
Requested by: @bsmitches


Open in Devin Review

Add complete operator toolkit for provisioning Devin Enterprise workshops:

- README.md: Full operator guide with architecture, workflow, and API findings
- scripts/verify-auth.sh: Verify API credentials and display enterprise state
- scripts/provision-workshop.sh: End-to-end provisioning (org + permissions + sessions)
- scripts/teardown-workshop.sh: Post-workshop cleanup
- scripts/lib/: Shared functions (common.sh, manage-org.sh, manage-repos.sh, invoke-setup.sh)
- scripts/examples/mirror-repos.sh: GitHub repo mirroring helper
- configs/: Template and DC April 2026 example config
- docs/api-reference-cheatsheet.md: v3 API quick reference

All scripts tested against the live Devin Enterprise API:
- Verified auth as enterprise service user (Devin-PW-Internal-Shared)
- Successfully created/deleted git permissions for mirror org
- Successfully created a Devin session via API with create_as_user_id
- Discovered ACU limit requirement (cycle limit must be > 0)
- Full provision workflow tested with --skip-sessions on existing org
@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

Without token auth in HTTPS URLs, git push --mirror fails silently.
Use x-access-token pattern for both clone and push operations.
devin-ai-integration[bot]

This comment was marked as resolved.

- Add participant invitation (manage-members.sh library + invite-participants.sh)
- Add mirror-github-org.sh with workflow stripping, include/exclude, config support
- Add post-workshop cleanup suite: sanitize-pr-pii.sh, close-old-prs.sh,
  delete-stale-branches.sh, cleanup-all.sh orchestrator
- Add PII enforcement CI workflow (.github/workflows/pr-pii-check.yml)
  and deploy-pr-pii-check.sh to roll it out across repos
- Update provision-workshop.sh to support --emails-file and --skip-invites
- Update config template with emails_file, enterprise_role_id, org_role_id
- Remove curl -f flag from common.sh to preserve API error response bodies
- Replace scripts/examples/mirror-repos.sh with scripts/mirror-github-org.sh
- Update README with comprehensive coverage of all scripts and workflow phases
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

- sanitize-pr-pii.sh: make sed pattern fully case-insensitive to match
  the grep -Pi detection, preventing silent PII leaks on unusual casings
- manage-members.sh: handle files without trailing newline so the last
  email is not silently dropped
devin-ai-integration[bot]

This comment was marked as resolved.

Remove the sed that deleted 'Requested by:' lines before the grep check,
which made the check ineffective for the most common PII format. The system
footers (Link to Devin session, devin-review-badge) are already stripped by
the preceding sed commands.
devin-ai-integration[bot]

This comment was marked as resolved.

Align the comment check with the PR body check by requiring the pattern
to appear at the start of a line, preventing false positives on legitimate
text like 'This fix was requested by: the product team'.
@DhrovS DhrovS merged commit efe3605 into main May 4, 2026
4 checks passed
@DhrovS DhrovS deleted the devin/1777767476-operator-guide-and-scripts branch May 5, 2026 17:53
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