Repository navigation
fix(alerts): seed logicType/conditions when issue alert edit adds first action filter - #1336
Merged
Merged
Conversation
…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
Contributor
|
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. |
Contributor
Author
|
holding off on auto-merge — getsentry's risk tooling scored this |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
sentry alert issues editapplies a partial change that introduces an action filter on a rule that had none (e.g.--actiononly), the filter was built from an empty object and sent to the workflows API without alogicTypeorconditions— 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 existinglogicType/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 checkon changed files.Closes #1335