feat(integrations): Dual-write SCM org-option toggles onto OrganizationIntegration config#113842
Conversation
f36eae8 to
49a8410
Compare
49a8410 to
4520898
Compare
4520898 to
369e90c
Compare
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 369e90c. Configure here.
|
This PR has a migration; here is the generated SQL for for --
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL |
…onIntegration config Phase 1 of VDY-110. The GitHub and GitLab PR-comment and missing-member toggles are moving from OrganizationOption onto OrganizationIntegration.config so each install is independently configurable. - OrganizationSerializer.save() now fans out writes to sentry:github_pr_bot, sentry:github_nudge_invite, and sentry:gitlab_pr_bot onto the corresponding per-integration config key (pr_comments / nudge_invite), scoped to active integrations. - The fan-out is deferred to transaction.on_commit so the RPC to the control silo happens outside the cell-silo write transaction. Reads still go through OrganizationOption; behavior is unchanged for users. The next phase flips the read path. Fixes: [VDY-111](https://linear.app/getsentry/issue/VDY-111/phase-1-dual-write-scm-settings-to-integration-config-backfill)
369e90c to
9474015
Compare
wedamija
left a comment
There was a problem hiding this comment.
lgtm. It'd be good to have claude put together an audit sql script that we can run after the backfill has finished to validate that these all synced as expected
|
Yeah that sounds good |
…zationIntegration config (#113841) Phase 1 of VDY-110. Adds post-deployment migration 1072 that seeds OrganizationIntegration.config.pr_comments and .nudge_invite from each org's current sentry:github_pr_bot / sentry:github_nudge_invite / sentry:gitlab_pr_bot OrganizationOption value, scoped to active GitHub and GitLab OIs. The migration is idempotent: it only writes keys that are not already present on the OI config, so it can be re-run safely and will not clobber anything seeded by later code. Lands after the dual-write so new installs are already mirroring before the backfill fills in the existing population. Ref: [VDY-110](https://linear.app/getsentry/issue/VDY-110/move-scm-integration-settings-from-org-options-to-per-integration) ## Migration phases - ○ Phase 1 — Dual-write SCM toggles: [#113842](#113842) - ○ Phase 1 — Backfill existing OIs: [#113841](#113841) _(This PR)_ - ○ Phase 2 — Read from OI config behind flag: [#113864](#113864) - ○ Phase 3 — UI move: upcoming - ○ Phase 4 — Remove legacy code paths: upcoming
The Phase 1 backfill (migration 1072) is routed to the control silo by the `sentry_organizationintegration` table hint, but the previous implementation read `sentry_organizationoptions` directly — that table lives on the region silo, so the migration blew up with `relation "sentry_organizationoptions" does not exist` when run against control in production. Swap the direct ORM read for `organization_service.get_option`, which is a cell RPC that dispatches to the region silo. Cache results per `(org_id, option_key)` since a single org may own multiple OIs and we'd otherwise issue the same RPC repeatedly. Ref: [VDY-111: Phase 1: Dual-write SCM settings to integration config + backfill](https://linear.app/getsentry/issue/VDY-111/phase-1-dual-write-scm-settings-to-integration-config-backfill) ## Migration phases - ○ Phase 1 — Dual-write SCM toggles: [#113842](#113842) - ● Phase 1 — Backfill existing OIs: [#113841](#113841) (merged; this PR fixes the cross-silo bug) - ○ Phase 2 — Read from OI config behind flag: [#113864](#113864) - ○ Phase 3 — UI move: upcoming - ○ Phase 4 — Remove legacy code paths: upcoming

Phase 1 of VDY-110. The GitHub and GitLab PR-comment and missing-member
toggles are moving from OrganizationOption onto OrganizationIntegration.config
so each install is independently configurable.
sentry:github_pr_bot, sentry:github_nudge_invite, and
sentry:gitlab_pr_bot onto the corresponding per-integration config
key (pr_comments / nudge_invite), scoped to active integrations.
control silo happens outside the cell-silo write transaction.
Reads still go through OrganizationOption; behavior is unchanged for
users. The next phase flips the read path.
Ref: VDY-111: Phase 1: Dual-write SCM settings to integration config + backfill
Migration phases