Repository navigation
feat(aci): Track service account and org token creators on workflows - #132450
Merged
Merged
Conversation
Add created_by_service_account_id and created_by_org_auth_token_id to Workflow, and record them from the workflow validator via get_creator_reference. Co-Authored-By: Dominik Buszowiecki <[email protected]>
sentry-junior
Bot
force-pushed
the
feat/workflow-non-user-creator
branch
from
November 25, 2026 15:05
97218e4 to
76afefc
Compare
sentry-junior
Bot
changed the base branch from
feat/workflow-engine-non-user-creator
to
master
November 25, 2026 15:07
Contributor
Sentry Snapshot Testing
|
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Add field created_by_org_auth_token_id to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "created_by_org_auth_token_id" bigint NULL;
--
-- Add field created_by_service_account_id to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "created_by_service_account_id" bigint NULL;
--
-- Create constraint workflow_engine_workflow_single_creator on model workflow
--
ALTER TABLE "workflow_engine_workflow" ADD CONSTRAINT "workflow_engine_workflow_single_creator" CHECK ((("created_by_service_account_id" IS NULL AND "created_by_org_auth_token_id" IS NULL) OR ("created_by_id" IS NULL AND "created_by_org_auth_token_id" IS NULL) OR ("created_by_id" IS NULL AND "created_by_service_account_id" IS NULL))) NOT VALID;
ALTER TABLE "workflow_engine_workflow" VALIDATE CONSTRAINT "workflow_engine_workflow_single_creator";
CREATE INDEX CONCURRENTLY "workflow_engine_workflow_created_by_org_auth_token_id_fb9da085" ON "workflow_engine_workflow" ("created_by_org_auth_token_id");
CREATE INDEX CONCURRENTLY "workflow_engine_workflow_created_by_service_account_id_738c24e3" ON "workflow_engine_workflow" ("created_by_service_account_id"); |
edwardgou-sentry
approved these changes
Nov 25, 2026
DominikB2014
added a commit
that referenced
this pull request
Nov 25, 2026
…129550) This adds service account and org auth tokens, so we can track whos created resources. Eventually this will help serve optional guardrails that will allow creators to modify/delete their own resources but not others. ## Generated description Detectors only recorded a user creator, so ones created by service accounts or org auth tokens had no author. - Add `created_by_service_account_id` / `created_by_org_auth_token_id` to `Detector`, with an at-most-one-creator check constraint (same as #129219 for dashboards). - The detector validator uses `get_creator_reference(request)`. The legacy `/monitors/` (`ensure_cron_detector`) and legacy uptime (`create_uptime_detector`) create paths now record the creator too. Workflows are in #132450. The two PRs are independent, but both add the next `workflow_engine` migration, so whichever merges second needs its migration renumbered. Fixes ENG-8937 <!-- junior-request-attribution:start --> via @DominikB2014. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0CLH9SJT1N%3A1795553613.104619 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AC0CLH9SJT1N%3A1795553613.104619) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0CLH9SJT1N%3A1795553613.104619/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-Authored-By: Dominik Buszowiecki <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds service account and org auth token ids, so we can track who created resources. Eventually this will help serve optional guardrails that will allow creators to modify/delete their own resources but not others.
Workflows only recorded a user creator, so ones created by service accounts or org auth tokens had no author.
created_by_service_account_id/created_by_org_auth_token_idtoWorkflow, with an at-most-one-creator check constraint (same as feat(dashboards): Track service account and org token creators #129219 for dashboards).get_creator_reference(request).The detector side landed in #129550.
Refs ENG-8937
via @DominikB2014.
--
View Session [Sentry]