fix(rules): Sanitize legacy Rule dynamic_form_fields choice labels#116081
Open
priscilawebdev wants to merge 3 commits into
Open
fix(rules): Sanitize legacy Rule dynamic_form_fields choice labels#116081priscilawebdev wants to merge 3 commits into
priscilawebdev wants to merge 3 commits into
Conversation
#115855 backfilled `workflow_engine_action.data.dynamic_form_fields[*].choices` to recover or coerce labels left as JSON-stripped React elements (`{key, ref, props}`) by the old AbstractExternalIssueForm. The same corruption exists in `Rule.data["actions"][*]["dynamic_form_fields"][*]["choices"]` for legacy issue-alert rules — those use the same TicketRuleModal under the hood and crash the same way. Walk the Rule table, restrict to known ticket-creation action ids, and apply the same `_extract_choice_label` strategy: pull readable text from `props.children` when present, otherwise replace the broken label with the choice value so the row at least renders. Post-deploy migration; runs manually after the backend code deploys. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
|
This PR has a migration; here is the generated SQL for for --
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL |
One assert per test gives clearer failure output than the single multi-block test_migration. Also drops a stale `self.apps_before` reference that would have AttributeError'd if the class were ever unskipped — use the live Rule model in setup, matching #115855's style. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ule-choice-labels
Contributor
Backend Test FailuresFailures on
|
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.
Companion to #115855, which backfilled
workflow_engine_action.data.dynamic_form_fields. The same corruption (React element labels serialized into{key, ref, props}shells) exists on the legacyRulemodel atRule.data["actions"][*]["dynamic_form_fields"][*]["choices"], and the sameTicketRuleModalcrashes on it.Post-deploy migration that walks
Rule, restricts to known ticket-creation action ids, and applies the same_extract_choice_labelstrategy: pull readable text fromprops.childrenwhen present, fall back to the choice value otherwise.Redash query: https://redash.getsentry.net/queries/11297/source
Refs JAVASCRIPT-3921