Repository navigation
feat(seer): Add monitor cleanup workflow UI - #123978
Conversation
📊 Type Coverage Diff
🔍 3 new type safety issues introducedType assertions (
This is informational only and does not block the PR. |
Sentry Snapshot Testing
|
4a7d6a7 to
2d8185c
Compare
23f7fc5 to
983b95e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 787dced. Configure here.
Adds a top-level nullable `source` field to workflow run responses, using a shared `WorkflowRunSource` literal type (`cron` or `manual`). Reuses Night Shift’s existing `extras.options.source`; monitor scan callers pass the source explicitly, with the user-facing endpoint passing `manual`. Runs without a recorded source return `null`. Backend prerequisite for #123978. The existing Night Shift extras remain available for older clients. Existing history tests cover recorded and unknown sources, and preserving source through scan completion.
| Array.from(new Set(runs.map(run => run.strategy))).map(strategy => ({ | ||
| value: strategy, | ||
| label: STRATEGY_META[strategy].label, | ||
| })), |
There was a problem hiding this comment.
Bug: Unsafe property access on STRATEGY_META using an unvalidated strategy key from an API response can cause a runtime crash if the key is unknown.
Severity: HIGH
Suggested Fix
Implement runtime validation for the API response, for instance with a Zod schema. Alternatively, use optional chaining (STRATEGY_META[strategy]?.label) and provide a fallback value (e.g., ?? 'Unknown Strategy') to gracefully handle cases where an unknown strategy is received from the API, preventing a crash.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: static/app/views/seerWorkflows/index.tsx#L143-L146
Potential issue: The code uses the `strategy` string from an API response to access
properties on the `STRATEGY_META` object. There is no runtime validation to ensure the
`strategy` value from the API is a valid key in `STRATEGY_META`. If the API returns an
unexpected or new strategy string, the lookup `STRATEGY_META[strategy]` will result in
`undefined`. The subsequent access to the `.label` property will throw a `TypeError`,
causing a runtime crash. This could occur due to API version mismatches or a backend
bug.
Also affects:
static/app/views/seerWorkflows/index.tsx:424~426
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
will handle in follow-up, not an issue rn

Adds a flag-gated “Run…” menu to the Autofix workflows page, initially offering a monitor scan. Runs update with findings, property comparisons, monitor and alert links, and agent debug links. Incomplete and unsupported results remain distinct from completed scans with no findings; users follow monitor links to delete duplicates.
The page consumes strategy-specific API run types directly, sharing polling and filtering while deriving display status and summaries per strategy. Trigger source comes from the API; unknown sources display
--. Uses the execution backend from #123966 (merged) and requires the source field from #124379 to land first.