Skip to content

feat(aci): add WorkflowActionGroupStatus take two #92478

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

Merged
merged 5 commits into from
May 30, 2025

Conversation

cathteng
Copy link
Member

The previous attempt (#91993) couldn't acquire the lock before 5pm so I reverted it. We try again

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 29, 2025
Copy link
Contributor

github-actions bot commented May 29, 2025

This PR has a migration; here is the generated SQL for src/sentry/workflow_engine/migrations/0066_workflow_action_group_status_table.py

for 0066_workflow_action_group_status_table in workflow_engine

--
-- Raw SQL operation
--
DROP TABLE IF EXISTS workflow_engine_workflowactiongroupstatus;
--
-- Create model WorkflowActionGroupStatus
--
CREATE TABLE "workflow_engine_workflowactiongroupstatus" ("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, "action_id" bigint NOT NULL, "group_id" bigint NOT NULL, "workflow_id" bigint NOT NULL, CONSTRAINT "workflow_engine_uniq_workflow_action_group" UNIQUE ("workflow_id", "action_id", "group_id"));
ALTER TABLE "workflow_engine_workflowactiongroupstatus" ADD CONSTRAINT "workflow_engine_work_action_id_b4d629d5_fk_workflow_" FOREIGN KEY ("action_id") REFERENCES "workflow_engine_action" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_workflowactiongroupstatus" VALIDATE CONSTRAINT "workflow_engine_work_action_id_b4d629d5_fk_workflow_";
ALTER TABLE "workflow_engine_workflowactiongroupstatus" ADD CONSTRAINT "workflow_engine_work_workflow_id_8110df1d_fk_workflow_" FOREIGN KEY ("workflow_id") REFERENCES "workflow_engine_workflow" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_workflowactiongroupstatus" VALIDATE CONSTRAINT "workflow_engine_work_workflow_id_8110df1d_fk_workflow_";
CREATE INDEX CONCURRENTLY "workflow_engine_workflowactiongroupstatus_action_id_b4d629d5" ON "workflow_engine_workflowactiongroupstatus" ("action_id");
CREATE INDEX CONCURRENTLY "workflow_engine_workflowactiongroupstatus_group_id_89305015" ON "workflow_engine_workflowactiongroupstatus" ("group_id");
CREATE INDEX CONCURRENTLY "workflow_engine_workflowactiongroupstatus_workflow_id_8110df1d" ON "workflow_engine_workflowactiongroupstatus" ("workflow_id");

@cathteng cathteng marked this pull request as ready for review May 29, 2025 16:19
@cathteng cathteng requested review from a team as code owners May 29, 2025 16:19
@cathteng cathteng requested a review from wedamija May 29, 2025 17:32
Copy link
Member

@wedamija wedamija left a comment

Choose a reason for hiding this comment

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

This is going to be a bit painful, because actually the migation fully succeeded on S4S and DE, and partially succeeded on US (the table is created, which you can see in redash).

I think what we should do here is add a SafeRunSQL operation before the CreateModel that does a DROP TABLE IF EXISTS workflow_engine_workflowactiongroupstatus; (include a comment about why we have it there)

As well as this, I think that for the FK to group, we should set db_constraint=False, and have a follow-up post_deploy migration that sets db_constraint=True. That way we can run it out of the deploy and then we don't need to worry about blocking anything.

Copy link

codecov bot commented May 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #92478      +/-   ##
==========================================
+ Coverage   82.94%   87.89%   +4.95%     
==========================================
  Files       10231    10234       +3     
  Lines      586224   586661     +437     
  Branches    22771    22771              
==========================================
+ Hits       486230   515671   +29441     
+ Misses      99564    70560   -29004     
  Partials      430      430              

@cathteng cathteng merged commit d70a26f into master May 30, 2025
61 checks passed
@cathteng cathteng deleted the cathy/aci/workflow-action-group-status branch May 30, 2025 16:07
@github-actions github-actions bot locked and limited conversation to collaborators Jun 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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