Skip to content

Commit 0527841

Browse files
authored
Merge branch 'master' into feat/unity-metrics
2 parents d9934e2 + 92662a6 commit 0527841

1,119 files changed

Lines changed: 25212 additions & 13532 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/generate-frontend-forms/SKILL.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,20 @@ function MyForm() {
732732
}
733733
```
734734

735+
### Resetting After Save
736+
737+
When a form stays on the page after submission (e.g., settings pages), call `form.reset()` after a successful mutation. This re-syncs the form with updated `defaultValues` so it becomes pristine again — any UI that depends on the form being dirty (like conditionally shown Save/Cancel buttons) will update correctly.
738+
739+
```tsx
740+
onSubmit: ({value}) =>
741+
mutation
742+
.mutateAsync(value)
743+
.then(() => form.reset())
744+
.catch(() => {}),
745+
```
746+
747+
> **Note**: `AutoSaveForm` handles this automatically. You only need to add this when using `useScrapsForm`.
748+
735749
### Submit Button
736750

737751
```tsx
@@ -828,7 +842,11 @@ onSubmit: ({value}) => {
828842
// Return the promise to keep form.isSubmitting working
829843
// Add .catch(() => {}) to avoid unhandled rejection - error handling
830844
// is done by TanStack Query (onError callback, mutation.isError state)
831-
return mutation.mutateAsync(value).catch(() => {});
845+
// Add .then(() => form.reset()) if the form stays on the page after save
846+
return mutation
847+
.mutateAsync(value)
848+
.then(() => form.reset())
849+
.catch(() => {});
832850
};
833851
```
834852

@@ -915,6 +933,23 @@ const opts = mutationOptions({
915933

916934
Make sure the zod schema's types are compatible with the API type. For example, if the API expects a string union like `'off' | 'low' | 'high'`, use `z.enum(['off', 'low', 'high'])` instead of `z.string()`.
917935

936+
### Form Reset After Save
937+
938+
```tsx
939+
// ❌ Don't forget to reset forms that stay on the page after save
940+
onSubmit: ({value}) => {
941+
return mutation.mutateAsync(value).catch(() => {});
942+
};
943+
944+
// ✅ Call form.reset() after successful save to sync with updated defaultValues
945+
onSubmit: ({value}) => {
946+
return mutation
947+
.mutateAsync(value)
948+
.then(() => form.reset())
949+
.catch(() => {});
950+
};
951+
```
952+
918953
### Layout Choice
919954

920955
```tsx
@@ -941,6 +976,7 @@ When creating a new form:
941976
- [ ] Choose appropriate layout (Stack or Row)
942977
- [ ] Handle server errors with `setFieldErrors`
943978
- [ ] Add `<form.SubmitButton>` for submission
979+
- [ ] Call `form.reset()` after successful mutation if the form stays on the page
944980

945981
When creating auto-save fields:
946982

.agents/skills/migrate-frontend-forms/SKILL.md

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,23 @@ This skill helps migrate forms from Sentry's legacy form system (JsonForm, FormM
99

1010
## Feature Mapping
1111

