Skip to content

feat(seer-infra-telemetry): Add GcpServiceAccount model for tracking per-org service accounts#120499

Merged
shashjar merged 3 commits into
masterfrom
shashjar/create-GcpServiceAccount-model-for-tracking-per-org-service-accounts
Jul 24, 2026
Merged

feat(seer-infra-telemetry): Add GcpServiceAccount model for tracking per-org service accounts#120499
shashjar merged 3 commits into
masterfrom
shashjar/create-GcpServiceAccount-model-for-tracking-per-org-service-accounts

Conversation

@shashjar

Copy link
Copy Markdown
Member

PR 3/4 for CW-1691

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

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 23, 2026
@shashjar
shashjar requested review from a team and wedamija July 23, 2026 19:09
@shashjar
shashjar marked this pull request as ready for review July 23, 2026 19:09
@shashjar
shashjar requested a review from a team as a code owner July 23, 2026 19:09
@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1145_add_gcp_service_account.py

for 1145_add_gcp_service_account in sentry

--
-- 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)

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.

Do we need an index here? Will we ever need to look things up by email?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread src/sentry/migrations/1146_add_gcp_service_account.py
@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/migrations/1146_add_gcp_service_account.py

for 1146_add_gcp_service_account in sentry

--
-- 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);

@shashjar
shashjar merged commit a7432eb into master Jul 24, 2026
86 of 87 checks passed
@shashjar
shashjar deleted the shashjar/create-GcpServiceAccount-model-for-tracking-per-org-service-accounts branch July 24, 2026 15:09
Christinarlong pushed a commit that referenced this pull request Jul 24, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants