feat(github): seed org membership via orgs[].members - #206
Open
yonatangross wants to merge 1 commit into
Open
Conversation
Add an optional `members` array to `github.orgs[]` seed entries
(`{ login, role?: "admin" | "member" }`). Membership is written as the
synthetic "members" team, the same representation
`PUT /orgs/:org/memberships/:username` produces at runtime, so an
`admin` is a maintainer of that team and every org-role check already
in the routes applies unchanged.
Why: a seeded org has no members and no admin. Every private repo owned
by it is therefore unreachable by every seeded user token (403), and
nothing at runtime can repair that because the membership endpoint
itself requires an org admin. Seeding one admin closes the loop.
Unknown member logins throw at seed time (they must be seeded users),
matching the existing strict seed validation for apps.
Contributor
|
@yonatangross is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
membersarray togithub.orgs[]seed entries:{ login, role?: "admin" | "member" }membersteam, the same representationPUT /orgs/:org/memberships/:usernamewrites at runtime, soadmin= maintainer of that team and every existing org-role check applies unchangedusers), matching the strict seed validation added for apps in 0.10.0Why
A seeded org has no members and no admin. Every private repo it owns is therefore unreachable by every seeded user token (403), and nothing at runtime can repair that: the membership endpoint itself requires an org admin. Seeding one admin closes the loop. Hit this in Yonatan-HQ/platform when moving the seed from a user owner to the real org owner.
Changes
index.tsmembers?on theorgs[]seed type;seedOrgMembers()(team-backed, idempotent per login)__tests__/org-members.test.tsREADME.md,skills/github/SKILL.mdTest plan
pnpm --filter @emulators/github test(5 files pass, incl. the 4 new cases)pnpm -r buildpnpm --filter @emulators/github lint(0 errors, no new warnings)