12-
| Old System | New System | Notes |
13-
| -------------------- | ------------------- | -------------------------------------------- |
14-
| `saveOnBlur: true` | `AutoSaveForm` | Default behavior |
15-
| `confirm` | `confirm` prop | `string \| ((value) => string \| undefined)` |
16-
| `showHelpInTooltip` | `variant="compact"` | On layout components |
17-
| `disabledReason` | `disabled="reason"` | String shows tooltip |
18-
| `extraHelp` | JSX in layout | Render `<Text>` below field |
19-
| `getData` | `mutationFn` | Transform data in mutation function |
20-
| `mapFormErrors` | `setFieldErrors` | Transform API errors in catch block |
21-
| `saveMessage` | `onSuccess` | Show toast in mutation onSuccess callback |
22-
| `formatMessageValue` | `onSuccess` | Control toast content in onSuccess callback |
23-
| `resetOnError` | `onError` | Call form.reset() in mutation onError |
24-
| `saveOnBlur: false` | `useScrapsForm` | Use regular form with explicit Save button |
25-
| `help` | `hintText` | On layout components |
26-
| `label` | `label` | On layout components |
27-
| `required` | `required` | On layout + Zod schema |
12+
| Old System | New System | Notes |
13+
| -------------------- | ------------------- | ---------------------------------------------------- |
14+
| `saveOnBlur: true` | `AutoSaveForm` | Default behavior |
15+
| `confirm` | `confirm` prop | `string \| ((value) => string \| undefined)` |
16+
| `showHelpInTooltip` | `variant="compact"` | On layout components |
17+
| `disabledReason` | `disabled="reason"` | String shows tooltip |
18+
| `extraHelp` | JSX in layout | Render `<Text>` below field |
19+
| `getData` | `mutationFn` | Transform data in mutation function |
20+
| `mapFormErrors` | `setFieldErrors` | Transform API errors in catch block |
21+
| `saveMessage` | `onSuccess` | Show toast in mutation onSuccess callback |
22+
| `formatMessageValue` | `onSuccess` | Control toast content in onSuccess callback |
23+
| `resetOnError` | `onError` | Call form.reset() in mutation onError |
24+
| `saveOnBlur: false` | `useScrapsForm` | Use regular form with explicit Save button |
25+
| (automatic) | `form.reset()` | Call after successful mutation if form stays on page |
26+
| `help` | `hintText` | On layout components |
27+
| `label` | `label` | On layout components |
28+
| `required` | `required` | On layout + Zod schema |
2829

2930
## Feature Details
3031

