feat(seer-infra-telemetry): Add GcpServiceAccount model for tracking per-org service accounts#120499
Conversation
|
This PR has a migration; here is the generated SQL for for --
-- Create model GcpServiceAccount
--
CREATE TABLE "sentry_gcpserviceaccount" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "date_updated" timestamp with time zone NOT NULL, "date_added" timestamp with time zone NOT NULL, "organization_id" bigint NOT NULL UNIQUE, "service_account_email" varchar(255) NOT NULL); |
| __relocation_scope__ = RelocationScope.Excluded | ||
|
|
||
| organization_id = HybridCloudForeignKey("sentry.Organization", on_delete="CASCADE", unique=True) | ||
| service_account_email = models.CharField(max_length=255) |
There was a problem hiding this comment.
Do we need an index here? Will we ever need to look things up by email?
There was a problem hiding this comment.
hmm i don't think so. i think we would always be going from org -> SA, and any context in which we already have the SA the organization should be known as well
…r-tracking-per-org-service-accounts
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 bdd626c. Configure here.
|
This PR has a migration; here is the generated SQL for for --
-- Create model GcpServiceAccount
--
CREATE TABLE "sentry_gcpserviceaccount" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "date_updated" timestamp with time zone NOT NULL, "date_added" timestamp with time zone NOT NULL, "organization_id" bigint NOT NULL UNIQUE, "service_account_email" varchar(255) NOT NULL); |
…g per-org service accounts (#120499) PR 3/4 for [CW-1691](https://linear.app/getsentry/issue/CW-1691/set-up-sentry-connectors-gcp-project-per-customer-sa-creation-and) Adds a new `GcpServiceAccount` model to track GCP service accounts created in the `sentry-connectors` project for the GCP MCP org-level integration. Each Sentry org gets at most one SA, stored in this model so it can be reused across setup attempts and prevent orphaned SAs from accumulating as a result of abandoned integration flows. This PR is the model-creation migration only; the model will be used in the follow-up PR — #120266. https://app.notion.com/p/sentry/GCP-MCP-Org-Level-Integration-39f8b10e4b5d8030ba01cd62373641df

PR 3/4 for CW-1691
Adds a new
GcpServiceAccountmodel to track GCP service accounts created in thesentry-connectorsproject for the GCP MCP org-level integration. Each Sentry org gets at most one SA, stored in this model so it can be reused across setup attempts and prevent orphaned SAs from accumulating as a result of abandoned integration flows.This PR is the model-creation migration only; the model will be used in the follow-up PR — #120266.
https://app.notion.com/p/sentry/GCP-MCP-Org-Level-Integration-39f8b10e4b5d8030ba01cd62373641df