Repository navigation
feat(aci): Track service account and org token creators on workflows - #130482
Merged
DominikB2014 merged 2 commits intoNov 17, 2026
Merged
DominikB2014 merged 2 commits into
DominikB2014 merged 2 commits into
Conversation
Add created_by_service_account_id / created_by_org_auth_token_id to Workflow with an at-most-one-creator check constraint, and record the creator from the workflow validator.
Contributor
Sentry Snapshot Testing
|
…ow-non-user-creator # Conflicts: # migrations_lockfile.txt
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Add field created_by_org_auth_token_id to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "created_by_org_auth_token_id" bigint NULL;
--
-- Add field created_by_service_account_id to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "created_by_service_account_id" bigint NULL;
--
-- Create constraint workflow_engine_detector_single_creator on model detector
--
ALTER TABLE "workflow_engine_detector" ADD CONSTRAINT "workflow_engine_detector_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_detector" VALIDATE CONSTRAINT "workflow_engine_detector_single_creator";
CREATE INDEX CONCURRENTLY "workflow_engine_detector_created_by_org_auth_token_id_14fce493" ON "workflow_engine_detector" ("created_by_org_auth_token_id");
CREATE INDEX CONCURRENTLY "workflow_engine_detector_created_by_service_account_id_8ac26027" ON "workflow_engine_detector" ("created_by_service_account_id");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"); |
DominikB2014
marked this pull request as draft
November 12, 2026 17:57
DominikB2014
marked this pull request as ready for review
November 16, 2026 17:14
gricha
approved these changes
Nov 17, 2026
DominikB2014
merged commit Nov 17, 2026
9f9a90f
into
feat/workflow-engine-non-user-creator
88 of 89 checks passed
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.
Stacked on #129550 (detectors).
This adds service account and org auth tokens ids, 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
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).Refs ENG-8937