@@ -410,6 +411,20 @@ const form = useScrapsForm({
410411

411412
> **Note**: AutoSaveForm with TanStack Query already handles error states gracefully - the mutation's `isError` state is reflected in the UI. Manual reset is typically only needed for specific UX requirements like password fields.
412413

414+
### Resetting After Save
415+
416+
When using `useScrapsForm` for a form that stays on the page after save, call `form.reset()` after a successful mutation. This re-syncs the form with updated `defaultValues` so it becomes pristine again — any UI that depends on the form being dirty (like conditionally shown Save/Cancel buttons) will update correctly.
417+
418+
```tsx
419+
onSubmit: ({value}) =>
420+
mutation
421+
.mutateAsync(value)
422+
.then(() => form.reset())
423+
.catch(() => {}),
424+
```
425+
426+
> **Note**: `AutoSaveForm` handles this automatically. You only need to add this when using `useScrapsForm`.
427+
413428
### saveOnBlur: false → `useScrapsForm`
414429

415430
Fields with `saveOnBlur: false` showed an inline alert with Save/Cancel buttons instead of auto-saving. This was used for dangerous operations (slug changes) or large text edits (fingerprint rules).
@@ -597,6 +612,7 @@ This pattern is necessary whenever a required field has no meaningful initial va
597612
- [ ] Handle `mapFormErrors` with setFieldErrors in catch
598613
- [ ] Handle `saveMessage` in onSuccess callback
599614
- [ ] Convert `saveOnBlur: false` fields to regular forms with Save button
615+
- [ ] Call `form.reset()` after successful mutation (for forms that stay on page)
600616
- [ ] Verify `onSuccess` cache updates merge with existing data (use updater function) — some API endpoints may return partial objects
601617
- [ ] Wrap the migrated form with `<FormSearch route="...">` if the old form was searchable in SettingsSearch
602618
- [ ] Run `pnpm run extract-form-fields` and commit the updated `generatedFieldRegistry.ts`

.github/CODEOWNERS

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
586586
/static/app/gettingStartedDocs/ @getsentry/value-discovery
587587
/static/app/types/project.tsx @getsentry/value-discovery
588588
/static/app/views/onboarding/ @getsentry/value-discovery
589+
/tests/js/fixtures/detectedPlatform.ts @getsentry/value-discovery
589590
/static/app/views/projectInstall/ @getsentry/value-discovery
590591
/src/sentry/onboarding_tasks/ @getsentry/value-discovery
591592
## End of Value Discovery
@@ -597,6 +598,8 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
597598
/tests/sentry/seer/ @getsentry/machine-learning-ai
598599
/src/sentry/seer/fetch_issues/ @getsentry/machine-learning-ai @getsentry/coding-workflows-sentry-backend
599600
/tests/sentry/seer/fetch_issues/ @getsentry/machine-learning-ai @getsentry/coding-workflows-sentry-backend
601+
/src/sentry/tasks/seer/ @getsentry/machine-learning-ai
602+
/tests/sentry/tasks/seer/ @getsentry/machine-learning-ai
600603
## End of ML & AI
601604

602605
## Issues
@@ -647,7 +650,7 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
647650
/src/sentry/tasks/clear_expired_snoozes.py @getsentry/issue-detection-backend
648651
/src/sentry/tasks/codeowners/ @getsentry/issue-detection-backend
649652
/src/sentry/tasks/commit_context.py @getsentry/issue-detection-backend
650-
/src/sentry/tasks/delete_seer_grouping_records.py @getsentry/issue-detection-backend
653+
/src/sentry/tasks/seer/delete_seer_grouping_records.py @getsentry/issue-detection-backend
651654
/src/sentry/tasks/embeddings_grouping/ @getsentry/issue-detection-backend
652655
/src/sentry/tasks/groupowner.py @getsentry/issue-detection-backend
653656
/src/sentry/tasks/merge.py @getsentry/issue-detection-backend
@@ -658,6 +661,7 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
658661
/static/app/components/events/eventTags/ @getsentry/issue-workflow
659662
/static/app/components/events/highlights/ @getsentry/issue-workflow
660663
/static/app/components/issues/ @getsentry/issue-workflow
664+
/static/app/components/stackTrace/ @getsentry/issue-workflow
661665
/static/app/views/issueList/ @getsentry/issue-workflow
662666
/static/app/views/issueList/pages/supergroups.tsx @getsentry/issue-detection-frontend
663667
/static/app/views/issueList/supergroups/ @getsentry/issue-detection-frontend
@@ -677,21 +681,21 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
677681
/tests/sentry/issues/test_search_issues_dataset.py @getsentry/issue-workflow
678682
/tests/sentry/issues/test_status_change_consumer.py @getsentry/issue-detection-backend
679683
/tests/sentry/issues/test_status_change.py @getsentry/issue-detection-backend
684+
/tests/sentry/processing_errors/ @getsentry/issue-detection-backend
680685
/tests/sentry/search/ @getsentry/issue-workflow
681686
/tests/sentry/seer/similarity/ @getsentry/issue-detection-backend
682687
/tests/sentry/seer/supergroups/ @getsentry/issue-detection-backend
683688
/tests/sentry/similarity/ @getsentry/issue-detection-backend
684689
/tests/sentry/tasks/test_auto_ongoing_issues.py @getsentry/issue-detection-backend
685690
/tests/sentry/tasks/test_auto_remove_inbox.py @getsentry/issue-detection-backend
686691
/tests/sentry/tasks/test_auto_resolve_issues.py @getsentry/issue-detection-backend
687-
/tests/sentry/tasks/test_backfill_seer_grouping_records.py @getsentry/issue-detection-backend
692+
/tests/sentry/tasks/seer/test_delete_seer_grouping_records.py @getsentry/issue-detection-backend
688693
/tests/sentry/tasks/test_check_new_issue_threshold_met.py @getsentry/issue-detection-backend
689694
/tests/sentry/tasks/test_clear_expired_resolutions.py @getsentry/issue-detection-backend
690695
/tests/sentry/tasks/test_clear_expired_rulesnoozes.py @getsentry/issue-detection-backend
691696
/tests/sentry/tasks/test_clear_expired_snoozes.py @getsentry/issue-detection-backend
692697
/tests/sentry/tasks/test_code_owners.py @getsentry/issue-detection-backend
693698
/tests/sentry/tasks/test_commit_context.py @getsentry/issue-detection-backend
694-
/tests/sentry/tasks/test_delete_seer_grouping_records.py @getsentry/issue-detection-backend
695699
/tests/sentry/tasks/test_groupowner.py @getsentry/issue-detection-backend
696700
/tests/sentry/tasks/test_merge.py @getsentry/issue-detection-backend
697701
/tests/sentry/tasks/test_post_process.py @getsentry/issue-detection-backend
@@ -794,15 +798,21 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
794798
/static/app/views/settings/ @getsentry/design-engineering
795799
/static/app/views/nav/ @getsentry/design-engineering
796800
/static/app/bootstrap/ @getsentry/design-engineering
797-
798-
# LLM Agent guidelines
801+
# Config files
802+
/figma.config.json @getsentry/design-engineering
803+
/knip.config.ts @getsentry/design-engineering
804+
# Agents + Skills
799805
/static/.cursor/BUGBOT.md @getsentry/design-engineering
800806
/static/CLAUDE.md @getsentry/design-engineering
801807
/static/AGENTS.md @getsentry/design-engineering
802-
/.claude/skills/design-system/ @getsentry/design-engineering
803-
804808
/static/eslint/ @getsentry/design-engineering
805809
/scripts/analyze-styled.ts @getsentry/design-engineering
810+
/.agents/skills/design-system/ @getsentry/design-engineering
811+
/.agents/skills/migrate-frontend-forms/ @getsentry/design-engineering
812+
/.agents/skills/generate-frontend-forms/ @getsentry/design-engineering
813+
/.agents/skills/lint-fix/ @getsentry/design-engineering
814+
/.agents/skills/lint-new/ @getsentry/design-engineering
815+
/.agents/skills/react-component-documentation/ @getsentry/design-engineering
806816
## End of Frontend Platform
807817

808818
# Coding Workflows
@@ -818,6 +828,7 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
818828
/tests/sentry/releases/ @getsentry/coding-workflows-sentry-backend
819829

820830
## SCM
831+
/src/sentry/scm/ @getsentry/scm
821832
/src/sentry/integrations/source_code_management/ @getsentry/product-owners-settings-integrations @getsentry/ecosystem @getsentry/scm
822833
/src/sentry/integrations/repository/ @getsentry/product-owners-settings-integrations @getsentry/ecosystem @getsentry/scm
823834
/src/sentry/integrations/github_enterprise/ @getsentry/product-owners-settings-integrations @getsentry/ecosystem @getsentry/scm

.github/codeowners-coverage-baseline.txt

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,11 @@
1111
src/sentry/data/error-**
1212
src/sentry/locale/**
1313

14-
.agents/skills/design-system/SKILL.md
15-
.agents/skills/generate-frontend-forms/SKILL.md
16-
.agents/skills/lint-fix/SKILL.md
17-
.agents/skills/lint-fix/references/fix-patterns.md
18-
.agents/skills/lint-fix/references/token-taxonomy.md
19-
.agents/skills/lint-new/SKILL.md
20-
.agents/skills/lint-new/references/rule-archetypes.md
21-
.agents/skills/lint-new/references/schema-patterns.md
22-
.agents/skills/lint-new/references/style-collector-guide.md
23-
.agents/skills/migrate-frontend-forms/SKILL.md
2414
.agents/skills/notification-platform/SKILL.md
2515
.agents/skills/notification-platform/references/custom-renderers.md
2616
.agents/skills/notification-platform/references/data-and-templates.md
2717
.agents/skills/notification-platform/references/provider-template.md
2818
.agents/skills/notification-platform/references/targets-and-sending.md
29-
.agents/skills/react-component-documentation/SKILL.md
3019
.agents/skills/setup-dev/SKILL.md
3120
.agents/skills/setup-dev/references/orbstack-fix.md
3221
.codeowners-config.yml
@@ -68,9 +57,7 @@ bin/split-silo-database
6857
bin/update-migration
6958
config/build-chartcuterie.ts
7059
config/commit-template
71-
figma.config.json
7260
jest.config.snapshots.ts
73-
knip.config.ts
7461
migrations_lockfile.txt
7562
rspack.config.ts
7663
src/AGENTS.md
@@ -236,22 +223,6 @@ src/sentry/runner/importer.py
236223
src/sentry/runner/initializer.py
237224
src/sentry/runner/main.py
238225
src/sentry/runner/settings.py
239-
src/sentry/scm/actions.py
240-
src/sentry/scm/apps.py
241-
src/sentry/scm/endpoints/scm_rpc.py
242-
src/sentry/scm/errors.py
243-
src/sentry/scm/private/event_stream.py
244-
src/sentry/scm/private/helpers.py
245-
src/sentry/scm/private/ipc.py
246-
src/sentry/scm/private/provider.py
247-
src/sentry/scm/private/providers/github.py
248-
src/sentry/scm/private/providers/gitlab.py
249-
src/sentry/scm/private/rpc.py
250-
src/sentry/scm/private/stream_producer.py
251-
src/sentry/scm/private/webhooks/github.py
252-
src/sentry/scm/stream.py
253-
src/sentry/scm/types.py
254-
src/sentry/scm/utils.py
255226
src/sentry/scripts/alerts/conditional_zrem.lua
256227
src/sentry/scripts/digests/digests.lua
257228
src/sentry/scripts/quotas/is_rate_limited.lua
@@ -885,7 +856,6 @@ static/app/components/modals/explore/saveQueryModal.spec.tsx
885856
static/app/components/modals/explore/saveQueryModal.tsx
886857
static/app/components/modals/featureTourModal.spec.tsx
887858
static/app/components/modals/featureTourModal.tsx
888-
static/app/components/modals/generateDashboardFromSeerModal.tsx
889859
static/app/components/modals/helpSearchModal.spec.tsx
890860
static/app/components/modals/helpSearchModal.tsx
891861
static/app/components/modals/importDashboardFromFileModal.tsx
@@ -1087,7 +1057,6 @@ static/app/components/repositories/scmIntegrationTree/useScmTreeFilters.tsx
10871057
static/app/components/repositories/scmRepoTreeModal.tsx
10881058
static/app/components/repositoryRow.spec.tsx
10891059
static/app/components/repositoryRow.tsx
1090-
static/app/components/reprocessedBox.tsx
10911060
static/app/components/resolutionBox.spec.tsx
10921061
static/app/components/resolutionBox.tsx
10931062
static/app/components/resourceCard.tsx
@@ -2386,12 +2355,6 @@ tests/sentry/processing/backpressure/test_checking.py
23862355
tests/sentry/processing/backpressure/test_monitoring.py
23872356
tests/sentry/processing/backpressure/test_redis.py
23882357
tests/sentry/processing/eventstore/test_processing.py
2389-
tests/sentry/processing_errors/__init__.py
2390-
tests/sentry/processing_errors/eap/__init__.py
2391-
tests/sentry/processing_errors/eap/test_producer.py
2392-
tests/sentry/processing_errors/test_detection.py
2393-
tests/sentry/processing_errors/test_grouptype.py
2394-
tests/sentry/processing_errors/test_provisioning.py
23952358
tests/sentry/projectoptions/__init__.py
23962359
tests/sentry/projectoptions/test_basic.py
23972360
tests/sentry/projects/project_rules/test_creator.py
@@ -2546,14 +2509,12 @@ tests/sentry/tasks/test_activity.py
25462509
tests/sentry/tasks/test_assemble.py
25472510
tests/sentry/tasks/test_auth.py
25482511
tests/sentry/tasks/test_auto_enable_codecov.py
2549-
tests/sentry/tasks/test_autofix.py
25502512
tests/sentry/tasks/test_base.py
25512513
tests/sentry/tasks/test_beacon.py
25522514
tests/sentry/tasks/test_check_am2_compatibility.py
25532515
tests/sentry/tasks/test_check_auth.py
25542516
tests/sentry/tasks/test_collect_project_platforms.py
25552517
tests/sentry/tasks/test_commits.py
2556-
tests/sentry/tasks/test_context_engine_index.py
25572518
tests/sentry/tasks/test_delete_pending_groups.py
25582519
tests/sentry/tasks/test_digests.py
25592520
tests/sentry/tasks/test_email.py
@@ -2563,8 +2524,6 @@ tests/sentry/tasks/test_organization_contributors.py
25632524
tests/sentry/tasks/test_process_buffer.py
25642525
tests/sentry/tasks/test_relay.py
25652526
tests/sentry/tasks/test_reprocessing2.py
2566-
tests/sentry/tasks/test_seer.py
2567-
tests/sentry/tasks/test_seer_explorer_index.py
25682527
tests/sentry/tasks/test_store.py
25692528
tests/sentry/tasks/test_symbolication.py
25702529
tests/sentry/tasks/test_update_code_owners_schema.py

.github/workflows/changelog-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ permissions:
1515

1616
jobs:
1717
changelog-preview:
18-
uses: getsentry/craft/.github/workflows/changelog-preview.yml@v2
18+
uses: getsentry/craft/.github/workflows/changelog-preview.yml@f4889d04564e47311038ecb6b910fef6b6cf1363 # v2
1919
with:
2020
comment: false
2121
secrets: inherit

0 commit comments

Comments
 (0)