Skip to content

refactor: move the github identity of users to profiles - #1156

Draft
mnapoli wants to merge 1 commit into
productionfrom
feat/profiles
Draft

mnapoli wants to merge 1 commit into
productionfrom
feat/profiles

Conversation

@mnapoli

@mnapoli mnapoli commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Groundwork for org pages (#938). A user's GitHub identity moves to a new Profile model, which mirrors what GitHub's GraphQL calls a ProfileOwner: an account with a profile page, user or organization. Orgs can then get a profile later without being users.

No user-visible change intended.

Changes

  • New profiles table: type, github_id, handle, name, avatar_url, bio, location, website, github_synced_at.
  • Users keep github_id (it never changes) and find their profile by it. company stays on users, since only GitHub users have one.
  • $user->handle, $user->name, etc. still read from the user, through the profile, which always comes eager-loaded. Writing them on a user throws: they change on $user->profile.
  • The username is now called handle in code, routes (@{user:handle}), frontend types and tests. API responses send both handle and username for older clients.
  • The old columns on users stay, nullable and unused, so the code still running during the deploy keeps working. The follow-up PR drops them.
  • Account deletion deletes the profile. The export moves to schema_version 3 (username → handle).
  • Local sign-in moves to a CreateLocalUser action.

New columns, per the data guidelines:

  • Why: the GitHub identity shown for a user (and later an org), moved off users, not added. type tells users from organizations.
  • Who sees them: everyone, as before. github_id, type and github_synced_at are not serialized.
  • When deleted: with the user's account, in DeleteUser.

Limitations

  • Deploy window: users signed up by the old code while the deploy switches over have no profile, and pages showing them error until the copy runs again. The stacked follow-up PR is the fix: it runs the copy first, so merge it right after this one is fully live.
  • One more query: loading users now runs one more query for their profiles.
  • Route binding: binding a user by handle works on plain and parent-scoped routes. A scoped child binding through a relation (none today) would need a qualified field.

Summary by CodeRabbit

  • New Features
    • GitHub accounts now have dedicated profiles, with handles used as the primary account identifier across profile pages, search, mentions, conversations, and organization membership.
    • Local sign-in now accepts a handle.
    • Exports use schema version 3 and include handles in profile and user references.
  • Updates
    • API responses include handles while retaining username fields for compatibility with older clients.
    • User profile information is maintained separately from account records.

A profile mirrors a GitHub account at its @handle, as GitHub's ProfileOwner,
so organizations can get one later. Users keep their GitHub ID, which never
changes, and find their profile by it. The handle, name, avatar, bio,
location and website live on the profile, and the code calls the username a
handle. The API sends both handle and username for older clients.

The old columns on users stay unused and nullable until a follow-up drops
them, so the code running during the deploy keeps working.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@mnapoli
mnapoli marked this pull request as draft October 25, 2026 21:43
@mnapoli
mnapoli added this pull request to stack #1158 October 25, 2026 21:48
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