ref(event_manager): Fix typing issues for event_manager#52888
Conversation
We want to make a lot of changes to event_manager and we need to have backend typing in place for the upcoming work. Fixes #52877
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #52888 +/- ##
==========================================
+ Coverage 74.29% 79.36% +5.07%
==========================================
Files 4931 4930 -1
Lines 207058 207070 +12
Branches 35388 35388
==========================================
+ Hits 153829 164348 +10519
+ Misses 48232 37691 -10541
- Partials 4997 5031 +34
|
| headers={"Content-Type": attachment.content_type}, | ||
| ) | ||
| file.putfile(BytesIO(data), blob_size=settings.SENTRY_ATTACHMENT_BLOB_SIZE) | ||
| file.putfile(BytesIO(data), blob_size=settings.SENTRY_ATTACHMENT_BLOB_SIZE) # type: ignore |
There was a problem hiding this comment.
I was getting this src/sentry/event_manager.py:2158: error: Argument 1 to "BytesIO" has incompatible type "Callable[[CachedAttachment], Any]"; expected "Buffer" [arg-type]
I could not figure it out.
|
|
||
| hashes.write_to_event(event.data) | ||
| # Using cast to satisfy mypy | ||
| hashes.write_to_event(cast(Dict[str, Any], event.data)) |
There was a problem hiding this comment.
I was not sure how to fix this one without getting complicated.
I was getting this message before: src/sentry/event_manager.py:2269: error: Argument 1 to "write_to_event" of "CalculatedHashes" has incompatible type "NodeData"; expected "Dict[str, Any]" [arg-type]
Here's the code for write_to_event
There was a problem hiding this comment.
cast should only be used for mypy bugs -- you'll need to fix the types here or convert -- probably by fixing the signature for write_to_event
| __all__ = [ | ||
| "CspEvent", | ||
| "DefaultEvent", | ||
| "ErrorEvent", | ||
| "ExpectCTEvent", | ||
| "ExpectStapleEvent", | ||
| "HpkpEvent", | ||
| "TransactionEvent", | ||
| ] |
There was a problem hiding this comment.
I would remove this personally -- it's better to import explicitly since __init__.py makes it much easier to introduce import cycles and to worsen startup performance
Consider the following situation: 1. Symbolicator needs the bundle for release `foo`, dist `1` that contains `https://example.com/main.dart.js`. 2. URL search is not exact. Symbolicator asks the `artifact-lookup` endpoint for a bundle with release `foo`, dist `1`, URL `/main`. 3. There are two bundles for the release/dist. Bundle 1 contains `main.dart`, bundle 2 contains `main.dart.js`. It so happens that bundle 1 is newer. 4. Bundle 1 gets returned to Symbolicator. 5. The bundle Symbolicator got back doesn't contain the file it wanted. We fix this by returning not just the first bundle that contains the URL, but up to `MAX_BUNDLES_QUERY` (=5) bundles.
resolves a migration warning: `fields.W904` ``` sentry.ReleaseActivity.data: (fields.W904) django.contrib.postgres.fields.JSONField is deprecated. Support for it (except in historical migrations) will be removed in Django 4.0. HINT: Use django.db.models.JSONField instead. ``` --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
### Summary Don't show the invalid_data errors in the UI as to not cause false alarm as this has since been fixed. ### Screenshots #### Before  #### After  --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
we are now on django 3+ <!-- Describe your PR here. -->
We were improperly mapping the dataset resulting in all calls with `query` string filtering on the `IssuePlatform` dataset. Resolves SENTRY-1379
- Remove unnecessary prop - Convert teamResolutionTime to functional
We should let self-hosted Sentry use [team-level roles](#49028).
To run the consumer issue the following command. `ingest-replay-recordings --processes NUM_CORES * 4 --max-batch-size 100`. Additional options can be specified but currently have sane defaults.
…e numeric timestamps correctly (#52828)
Closes #50697 Update sort order wording in user settings to match issue details Before: <img width="555" alt="Screenshot 2023-07-14 at 9 46 50 AM" src="https://github.com/getsentry/sentry/assets/22582037/d61e854a-91d9-4641-bfed-d97f38ef4647"> After: <img width="555" alt="Screenshot 2023-07-14 at 9 45 25 AM" src="https://github.com/getsentry/sentry/assets/22582037/8aba23a8-049e-4bac-bd31-9678895cd04c">
### Summary Adds a new detector (flags aren't going to be flipped until after audit). Servers using http/1.1 might be causing queueing behaviour on the browser when the connections reach a certain amount. This detector roughly detects overlapping spans against the same location (connections are limited per host), assuming that queue depth is causing monotonically increasing requestStart. #### Other - We'll likely need to change the network timing (`requestStart`) this currently targets, but sdk needs to be cut before that. - Our sdk collects absolute paths, so we skip url parsing in that case and use location '/' - Didn't want to have `/1.1` in filenames or enums so change the file/vars to `http overhead`. - We'll try a `500` delay threshold for now, meaning the peak of the increasing times should be 500ms. I've found existing real events that fire on this. --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
|
🚨 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 |
|
My apologies everyone. This is what I did in case we want to figure out if there's a way to prevent this:
Now I see all of these other teams tagged for the review and a bunch of code that I never added. I will close and re-open. |
We want to make a lot of changes to event_manager and we need to have backend typing in place for the upcoming work.
Fixes #52877