-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ref(workflow_engine): Updates to the data models #80710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #80710 +/- ##
==========================================
+ Coverage 78.48% 80.35% +1.87%
==========================================
Files 7215 7217 +2
Lines 319812 319880 +68
Branches 44045 20741 -23304
==========================================
+ Hits 251012 257055 +6043
- Misses 62411 62433 +22
+ Partials 6389 392 -5997 |
6feb564 to
b24e4cb
Compare
|
🚨 Warning: This pull request contains Frontend and Backend changes! It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently. Have questions? Please ask in the |
51a40df to
17678ff
Compare
fac967d to
9dda872
Compare
|
This PR has a migration; here is the generated SQL for --
-- Add field config to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "config" jsonb DEFAULT '{}'::jsonb NULL;
ALTER TABLE "workflow_engine_detector" ALTER COLUMN "config" DROP DEFAULT;
--
-- Add field created_by to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "created_by" bigint NULL;
--
-- Add field description to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "description" text NULL;
--
-- Custom state/database change combination
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "enabled" boolean NOT NULL DEFAULT true;
--
-- Add field project to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "project_id" bigint NULL;
--
-- Add field config to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "config" jsonb DEFAULT '{}'::jsonb NULL;
ALTER TABLE "workflow_engine_workflow" ALTER COLUMN "config" DROP DEFAULT;
--
-- Add field created_by to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "created_by" bigint NULL;
--
-- Custom state/database change combination
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "enabled" boolean NOT NULL DEFAULT true;
--
-- Add field environment to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "environment_id" bigint NULL;
--
-- Add field owner_team to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "owner_team_id" bigint NULL;
--
-- Add field owner_user_id to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "owner_user_id" bigint NULL;
--
-- Alter field required on action
--
ALTER TABLE "workflow_engine_action" ALTER COLUMN "required" DROP NOT NULL;
--
-- Alter field organization on detector
--
SET CONSTRAINTS "workflow_engine_dete_organization_id_411c3ae7_fk_sentry_or" IMMEDIATE; ALTER TABLE "workflow_engine_detector" DROP CONSTRAINT "workflow_engine_dete_organization_id_411c3ae7_fk_sentry_or";
ALTER TABLE "workflow_engine_detector" ALTER COLUMN "organization_id" DROP NOT NULL;
ALTER TABLE "workflow_engine_detector" ADD CONSTRAINT "workflow_engine_dete_organization_id_411c3ae7_fk_sentry_or" FOREIGN KEY ("organization_id") REFERENCES "sentry_organization" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_detector" VALIDATE CONSTRAINT "workflow_engine_dete_organization_id_411c3ae7_fk_sentry_or";
CREATE INDEX CONCURRENTLY "workflow_engine_detector_created_by_9ec3075e" ON "workflow_engine_detector" ("created_by");
ALTER TABLE "workflow_engine_detector" ADD CONSTRAINT "workflow_engine_dete_project_id_275be9df_fk_sentry_pr" FOREIGN KEY ("project_id") REFERENCES "sentry_project" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_detector" VALIDATE CONSTRAINT "workflow_engine_dete_project_id_275be9df_fk_sentry_pr";
CREATE INDEX CONCURRENTLY "workflow_engine_detector_project_id_275be9df" ON "workflow_engine_detector" ("project_id");
CREATE INDEX CONCURRENTLY "workflow_engine_workflow_created_by_a98158f7" ON "workflow_engine_workflow" ("created_by");
CREATE INDEX CONCURRENTLY "workflow_engine_workflow_environment_id_905d91b4" ON "workflow_engine_workflow" ("environment_id");
ALTER TABLE "workflow_engine_workflow" ADD CONSTRAINT "workflow_engine_work_owner_team_id_c401e7b8_fk_sentry_te" FOREIGN KEY ("owner_team_id") REFERENCES "sentry_team" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_workflow" VALIDATE CONSTRAINT "workflow_engine_work_owner_team_id_c401e7b8_fk_sentry_te";
CREATE INDEX CONCURRENTLY "workflow_engine_workflow_owner_team_id_c401e7b8" ON "workflow_engine_workflow" ("owner_team_id");
CREATE INDEX CONCURRENTLY "workflow_engine_workflow_owner_user_id_1ef7b270" ON "workflow_engine_workflow" ("owner_user_id"); |
49b13e6 to
2cd8967
Compare
4196caf to
aaca8de
Compare
aaca8de to
9790019
Compare
src/sentry/workflow_engine/migrations/0013_aci_model_updates_from_milestones.py
Outdated
Show resolved
Hide resolved
src/sentry/workflow_engine/migrations/0013_aci_model_updates_from_milestones.py
Outdated
Show resolved
Hide resolved
Bundle ReportChanges will increase total bundle size by 700 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
946517f to
7f4c7b2
Compare
e1419e0 to
54245f9
Compare
cd753c8 to
fb4869f
Compare
| from jsonschema import ValidationError, validate | ||
|
|
||
|
|
||
| class JSONConfigBase(models.Model): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had added tests for this here: 8abfecc - but removed them cause it was causing a bunch of other failures. any recommendations on how to fix these?
src/sentry/workflow_engine/migrations/0014_aci_model_updates_from_milestones.py
Outdated
Show resolved
Hide resolved
src/sentry/workflow_engine/migrations/0014_aci_model_updates_from_milestones.py
Outdated
Show resolved
Hide resolved
…ust trying a thing for CI since i can't reproduce it locally
8abfecc to
f9fc70c
Compare
|
This PR has a migration; here is the generated SQL for --
-- Add field config to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "config" jsonb DEFAULT '{}'::jsonb NOT NULL;
--
-- Add field created_by_id to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "created_by_id" bigint NULL;
--
-- Add field description to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "description" text NULL;
--
-- Add field enabled to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "enabled" boolean DEFAULT true NOT NULL;
--
-- Add field project to detector
--
ALTER TABLE "workflow_engine_detector" ADD COLUMN "project_id" bigint NULL;
--
-- Add field config to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "config" jsonb DEFAULT '{}'::jsonb NOT NULL;
--
-- Add field created_by_id to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "created_by_id" bigint NULL;
--
-- Add field enabled to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "enabled" boolean DEFAULT true NOT NULL;
--
-- Add field environment to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "environment_id" bigint NULL;
--
-- Add field owner_team to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "owner_team_id" bigint NULL;
--
-- Add field owner_user_id to workflow
--
ALTER TABLE "workflow_engine_workflow" ADD COLUMN "owner_user_id" bigint NULL;
--
-- Alter field required on action
--
ALTER TABLE "workflow_engine_action" ALTER COLUMN "required" DROP NOT NULL;
--
-- Alter field organization on detector
--
SET CONSTRAINTS "workflow_engine_dete_organization_id_411c3ae7_fk_sentry_or" IMMEDIATE; ALTER TABLE "workflow_engine_detector" DROP CONSTRAINT "workflow_engine_dete_organization_id_411c3ae7_fk_sentry_or";
ALTER TABLE "workflow_engine_detector" ALTER COLUMN "organization_id" DROP NOT NULL;
ALTER TABLE "workflow_engine_detector" ADD CONSTRAINT "workflow_engine_dete_organization_id_411c3ae7_fk_sentry_or" FOREIGN KEY ("organization_id") REFERENCES "sentry_organization" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_detector" VALIDATE CONSTRAINT "workflow_engine_dete_organization_id_411c3ae7_fk_sentry_or";
--
-- Alter field when_condition_group on workflow
--
-- (no-op)
CREATE INDEX CONCURRENTLY "workflow_engine_detector_created_by_id_311a9ce7" ON "workflow_engine_detector" ("created_by_id");
ALTER TABLE "workflow_engine_detector" ADD CONSTRAINT "workflow_engine_dete_project_id_275be9df_fk_sentry_pr" FOREIGN KEY ("project_id") REFERENCES "sentry_project" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_detector" VALIDATE CONSTRAINT "workflow_engine_dete_project_id_275be9df_fk_sentry_pr";
CREATE INDEX CONCURRENTLY "workflow_engine_detector_project_id_275be9df" ON "workflow_engine_detector" ("project_id");
CREATE INDEX CONCURRENTLY "workflow_engine_workflow_created_by_id_84c30bc9" ON "workflow_engine_workflow" ("created_by_id");
ALTER TABLE "workflow_engine_workflow" ADD CONSTRAINT "workflow_engine_work_environment_id_905d91b4_fk_sentry_en" FOREIGN KEY ("environment_id") REFERENCES "sentry_environment" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_workflow" VALIDATE CONSTRAINT "workflow_engine_work_environment_id_905d91b4_fk_sentry_en";
CREATE INDEX CONCURRENTLY "workflow_engine_workflow_environment_id_905d91b4" ON "workflow_engine_workflow" ("environment_id");
ALTER TABLE "workflow_engine_workflow" ADD CONSTRAINT "workflow_engine_work_owner_team_id_c401e7b8_fk_sentry_te" FOREIGN KEY ("owner_team_id") REFERENCES "sentry_team" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_workflow" VALIDATE CONSTRAINT "workflow_engine_work_owner_team_id_c401e7b8_fk_sentry_te";
CREATE INDEX CONCURRENTLY "workflow_engine_workflow_owner_team_id_c401e7b8" ON "workflow_engine_workflow" ("owner_team_id");
CREATE INDEX CONCURRENTLY "workflow_engine_workflow_owner_user_id_1ef7b270" ON "workflow_engine_workflow" ("owner_user_id"); |
## Description As we continue to spec out the migrations for issue alerts / metric alerts, we found a few more data model changes. --------- Co-authored-by: Cathy Teng <cathy.teng@sentry.io>
## Description As we continue to spec out the migrations for issue alerts / metric alerts, we found a few more data model changes. --------- Co-authored-by: Cathy Teng <cathy.teng@sentry.io>
## Description As we continue to spec out the migrations for issue alerts / metric alerts, we found a few more data model changes. --------- Co-authored-by: Cathy Teng <cathy.teng@sentry.io>
## Description As we continue to spec out the migrations for issue alerts / metric alerts, we found a few more data model changes. --------- Co-authored-by: Cathy Teng <cathy.teng@sentry.io>
Description
As we continue to spec out the migrations for issue alerts / metric alerts, we found a few more data model changes.