Summary
Issue #9 proposed a migration workflow where repository owners grant admin permission to worlddrivenbot, enabling automated transfers. This approach doesn't work for personal repositories.
Problem Discovery
During testing with TooAngel/worlddriven-migration-test, we discovered a fundamental GitHub limitation:
Personal Repository Permission Levels
According to GitHub documentation:
A repository owned by a personal account has two permission levels: the repository owner and collaborators.
Collaborators can only receive write access - there is no way to grant admin access to a collaborator on a personal repository. The GitHub UI doesn't even show an option to change permission levels for collaborators on personal repos.
Why This Breaks the Original Plan
- Transfer API (
POST /repos/{owner}/{repo}/transfer) requires admin permission
- Personal repos can only grant write to collaborators
- Therefore: worlddrivenbot can never transfer a personal repository
This affects the majority of potential migrations, since most repositories that would join worlddriven are personal repos.
New Solution: GitHub App with Administration Permission
GitHub Apps can request Administration permission, which grants the ability to transfer repositories where the app is installed.
How It Works
- Create a new GitHub App:
worlddriven-migrate
- App requests only:
administration: write and metadata: read
- User installs the app on their repository (one click)
- App installation grants admin-equivalent access
- App can then transfer the repository via API
Why a Separate App?
The main worlddriven app should stay minimal to encourage adoption. Users might hesitate to install an app with Administration permission for regular PR voting. A separate migration app:
- Has minimal permissions (only what's needed for transfer)
- Is clearly labeled as one-time use
- Keeps the main app trustworthy
Proposed Migration Flow
┌─────────────────────────────────────────────────────────────────┐
│ 1. User creates PR adding repo to REPOSITORIES.md │
│ with Origin: owner/repo field │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 2. Community votes on PR (worlddriven voting system) │
│ Drift detection fails (expected - repo not in org yet) │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 3. PR reaches approval threshold │
│ Bot comments: "Please install worlddriven-migrate app" │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 4. User installs worlddriven-migrate on their repo │
│ (grants Administration permission via app installation) │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 5. App webhook triggers, verifies approved PR exists │
│ Transfers repo to worlddriven org via API │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ 6. App comments on PR, triggers CI re-run │
│ Drift detection passes, PR auto-merges │
└─────────────────────────────────────────────────────────────────┘
Implementation Tasks
1. Create GitHub App (manual, one-time)
2. Backend Implementation (worlddriven-core)
3. Documentation Updates
Technical Details
GitHub App Transfer API
With Administration permission, the app can call:
POST /repos/{owner}/{repo}/transfer
Authorization: Bearer <installation-token>
{
"new_owner": "worlddriven"
}
Reference: Permissions required for GitHub Apps confirms POST /repos/{owner}/{repo}/transfer requires administration: write.
Webhook Payload
When app is installed on a repo, GitHub sends installation_repositories event:
{
"action": "added",
"installation": { "id": 12345 },
"repositories_added": [
{ "full_name": "owner/repo" }
]
}
Open Questions
- What defines "approved"? - Voting threshold reached? Has approving reviews? Time-based?
- Should we verify PR author = repo owner? - Prevent adding someone else's repo
- Auto-uninstall after transfer? - Clean up or leave to user?
- Fallback for org-owned repos? - They CAN grant admin to collaborators, support both paths?
References
Related Issues
Summary
Issue #9 proposed a migration workflow where repository owners grant admin permission to
worlddrivenbot, enabling automated transfers. This approach doesn't work for personal repositories.Problem Discovery
During testing with
TooAngel/worlddriven-migration-test, we discovered a fundamental GitHub limitation:Personal Repository Permission Levels
According to GitHub documentation:
Collaborators can only receive write access - there is no way to grant admin access to a collaborator on a personal repository. The GitHub UI doesn't even show an option to change permission levels for collaborators on personal repos.
Why This Breaks the Original Plan
POST /repos/{owner}/{repo}/transfer) requires admin permissionThis affects the majority of potential migrations, since most repositories that would join worlddriven are personal repos.
New Solution: GitHub App with Administration Permission
GitHub Apps can request Administration permission, which grants the ability to transfer repositories where the app is installed.
How It Works
worlddriven-migrateadministration: writeandmetadata: readWhy a Separate App?
The main
worlddrivenapp should stay minimal to encourage adoption. Users might hesitate to install an app with Administration permission for regular PR voting. A separate migration app:Proposed Migration Flow
Implementation Tasks
1. Create GitHub App (manual, one-time)
worlddriven-migrateapp in worlddriven orgadministration: write,metadata: readinstallation_repositorieshttps://www.worlddriven.org/api/webhooks/migrate2. Backend Implementation (worlddriven-core)
/api/webhooks/migratefindApprovedMigrationPR(repoFullName)- find PR in documentation repotransferRepository(repoFullName, installationId)- call transfer APItriggerPRChecks(prNumber)- re-run CI after transfer3. Documentation Updates
Technical Details
GitHub App Transfer API
With Administration permission, the app can call:
Reference: Permissions required for GitHub Apps confirms
POST /repos/{owner}/{repo}/transferrequiresadministration: write.Webhook Payload
When app is installed on a repo, GitHub sends
installation_repositoriesevent:{ "action": "added", "installation": { "id": 12345 }, "repositories_added": [ { "full_name": "owner/repo" } ] }Open Questions
References
Related Issues