Skip to content

app/: memberships follow the forge on sign-in (sc-8900) - #56

Merged
ndbroadbent merged 4 commits into
mainfrom
laravel-memberships
Dec 2, 2026
Merged

ndbroadbent merged 4 commits into
mainfrom
laravel-memberships

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

Stacked on #54 (the data baseline). It ports today's access::after_sign_in and memberships::apply_forge as a listener for sign-in's SignedIn event.

  • The person's permissions on the repositories the forge reports decide their memberships in the organizations whose projects link those repositories. The highest permission across an organization's linked repositories becomes their role: admin or maintain → admin, write → member, triage or read → read.
  • Only memberships the forge granted (source github or gitlab) change or go. One from an invitation, made at sign-up or added by staff stays as it is.
  • An organization whose projects of this forge are on another site (a self-managed GitLab against gitlab.com) keeps the memberships that site decides, as today.
  • MembershipChanged { organization_id, user_id, role } fires for each change, for the member's notice (the emails port).

Test (app/tests/memberships.rs): the highest permission wins, an invited membership stays, and a later sign-in changes or removes only the forge's memberships. All app tests pass, and clippy is clean.

@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #315 · 331 unchanged · no changes

This PR vs base: 2 changed since #194, across 5 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

…ts access::after_sign_in and memberships::apply_forge (highest permission across an organization's linked repositories becomes the role; only the forge's own memberships change or go; another site's organizations stay); MembershipChanged for the member's notice
… URL on any other instance, as sign-in's identities now say (only gitlab.com's addresses are trusted), so VISUALCI_GITLAB_URL no longer decides it
…ver the URL (a renamed repository's old URL can be taken by someone else's new one), and a link without an ID grants nothing until it's backfilled; only repositories the forge lists as explicitly accessible grant anything (never a public repository's read for everyone); apply runs in one transaction with the person's memberships locked, and the notices go after the commit; tested
@ndbroadbent
ndbroadbent merged commit 86ae1f7 into main Dec 2, 2026
11 checks passed
@ndbroadbent
ndbroadbent deleted the laravel-memberships branch December 2, 2026 16:06
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