ref(forms): Migrate Sentry App schema forms to BackendJsonSubmitForm#112911
Closed
priscilawebdev wants to merge 8 commits intomasterfrom
Closed
ref(forms): Migrate Sentry App schema forms to BackendJsonSubmitForm#112911priscilawebdev wants to merge 8 commits intomasterfrom
priscilawebdev wants to merge 8 commits intomasterfrom
Conversation
14cbb3c to
80254d0
Compare
Contributor
Sentry Snapshot Testing
|
80254d0 to
4d2cf8e
Compare
98a0004 to
8c2c19d
Compare
Migrate the Sentry App schema-backed forms (issue-link and
alert-rule-action) off FormModel/FieldFromConfig and onto
BackendJsonSubmitForm. SentryAppExternalForm becomes a function
component; both consumers (SentryAppExternalIssueForm,
SentryAppRuleModal) switch to the named export.
Add a customAsyncQueryOptions prop on BackendJsonSubmitForm so
consumers can override the default URL-based async-select fetcher.
The Sentry App external-requests endpoint expects {uri, query,
dependentData} which doesn't fit the adapter's built-in shape, and
this is the actual consumer the prop was added for.
Add an onValueChange callback so the migration can mirror every
field change into its own ref/state for dependent-field tracking,
distinct from onFieldChange (which only fires for updatesForm fields).
Preserve legacy behavior where it matters: depends_on dependent
field loading and resets, backend-provided default values, saved
labels for async selects, alert-rule submit payload shape, and the
form reset on action prop change.
Defer required-field validation to the form's auto-generated zod
schema. The submit button stays enabled; clicking surfaces inline
per-field errors via aria-invalid + the design-system warning icon,
matching the pattern in ticketRuleModal and externalIssueForm.
Refs DE-1055
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
5272e2f to
73a5270
Compare
Member
Author
|
bugbot run |
Resolve schema defaults and request payload inputs by value so the initialization effect only reruns when the form semantics change. This avoids clearing dependent field state when callers rerender with equivalent callback and object props. Memoize the issue-link and alert-rule callers that were recreating those props on every render and add a rerender regression test for dependent field prefetches. Co-Authored-By: OpenAI Codex <noreply@openai.com>
Keep the rerender reset protection in SentryAppExternalForm while moving the issue-link and alert-rule callers back to inline props. This keeps the change focused on the shared form instead of spreading memoization churn across wrappers. Replace the JSON parse normalization with a small serialized-value memo helper so equivalent object props still compare by value without the extra parse step. Co-Authored-By: OpenAI Codex <noreply@openai.com>
Member
Author
|
bugbot run |
Keep dependent field refreshes from overwriting newer form input by invalidating stale async responses and rebuilding remount values from the latest live form state. Also normalize async select choice values before caching labels and forward textarea autosize metadata through the adapter so migrated schema forms keep their intended behavior. Co-Authored-By: OpenAI Codex <noreply@openai.com>
203f1fd to
6cd0388
Compare
Member
Author
|
bugbot run |
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 6cd0388. Configure here.
Member
Author
|
This PR got a bit out of hand. I tested everything manually and it seems to work well, but it’s become hard to follow and review. I’m going to close it for now. |
…d-json-form-custom-async # Conflicts: # static/app/components/backendJsonFormAdapter/backendJsonSubmitForm.tsx
Contributor
📊 Type Coverage Diff
🔍 8 new type safety issues introduced
Type assertions (
This is informational only and does not block the PR. |
priscilawebdev
added a commit
that referenced
this pull request
May 6, 2026
Register the `organizations:sentry-app-schema-form-migration` feature flag. Refs #112911 --------- Co-authored-by: Claude <noreply@anthropic.com>
priscilawebdev
added a commit
that referenced
this pull request
May 6, 2026
Restore the pre-migration class component as sentryAppExternalForm.legacy.tsx (exported as LegacySentryAppExternalForm) and have the two consumers — SentryAppExternalIssueForm and SentryAppRuleModal — pick between the legacy and new form based on the organizations:sentry-app-schema-form-migration flag. Add Sentry.captureException to the new form's two failure paths so we can observe issues during rollout: - Save: onError of the create-external-issue mutation - Edit: dependent-field initialization (Promise.all of fetchFieldChoices when the form opens) The flag is registered in #114945 and rolled out via getsentry/sentry-options-automator#7678. Refs DE-1055 Refs #114945 Refs #112911 Co-Authored-By: Claude <noreply@anthropic.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 Sentry App schema-backed forms to
BackendJsonSubmitFormSentryAppExternalFormbecomes a function component and renders viaBackendJsonSubmitForm. Both consumers (SentryAppExternalIssueForm,SentryAppRuleModal) keep going through the same Sentry App schema form path.Add a
customAsyncQueryOptionsprop onBackendJsonSubmitFormso consumers can override the default URL-based async-select fetcher. The Sentry Appexternal-requestsendpoint expects{uri, query, dependentData}, which doesn't fit the adapter's built-in shape — this is the actual consumer the prop was added for.Preserve legacy behavior: dependent field loading and resets, backend-provided default values, saved labels for async selects, the alert-rule submit payload shape, and form reset on
actionprop change.Defer required-field validation to the form's auto-generated zod schema. The submit button stays enabled; clicking surfaces inline per-field errors via
aria-invalid, matching the pattern inticketRuleModalandexternalIssueForm.closes https://linear.app/getsentry/issue/DE-1055/sentry-app-schema-forms-custom-uris