Skip to content

Add org-wide cleanup scripts and comprehensive operator guide for workshop mirroring and Devin Enterprise management#2

Closed
devin-ai-integration[bot] wants to merge 12 commits into
mainfrom
devin/1777069111-org-cleanup-scripts
Closed

Add org-wide cleanup scripts and comprehensive operator guide for workshop mirroring and Devin Enterprise management#2
devin-ai-integration[bot] wants to merge 12 commits into
mainfrom
devin/1777069111-org-cleanup-scripts

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented Apr 24, 2026

Summary

Transforms the operator repo into a complete guide for cloning and running Cognition Partner Workshops in your own GitHub org and Devin Enterprise.

New scripts (6):

  • mirror-github-org.sh — Mirror repos between GitHub orgs (filtering, dry-run, workflow stripping)
  • setup-devin-org.sh — Create a Devin Enterprise org per event via /v3 API
  • manage-event-lifecycle.sh — Full lifecycle: create (org + git access + invites), status, teardown
  • setup-repos-on-devin.sh — Trigger Devin sessions to install deps and capture env configs
  • invite-participants.sh — Batch-invite users with role assignment
  • deploy-pr-pii-check.sh — Deploy PII check workflow to all repos in an org

Cleanup scripts (4): sanitize-pr-pii.sh, delete-stale-branches.sh, close-old-prs.sh, cleanup-all.sh

PR enforcement: .github/workflows/pr-pii-check.yml — CI check that fails if PRs contain "Requested by" PII. Strips system-appended metadata footer to avoid false positives.

Documentation (6 guides): Mirroring, Devin Enterprise setup, event lifecycle, workshop content composition, participant management, PR PII enforcement.

README rewrite: Quick start, architecture diagram, prerequisites, API reference, script reference tables.

Review & Testing Checklist for Human

  • Run mirror-github-org.sh with --dry-run against a small test org to verify repo listing and filtering
  • Run manage-event-lifecycle.sh create with a test event using your DEVIN_API_KEY and git-connection-id
  • Create a test PR with a "Requested by: test" line in the description and confirm the PII check fails CI
  • After merging, enable branch protection or an org ruleset requiring the "Check for PII in PR" status check (see docs/06-pr-pii-enforcement.md)
  • Verify docs match your Devin Enterprise setup (API URL, role names, git connection IDs)

Notes

  • All scripts use the Devin /v3 API (https://api.devin.ai). For custom enterprise domains, pass --api-url=https://api.your-company.devinenterprise.com.
  • The PII check workflow strips the auto-appended Devin footer (session link, requester, review badge) so it only flags user-authored PII. The sanitize-pr-pii.sh script handles cleanup of the footer on existing PRs.

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


Open in Devin Review

…ion, and old PR closure

Scripts:
- sanitize-pr-pii.sh: Remove 'Requested by' PII from PR descriptions and comments
- delete-stale-branches.sh: Delete branches with no commits in N weeks (default 3)
- close-old-prs.sh: Close open PRs older than N weeks (default 3)
- cleanup-all.sh: Run all three in sequence

All scripts are parameterized for any GitHub org and support --dry-run mode.

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
@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.

- Use [[:space:]]+ in sed patterns to handle multi-space/tab between
  'Requested' and 'by' (matches what has_pii detects with \s+)
- Narrow has_pii to only match @username and email patterns inline,
  since standalone full lines are already deleted by sed #1 regardless
  of format. Prevents false-success on plain-name inline patterns.

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits April 24, 2026 22:34
has_pii used grep -Pi (case-insensitive) while sanitize_text sed patterns
only handle [Rr]equested [Bb]y. Removing -i aligns detection scope with
cleaning scope, preventing false-success on unusual casings like
REQUESTED BY.

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
…event lifecycle, workshop content, participant management

- mirror-github-org.sh: Mirror all repos between GitHub orgs with filtering
- setup-devin-org.sh: Create/configure a Devin org per event via /v3 API
- manage-event-lifecycle.sh: Full lifecycle management (create/status/teardown)
- setup-repos-on-devin.sh: Trigger Devin sessions to set up repos
- invite-participants.sh: Invite users to Devin Enterprise org
- docs/01-05: Step-by-step guides for the complete workflow
- README.md: Rewritten as comprehensive operator guide

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
@devin-ai-integration devin-ai-integration Bot changed the title Add org-wide cleanup scripts for PII sanitization, stale branch deletion, and old PR closure Add org-wide cleanup scripts and comprehensive operator guide for workshop mirroring and Devin Enterprise management Apr 25, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

…8601 for torn_down_at

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 6 commits April 25, 2026 15:57
…, strip workflows from all branches

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
…uide

- .github/workflows/pr-pii-check.yml: GitHub Actions workflow that fails
  if PR descriptions or comments contain 'Requested by' PII patterns
- scripts/deploy-pr-pii-check.sh: Deploy the workflow to all repos in an org
- docs/06-pr-pii-enforcement.md: Guide for CI checks, branch protection,
  and org-level rulesets

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
The Devin system auto-appends 'Requested by: @user' to PR descriptions.
Strip the footer (session link, requester, review badge) before checking
so only user-authored PII triggers a failure.

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
- Remove 'edited' trigger to avoid race with system re-appending metadata
- Remove 'issue_comment' trigger (redundant with review comments)
- Add \r stripping for Windows-style line endings
- Use printf instead of echo for special character safety
- Add explicit 'Requested by:' line removal as belt-and-suspenders

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
The grep pattern now anchors to ^ so inline references like
'"Requested by" PII' in documentation don't trigger false positives.
Only actual PII lines (starting with 'Requested by:') are flagged.

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

- sanitize-pr-pii.sh: Add fourth sed to strip inline plain-name PII
  so sanitize_text scope matches has_pii detection scope
- mirror-github-org.sh: Restore HEAD to default_branch after workflow
  stripping loop so bare clone inherits the correct default branch
- mirror-github-org.sh + deploy-pr-pii-check.sh: Accumulate multiple
  --include/--exclude flags via pipe-delimited patterns instead of
  silently overwriting with the last value

Co-Authored-By: Brian Smitches <smitheitches@gmail.com>
@bsmitches bsmitches closed this May 5, 2026
@DhrovS DhrovS deleted the devin/1777069111-org-cleanup-scripts branch May 5, 2026 17:55
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.

1 participant