chore(codecov): Remove OrganizationMapping codecov_access replication#116754
Conversation
|
This PR has a migration; here is the generated SQL for for --
-- Moved organizationmapping.codecov_access field to pending deletion state
--
-- (no-op) |
vgrozdanic
left a comment
There was a problem hiding this comment.
looks good, hybrid cloud changes look safe too
9506a4d to
c2f1d3f
Compare
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 c2f1d3f3830ab5343b5b36e488c480e3ce3f58f7. Configure here.
|
This PR has a migration; here is the generated SQL for for --
-- Moved organizationmapping.codecov_access field to pending deletion state
--
-- (no-op) |
wedamija
left a comment
There was a problem hiding this comment.
lgtm other than the merge conflict
c2f1d3f to
f0dc6c6
Compare
|
This PR has a migration; here is the generated SQL for for --
-- Moved organizationmapping.codecov_access field to pending deletion state
--
-- (no-op) |
Phase 5a of the Codecov decommission: stop replicating the dead codecov_access flag to OrganizationMapping and retire the column from Django's model state. Removes the codecov_access field from RpcOrganizationMappingUpdate, the serialize/upsert paths in the organization_mapping service, and the column declaration on the OrganizationMapping model. Migration 1105 uses SafeRemoveField(MOVE_TO_PENDING): it drops the field from model state but keeps the database column, so app servers still running during the rolling deploy can continue to SELECT it. A follow-up migration drops the column once this is fully deployed. Organization.flags.codecov_access (the bitfield) is intentionally kept -- removing a bit slot would shift every subsequent flag. Likewise the matching RpcOrganizationMappingFlags.codecov_access + as_int() slot stay to preserve flag-packing order. The OIDC codecov.signing_secret path is out of scope. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
f0dc6c6 to
6e3afff
Compare
Backend Test FailuresFailures on
|
Follow-up to #116754 — actually drops the `codecov_access` column from the database (`SafeRemoveField` with `DeletionAction.DELETE`). The prior migration removed it from Django state only (`MOVE_TO_PENDING`). Doing this so the pending column removal doesn't block the migration squash I am about to do. Co-authored-by: Claude <noreply@anthropic.com>
Follow-up to #116754 — actually drops the `codecov_access` column from the database (`SafeRemoveField` with `DeletionAction.DELETE`). The prior migration removed it from Django state only (`MOVE_TO_PENDING`). Doing this so the pending column removal doesn't block the migration squash I am about to do. Co-authored-by: Claude <noreply@anthropic.com>

Phase 5a of the Codecov decommission — the data-model layer.
Stops replicating the now-dead
codecov_accessflag toOrganizationMappingand retires the column from Django's model state:codecov_accessfromRpcOrganizationMappingUpdateand the serialize/upsert paths in theorganization_mappingservice.codecov_accessfield from theOrganizationMappingmodel.1105usesSafeRemoveField(MOVE_TO_PENDING): drops the field from Django state only while keeping the DB column, so app servers still running during the rolling deploy can keepSELECTing it.The actual column drop is a deliberate follow-up (Phase 5b) —
SafeRemoveField(DELETE)— to be merged/deployed only after this is fully rolled out, per Sentry's two-step column-removal rule.Intentionally NOT removed
Organization.flags.codecov_access(the bitfield onOrganization) — cannot be removed. It's one bit packed into a singleflagsinteger; deleting the slot would shift every subsequent flag bit and corrupt unrelated live flags. It stays as a deprecated, unused bit (comment updated).RpcOrganizationMappingFlags.codecov_access+ itsas_int()slot — kept for the same reason (preserves flag-packing order); it just defaults toFalsenow and is no longer populated.codecov.signing_secretpath inoauth_token.py— separate feature, out of scope.Rolling-deploy safety
RpcModelignores unknown fields (pydantic default), so removingcodecov_accessfromRpcOrganizationMappingUpdateis safe across the region→control silo boundary in either deploy order.Verified: prek clean;
tests/sentry/hybridcloud/test_organizationmapping.py+tests/sentry/models/test_organization.pypass against a freshly-migrated DB (42 tests).