Skip to content

fix(alerts): seed logicType/conditions when issue alert edit adds first action filter - #1336

Merged
BYK merged 1 commit into
mainfrom
issue-1335-issue-alert-action-filter-logictype
Aug 2, 2026
Merged

BYK merged 1 commit into
mainfrom
issue-1335-issue-alert-action-filter-logictype

Conversation

@jared-outpost

@jared-outpost jared-outpost Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

When sentry alert issues edit applies a partial change that introduces an action filter on a rule that had none (e.g. --action only), the filter was built from an empty object and sent to the workflows API without a logicType or conditions — an invalid DataConditionGroup that the API rejects.

The fix seeds a fresh filter with the same defaults the create path uses (logicType: "all", conditions: []). Rules that already have an action filter keep their existing logicType/conditions (unchanged behavior).

Note: the Seer report's "silently drops existing logicType/conditions" framing was inaccurate for the common case — an existing actionFilters[0] is merged, not replaced. The real defect is the missing-filter case, fixed here.

Testing

vitest run test/commands/alert/ test/lib/api/alerts.test.ts (165 passing, incl. a new test for the no-existing-filter path); tsc --noEmit; biome check on changed files.

Closes #1335

…st action filter

A partial edit that introduces an action filter on a rule that had none
(e.g. `edit --action`) built the filter from an empty object, emitting a
DataConditionGroup with no logicType or conditions. The workflows API
rejects a group without a logic type. Seed the same defaults the create
path uses (`logicType: all`, `conditions: []`); existing filters keep
their own values.

Fixes #1335
@github-actions

github-actions Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-02 13:24 UTC

@jared-outpost
jared-outpost Bot marked this pull request as ready for review August 2, 2026 13:03
@jared-outpost
jared-outpost Bot requested a review from BYK August 2, 2026 13:03
@jared-outpost

jared-outpost Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

marked ready — all required checks are green (Build/Unit Tests/Lint & Typecheck/E2E, Warden, CodeQL, Secret Scan, dependency review). self-review turned up nothing beyond the fix itself. @BYK requested for review since you filed the issue.

@jared-outpost

jared-outpost Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

holding off on auto-merge — getsentry's risk tooling scored this risk: medium and it changes alert-rule write behavior sent to the workflows API, so a maintainer should sign off. @BYK is on the review. all checks are green and the diff is small (55 lines across 2 files).

@BYK
BYK merged commit ac0b837 into main Aug 2, 2026
31 checks passed
@BYK
BYK deleted the issue-1335-issue-alert-action-filter-logictype branch August 2, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missed Seer comment

1 participant