ref(alerts): migrate rule node fields to JsonFormAdapterFieldConfig#112779
Merged
priscilawebdev merged 10 commits intomasterfrom Apr 16, 2026
Merged
ref(alerts): migrate rule node fields to JsonFormAdapterFieldConfig#112779priscilawebdev merged 10 commits intomasterfrom
priscilawebdev merged 10 commits intomasterfrom
Conversation
Replace the loose FormField type ({type: string, [key]: any})
with the existing IssueAlertRuleFormField discriminated union.
Add missing mailAction and assignee field types, resetsForm to
choice fields, and use IssueAlertRuleActionTemplate for the
node prop. Removes @ts-expect-error and lodash/merge import.
Use type guard function for SchemaFormConfig narrowing instead of as-casts. Fix prefer-optional-chain lint error.
Replace custom ChoiceField, NumberField, TextField components with a unified InlineField that uses JsonFormAdapterFieldConfig and transformChoices from the form adapter. Backend field configs now go through mapAlertRuleField before rendering, aligning with the adapter pattern used by BackendJsonSubmitForm.
Member
Author
|
@cursor review |
Contributor
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3b235ae. Configure here.
Fix exampleNumberChoiceField test fixture to use strings for initial and choices keys, matching what the backend API actually returns. Revert initial type back to string-only. Remove redundant null checks and type override in mapAlertRuleField. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The type: 'select' is needed to narrow the JsonFormAdapterFieldConfig union when spreading adapterField. Without it TypeScript produces a type too wide to reassign, and the select doesn't render. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
TkDodo
approved these changes
Apr 15, 2026
Contributor
Sentry Snapshot Testing
|
Use string-backed issue category choices and values in the rule node tests to match the backend rule serializer contract. The production code already relies on string values for issue category filters, so the old numeric fixtures were exercising an unrealistic payload shape. Co-Authored-By: Codex <noreply@openai.com>
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.
Migrate the inline alert rule field rendering in
ruleNode.tsxto usethe
backendJsonFormAdaptertype system and utilities.FormFieldtype ({type: string, [key]: any}) withthe
IssueAlertRuleFormFielddiscriminated union fromalerts.tsxmapAlertRuleFieldto bridge backend field types toJsonFormAdapterFieldConfigChoiceField,NumberField,TextFieldinto a singleInlineFieldcomponent that switches on the adapter field typetransformChoicesfrom the adapter utilsmailAction,assigneefield types andresetsFormtothe
IssueAlertRuleFormFielduniongetFormFieldsRecord()helper to narrowformFieldswithout castsnodeprop type toIssueAlertRuleActionTemplatelodash/mergedependencycloses https://linear.app/getsentry/issue/DE-1053/endpoint-3-get