Skip to content

feat(hybrid): Allow Identity model to be used as HCFK - #105339

Merged
alexsohn1126 merged 18 commits into
masterfrom
alexsohn/feat/add-outbox-generation-for-Identity
Jan 9, 2026
Merged

alexsohn1126 merged 18 commits into
masterfrom
alexsohn/feat/add-outbox-generation-for-Identity

Conversation

@alexsohn1126

@alexsohn1126 alexsohn1126 commented Dec 19, 2025 •

Copy link
Copy Markdown
Member

Previously, cascade DELETE would not work if a model had a hybrid cloud foreign key (HCFK) on our Identity model.

This PR aims to allow the Identity model to be used as a HCFK.

This will allow the Console SDK GitHub invite model (pr: getsentry#19052) to be deleted if the identity is deleted.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Dec 19, 2025
@codecov

codecov Bot commented Dec 19, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                                     Coverage Diff                                      @@
##           alexsohn/feat/add-console-sdk-invite-constants-and-options   #105339   +/-   ##
============================================================================================
  Coverage                                                       80.60%    80.60%           
============================================================================================
  Files                                                            9437      9437           
  Lines                                                          404386    404402   +16     
  Branches                                                        25655     25655           
============================================================================================
+ Hits                                                           325944    325965   +21     
+ Misses                                                          77974     77969    -5     
  Partials                                                          468       468           

@alexsohn1126 alexsohn1126 changed the title WIP: Identity outbox thing feat(hybrid): Allow Identity model to be used as HCFK Jan 2, 2026
@alexsohn1126
alexsohn1126 marked this pull request as ready for review January 2, 2026 20:36
@alexsohn1126
alexsohn1126 requested a review from a team January 2, 2026 20:36
@alexsohn1126
alexsohn1126 requested a review from a team as a code owner January 2, 2026 20:36
@alexsohn1126
alexsohn1126 requested review from a team and leeandher January 2, 2026 20:36
Comment thread src/sentry/receivers/outbox/control.py Outdated
alexsohn1126 and others added 2 commits January 5, 2026 09:37
Comment thread src/sentry/users/models/identity.py

@markstory markstory left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. As identity records are deleted, outbox messages will be saved. Processing those outboxes will create tombstones in all regions to cascade the deletes.

Base automatically changed from alexsohn/feat/add-console-sdk-invite-constants-and-options to master January 8, 2026 21:21
@alexsohn1126
alexsohn1126 merged commit a8daaee into master Jan 9, 2026
66 checks passed
@alexsohn1126
alexsohn1126 deleted the alexsohn/feat/add-outbox-generation-for-Identity branch January 9, 2026 15:57
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 25, 2026

This branch was successfully deployed

1 active deployment
Preview — 48897a58 Deployed Jan 8, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants