Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d-m5jbyn-exclusive-runs
…d-m5jbyn-exclusive-runs
Sentry Snapshot Testing
|
…d-m5jbyn-exclusive-runs
…d-m5jbyn-exclusive-runs
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4e58168. Configure here.
| status__in=ACTIVE_WORKFLOW_RUN_STATUSES, | ||
| ), | ||
| name="seer_nightshiftrun_one_active_exclusive_run", | ||
| ), |
There was a problem hiding this comment.
Exclusive-run constraint never applies: source is never set
Medium Severity
The new unique constraint only covers rows where source is cron or manual, but nothing writes source. SeerWorkflowRunLifecycle.create takes no source argument and sets only status=QUEUED. The other creation paths set neither field. Every run row has source NULL, so the constraint never applies and nothing stops two active cron or manual runs on the same automation.
Reviewed by Cursor Bugbot for commit 4e58168. Configure here.
…d-m5jbyn-exclusive-runs
…d-m5jbyn-exclusive-runs # Conflicts: # migrations_lockfile.txt
…d-m5jbyn-exclusive-runs
|
This PR has a migration; here is the generated SQL for for --
-- Create index seer_run_active_added_idx on field(s) date_added of model seerworkflowrun
--
CREATE INDEX CONCURRENTLY "seer_run_active_added_idx" ON "seer_nightshiftrun" ("date_added") WHERE "status" IN ('queued', 'running');
--
-- Create constraint seer_nightshiftrun_one_active_exclusive_run on model seerworkflowrun
--
CREATE UNIQUE INDEX CONCURRENTLY "seer_nightshiftrun_one_active_exclusive_run" ON "seer_nightshiftrun" ("workflow_config_id") WHERE ("source" IN ('cron', 'manual') AND "status" IN ('queued', 'running')); |
…d-m5jbyn-exclusive-runs
…d-m5jbyn-exclusive-runs # Conflicts: # migrations_lockfile.txt


Stacked on #132182.
Allows at most one queued or running
cronormanualrun per automation, with a partial unique index on(workflow_config). Event-triggered runs are left out, so parallel breaches still run. Also adds a partial index ondate_addedfor active runs, for a future stuck-run sweeper.