Skip to content

ref(avatar) refactor avatar primitives#107609

Closed
JonasBa wants to merge 216 commits intojb/avatar/reorgfrom
jb/avatar/refactor
Closed

ref(avatar) refactor avatar primitives#107609
JonasBa wants to merge 216 commits intojb/avatar/reorgfrom
jb/avatar/refactor

Conversation

@JonasBa
Copy link
Member

@JonasBa JonasBa commented Feb 4, 2026

todo:

nsdeschenes and others added 30 commits February 3, 2026 14:31
This PR removes the "Metrics" option from cross-event querying, as we're
removing this for initial EA launch.

Ticket: EXP-739
…rator and operand (#107512)

Before:
<img width="873" height="334" alt="Screenshot 2026-02-03 at 1 33 02 PM"
src="https://github.com/user-attachments/assets/25191b0e-07a2-4b1b-906a-96a32114e59b"
/>

After: 
<img width="886" height="446" alt="Screenshot 2026-02-03 at 1 32 28 PM"
src="https://github.com/user-attachments/assets/6ea00c13-3324-4ead-929b-f21a45c8561a"
/>

---------

Co-authored-by: Abdullah Khan <abdullahkhan@PG9Y57YDXQ.local>
…tegration (#107288)

For other integrations, like BitBucket and GitLab, we dont want to send
a reminder because these things should be as setup as possible already.
The extra steps are github only right now (but coming soon to more
SCMs!)

Followup of: #106931
Fixes CW-720
## Description
Moving the CacheAccess class to `caches/cache_access.py` this will
become the basis for interacting with the Workflow / Detector caches.
…sioning (#106941)

Closes
https://linear.app/getsentry/issue/BIL-1928/add-formatting-for-admin-provisioning

## Summary

Adds unit formatting for emerge data categories (SIZE_ANALYSIS,
INSTALLABLE_BUILD) in the admin provisioning UI:

- Add `isEmergeCategory()` and `getCategoryUnitSuffix()` helper
functions in `dataCategory.tsx`
- Fix `shortenedUnitName` values: "upload" → "build", "distribution" →
"install"
- Update provision subscription modal to use new helper for all category
unit suffixes
- Add emerge category handling in gift events modal with proper unit
labels

## Test plan

- [x] Unit tests added for `isEmergeCategory()` and
`getCategoryUnitSuffix()`
- [ ] Verify admin provisioning modal shows "(in builds)" suffix for
SIZE_ANALYSIS
- [ ] Verify admin provisioning modal shows "(in installs)" suffix for
INSTALLABLE_BUILD
- [ ] Verify gift events modal shows correct unit in label/help for
emerge categories
…rder (#107455)

This PR addresses the `TypeError: Dict key must be str` occurring in the
Amazon SQS data forwarder when attempting to serialize event payloads
containing `datetime.datetime` objects in breadcrumbs.

The root cause was identified as `orjson.dumps()` failing to serialize
these datetime objects when only the `orjson.OPT_UTC_Z` option was
provided. To resolve this, the `orjson.OPT_NON_STR_KEYS` flag has been
added to the `orjson.dumps()` calls within the `AmazonSQSForwarder`.

This change aligns the SQS forwarder's serialization logic with other
parts of the codebase that handle complex data structures, ensuring
proper serialization of datetime objects and preventing the `TypeError`.

Closes SENTRY-5HY1

<!--

  Sentry employees and contractors can delete or ignore the following.

-->

### Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.

---------

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
Co-authored-by: Tony Xiao <txiao@sentry.io>
This adds trace metric alerts for the old (existing) alert flow.

Some notable changes:
- We have slightly different dropdowns for trace metric alert,
specifically the trace metric name MUST be picked.
- We'll show loading state until the list of metric names resolves so a
metric name can be picked to fulfuill the above condition
Remove ids from the create workflow example body for triggers, add the
logic type options for action filters, and set a correct logic type
example.
)

Add is_transaction true to backend overview table query
Tours inject a div element to the DOM, which causes invalid HTML
structure in something like the sidebar, which becomes ul > div > li as
opposed to ul > li

The diff is unfortunately quite large due to the indentation change, but
the components outside of the sidebar have been wrapped with a div,
resembling previous functionality, while the sidebar links have received
the props directly to preserve their intended DOM structure.

Fix DE-772
…107465)

## PR Details

+ Skips automation for issues in the triage signals flow (>= 10 events
path) if first_seen is more than 2 weeks ago
+ This prevents a flood of automation runs on historical issues when an
org enables the new pricing
+ Summaries are still generated for old issues (< 10 events path is
unaffected) - only automation is gated
+ **Known edge case: If an issue is created today but takes more than 14
days (2 weeks) to reach 10 events, it will also be skipped. I assume
this is rare and acceptable for now.**

---------

Co-authored-by: Rohan Agarwal <47861399+roaga@users.noreply.github.com>
- Gonna look into fixing the search separately
- But even for convenience having both of these things on the same
attribute is a pain
  - debug -> whether debug was enabled
  - debug_msg -> the message that was passed
If we run into this edge case where we can't find the sentry app
installation, we've decided we want to delete the action because users
can't see it or update it since the app has been uninstalled. See [this
doc](https://www.notion.so/sentry/Invalid-Sentry-App-Actions-2f88b10e4b5d8046ac20faae3cfeb7c5)
for more context on that decision.

I will need to re-run [the
migration](#107208) because I
missed that we were dual writing actions with the installation uuid
(fixed in #107436) and we may as
well delete the orphaned actions in the same step rather that run a
separate migration to do so. It will not be run until
#107460 is merged.
… opening in explore (#107503)

~- When clicking `Open in Explore` from the Score breakdown chart in
prebuilt Web Vitals dashboard, transforms the `performance_score(...)`
yaxes to use equation format (ie `equation|performance_score(...)`).~
- Updates performance score breakdown chart to use `equation|` format.
- This is necessary because the `performance_score` function is not a
selectable yaxis aggregate in Explore (to avoid cluttering the
dropdown). `performance_score` is however valid in equations.
- Updates `isPerformanceScoreBreakdownChart` and
`transformPerformanceScoreBreakdownSeries` to also handle `equation|`
format
- Also removes the 3 yaxes limit from `Open in Explore`.
- This is necessary because some charts such as the score breakdown
chart have more than 3 series
…ashboards to allow creating dashboard filters on multiple datasets (#107434)

When navigating using dashboard links, we currently only apply a single
global dashboard filter on a single dataset (the widget dataset). This
is an issue because some dashboards use multiple datasets for a
filterable field like `transaction`. Updates `linkedDashboards` to allow
an `additionalDatasets` attribute to specify what datasets to also apply
the global filter to.
…07030)

Create a data condition to check if the open period for the issue is
younger / older than X amount of time.
#107546)

- Sending in as an object, causes snake -> came case convertions for
keys, which we don't want for our usecase

Co-authored-by: Abdullah Khan <abdullahkhan@PG9Y57YDXQ.local>
Replaces object-based display type definitions with an explicit array to
make dropdown ordering safer and more maintainable.

Object key ordering in JS is technically specified (ES2015+) but easy to
break accidentally during refactoring, and it's annoying to inject new
values into. Using an array makes the ordering intent explicit and safer
for inserting new display types at specific positions. Also it removed a
bunch of awkward TS ignores.
- We can't timeout the request midrun easily, so lets process it
regardless so there's at least a payoff for making the user wait those
extra seconds
- Add number of iterations to the log message & as a metric
…ata` (#107447)

Preparation for upcoming work on categorical bar charts. Categorical
bars are a chart but they do _not_ use time series data, they use table
data! So, `isChartDisplayType` isn't a helpful name anymore.

Renames the `isChartDisplayType` helper function to `usesTimeSeriesData`
to better reflect its actual purpose: determining whether a display type
uses time-series data (events-stats endpoint) and yAxis state, versus
table-style data (events endpoint) and fields state. This makes the
conditionals a little easier to follow when making changes.

Also added a few comments and extracted some conditionals to explain
_why_ certain things are happening.
Fix an incorrect cast, resolving an apparent cross-type equality check.
- make the header larger
- Remove unused props, remove spreading modal props into the form
- rename input to "Team slug" to match team settings. Team name no
longer really exists.

before

<img width="617" height="322" alt="image"
src="https://github.com/user-attachments/assets/dc413340-d7ed-4fb8-8525-7b4071a1e726"
/>


after

<img width="613" height="299" alt="image"
src="https://github.com/user-attachments/assets/fb081668-f82b-4d8d-962e-e312440bfc49"
/>
- There's an option
`performance.traces.transaction_query_timebuffer_days` which is how much
of an offset we do to the ts passed to the trace endpoint, I wanna see
how often we're querying more days of data than needed
…vior (#107753)

98bc72b fixed a bug that didn't have a
test to verify it.
This adds a test to confirm that duplicate updates don't result in
queries.
@JonasBa JonasBa force-pushed the jb/avatar/refactor branch from 40eb67e to f597fbd Compare February 6, 2026 20:14
…107460)

Update the sentry app installation deletion receiver to disable
`Action`s using either the sentry app id or the sentry app installation
uuid. Previously the sentry app installation deletion receiver was
failing to update `Actions` that use the sentry app id (which is any
single written `Action` or any `Action` that was dual written from a
metric alert).

<!-- BUGBOT_STATUS --><sup><a
href="https://cursor.com/dashboard?tab=bugbot">Cursor Bugbot</a>
reviewed your changes and found no issues for commit
<u>63ffa9a</u></sup><!-- /BUGBOT_STATUS -->
@JonasBa JonasBa force-pushed the jb/avatar/refactor branch from f597fbd to e8a0c03 Compare February 6, 2026 20:16
ref(baseAvatar) inline avatar

address comments

streamline hook call and  reset

ref(avatar) resolve error handling

avatar: add new primitives

avatar: add new primitives

avatar: improve types

ref(avatar) wip

test(avatar): rewrite LetterAvatar tests to focus on public API

Rewrote tests to focus solely on the component's public behavior:
- Initials rendering for various name formats
- Fallback to question mark when name is empty or whitespace
- Proper handling of multibyte characters, emails, and edge cases

Removed tests for internal implementation details like styling and refs.

test(avatar): add ImageAvatar tests for public API

Added comprehensive tests for ImageAvatar component covering:
- Image rendering when src is valid
- Fallback to LetterAvatar when src is missing or image fails to load
- Proper handling of src changes and error state reset
- Props passing to both image and fallback components

All tests focus on observable behavior rather than implementation details.

test(avatar): enhance Gravatar tests to cover public API

Enhanced Gravatar tests to cover:
- SHA-256 hashing of gravatarId and URL generation
- Remote size and d=404 parameters in URL
- Fallback to LetterAvatar for empty/whitespace gravatarId
- Props passing to both gravatar image and fallback
- Hash regeneration when gravatarId changes
- Switching between valid and empty gravatarId

All tests focus on observable behavior and public API.

fix(avatar): fix ImageAvatar fallback not triggering

Fixed issues that prevented the LetterAvatar fallback from displaying when image load fails:

1. Properly destructure `name` from props before spreading to prevent it from being passed to the Image component
2. Remove incorrect `alt` prop being passed from Avatar component to ImageAvatar (ImageAvatarProps explicitly omits 'alt')

These changes ensure the onError handler from mergeProps is properly attached without prop conflicts, allowing the error state to trigger and display the LetterAvatar fallback when an image fails to load.

fix avatar

correct usage

correct usage

correct usage

use fixtures

revert entire html interface

update avatar chooser
dashed and others added 2 commits February 6, 2026 15:27
…roker (#107729)

## Summary

Tests produce real Kafka messages via the taskworker pipeline, causing
stale tasks to accumulate in the taskbroker's SQLite queue. Running 20
tests produced **266 tasks** (relay config invalidations, Slack
notifications, code owners updates, spike projections). Over multiple
test sessions, these accumulate into thousands.

### Root Cause

Three factors combine to produce real Kafka messages during tests:

1. **`simulate_on_commit`** (autouse fixture) fires `on_commit`
callbacks during tests
2. **Django signal handlers** queue tasks via `task.delay()` on model
`post_save`
3. **`TASKWORKER_ALWAYS_EAGER=False`** sends those tasks to real Kafka
at `127.0.0.1:9092`

### Fix

Patch `TaskNamespace.send_task` as a no-op at session start via
`pytest_sessionstart`. This is surgical — it blocks only the Kafka
production step while preserving:

- `_signal_send` hooks (`BurstTaskRunner`, `stale_database_reads`)
- Serialization validation (`create_activation()` still runs)
- `TaskRunner` (uses `ALWAYS_EAGER`, bypasses `send_task` entirely)
- `BurstTaskRunner` (captures at `_signal_send`, before `send_task`)

The 4 tests in `test_registry.py` that directly test `send_task`
behavior use a `real_send_task` fixture to restore the original method.

### Verification

Ran `tests/getsentry/tasks/test_quota_exceeded_notification.py` (20
tests) before and after, with taskbroker running but no taskworker
draining the queue:

| Metric | Before Fix | After Fix |
|---|---|---|
| Tests passing | 20/20 | 20/20 |
| Baseline tasks (devserver scheduler) | 7 | 8 |
| Tasks after test run | **273** (7 + 266 from tests) | **8** (0 from
tests) |
| Test-originated tasks | **266** | **0** |

Before-fix breakdown (266 test-originated tasks from 20 tests):
- 151 `invalidate_project_config`
- 45 `update_code_owners_schema`
- 45 `new_organization_notify` (Slack)
- 25 `run_spike_projection`

Additional regression tests all pass:
- `tests/sentry/taskworker/test_registry.py` — 15/15 (including 4 with
`real_send_task` fixture)
- `tests/sentry/taskworker/` (full suite) — 177/177
- `tests/getsentry/consumers/test_outcomes_consumer.py` — 80/80
(`BurstTaskRunner` works correctly)

## Test plan

- [x] Verified 266 tasks accumulate in taskbroker from 20 tests (before
fix)
- [x] Verified 0 test-originated tasks after fix
- [x] All 177 taskworker tests pass
- [x] BurstTaskRunner tests pass (80/80)
- [x] Pre-commit hooks pass
kcons and others added 3 commits February 6, 2026 12:34
We care about Rule also, and this will allow us to maintain a traffic
and endpoint-based burndown tracker.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

ryan953 and others added 3 commits February 6, 2026 13:03
The product is Root Cause Analysis now, not Autofix anymore

| Where | Before | After |
| --- | --- | --- |
| Across all the settings, projects, repos lists "Autofix" link renamed
| <img width="628" height="167" alt="SCR-20260206-lkdw"
src="https://github.com/user-attachments/assets/3c6e3b91-4208-4129-b440-a151529f73e0"
/> | <img width="627" height="174" alt="SCR-20260206-lkeu"
src="https://github.com/user-attachments/assets/4917f722-922e-4489-ab72-28b2f8fdd355"
/>
| Main seer settings, "Enable Autofix PR Creation by Default" renamed |
<img width="564" height="256" alt="SCR-20260206-lkpx"
src="https://github.com/user-attachments/assets/5081b1d3-ac19-4cfd-9c0e-03abd6963c8d"
/> | <img width="556" height="257" alt="SCR-20260206-lkqu"
src="https://github.com/user-attachments/assets/265b85f0-fad9-4355-b08d-e04f8c31f2ec"
/>
| Project List headers | <img width="915" height="192"
alt="SCR-20260206-llfs"
src="https://github.com/user-attachments/assets/8beceec3-2d77-4d60-9544-bef5982f5b71"
/> | <img width="916" height="194" alt="SCR-20260206-lldz"
src="https://github.com/user-attachments/assets/5cee355e-1156-4fdf-aff0-72439641eb4f"
/>
| Repo list header order | <img width="925" height="127"
alt="SCR-20260206-llra"
src="https://github.com/user-attachments/assets/af221517-b8a3-4aaa-aa7c-7e46e6aa6186"
/> | <img width="910" height="120" alt="SCR-20260206-llrz"
src="https://github.com/user-attachments/assets/932b986c-ac61-46b1-9463-784722a2821e"
/>
Updated test expectations to match the new avatar behavior where initials
are generated from display names instead of slugs.

Changes:
- Team avatar: Expected initials "TS" → "TN" (from "Team Name" not "team-slug")
- Organization avatar: Expected initials "OS" → "ON" (from "Organization Name" not "org-slug")
- Changed test ID from "default-avatar" → "letter_avatar-avatar" to match new Avatar component behavior

This is the correct behavior - avatars should use human-readable names for
initials rather than technical slugs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.