Skip to content

ref(seer): Generalize Night Shift run models - #124301

Merged
trevor-e merged 6 commits into
masterfrom
telkins/codex/generalize-seer-workflow-runs
Sep 14, 2026
Merged

trevor-e merged 6 commits into
masterfrom
telkins/codex/generalize-seer-workflow-runs

Conversation

@trevor-e

@trevor-e trevor-e commented Sep 14, 2026

Copy link
Copy Markdown
Member

Generalize SeerNightShiftRun and SeerNightShiftRunShard into SeerWorkflowRun and SeerWorkflowRunExecution so other workflows can reuse the invocation and execution records. Move them into the workflow models module and update their references and reverse relationships.

One state-only migration preserves the existing database tables, columns, and IDs. Night Shift keeps its specialized issue-result records, API responses, dispatch/completion behavior, and feature-delivery contract. This prepares the models for monitor cleanup (#123966).

Reuse Night Shift's tables for shared workflow history and track result completion through feature delivery. Preserve existing tables and dispatch timestamps during rollout.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 14, 2026
@trevor-e trevor-e changed the title ref(seer): Generalize workflow runs and execution tracking ref(seer): Generalize Night Shift run models Sep 14, 2026
@trevor-e
trevor-e marked this pull request as ready for review September 14, 2026 18:09
@trevor-e
trevor-e requested review from a team as code owners September 14, 2026 18:09
__relocation_scope__ = RelocationScope.Excluded

run = FlexibleForeignKey(
"seer.SeerWorkflowRun", on_delete=models.CASCADE, related_name="executions"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Renamed this to executions since shards caused some confusion.

@wedamija wedamija left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

migration lgtm, just a state no-op

@github-actions

Copy link
Copy Markdown
Contributor

This PR has a migration; here is the generated SQL for src/sentry/seer/migrations/0035_generalize_workflow_run_models.py

for 0035_generalize_workflow_run_models in seer

--
-- Custom state/database change combination
--
-- (no-op)

@trevor-e
trevor-e merged commit e55ed9f into master Sep 14, 2026
89 of 90 checks passed
@trevor-e
trevor-e deleted the telkins/codex/generalize-seer-workflow-runs branch September 14, 2026 18:33
trevor-e added a commit that referenced this pull request Sep 14, 2026
Adds flag-gated manual monitor scans through POST on the existing Seer
workflows endpoint. Each scan creates a `SeerWorkflowRun` and one
execution linked to its Seer feature run. History queries the shared
workflow table alongside Night Shift, with project-access filtering for
monitor findings.

Seer callback delivery parses the response and stores findings and
completion status in `SeerAgentRun.extras`. The API returns the workflow
ID separately from the Seer UUID used by Explorer links. Night Shift
keeps its specialized issue-result records.

Uses the workflow models introduced in #124301. The Seer registration is
getsentry/seer#8151. Land this backend before the frontend PR, #123978.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants