Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/codeowners-coverage-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2132,7 +2132,6 @@ tests/sentry/models/test_commitfilechange.py
tests/sentry/models/test_dashboard.py
tests/sentry/models/test_debugfile.py
tests/sentry/models/test_deploy.py
tests/sentry/models/test_dynamicsampling.py
tests/sentry/models/test_environment.py
tests/sentry/models/test_eventattachment.py
tests/sentry/models/test_eventerror.py
Expand Down
7 changes: 6 additions & 1 deletion eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,8 +539,13 @@ export default typescript.config([
'@tanstack/query': pluginQuery,
},
rules: {
...pluginQuery.configs.recommended.rules,
...pluginQuery.configs.recommendedStrict.rules,
'@tanstack/query/prefer-query-options': 'off',
'@tanstack/query/no-rest-destructuring': 'error',
'@tanstack/query/exhaustive-deps': [
'error',
{allowlist: {variables: ['api'], types: ['Client']}},
],
},
},
{
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@
"@stripe/react-stripe-js": "^3.9.2",
"@stripe/stripe-js": "^5.10.0",
"@swc/plugin-emotion": "14.3.0",
"@tanstack/query-async-storage-persister": "5.83.1",
"@tanstack/query-async-storage-persister": "5.96.0",
"@tanstack/react-devtools": "0.9.9",
"@tanstack/react-form": "1.28.6",
"@tanstack/react-form-devtools": "0.2.20",
"@tanstack/react-pacer": "^0.17.0",
"@tanstack/react-pacer-devtools": "0.5.3",
"@tanstack/react-query": "5.85.0",
"@tanstack/react-query-devtools": "5.85.0",
"@tanstack/react-query-persist-client": "5.85.0",
"@tanstack/react-query": "5.96.0",
"@tanstack/react-query-devtools": "5.96.0",
"@tanstack/react-query-persist-client": "5.96.0",
"@tanstack/react-virtual": "^3.13.6",
"@types/gtag.js": "^0.0.12",
"@types/history": "^3.2.5",
Expand Down Expand Up @@ -239,7 +239,7 @@
"@sentry/jest-environment": "6.1.0",
"@sentry/profiling-node": "10.41.0-beta.0",
"@styled/typescript-styled-plugin": "^1.0.1",
"@tanstack/eslint-plugin-query": "5.83.1",
"@tanstack/eslint-plugin-query": "5.96.0",
"@testing-library/dom": "10.4.1",
"@testing-library/jest-dom": "6.9.1",
"@testing-library/react": "16.3.2",
Expand Down
94 changes: 50 additions & 44 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions src/sentry/dynamic_sampling/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
RuleType,
get_enabled_user_biases,
get_redis_client_for_ds,
get_rule_hash,
get_supported_biases_ids,
get_user_biases,
)
Expand All @@ -25,7 +24,6 @@
"get_user_biases",
"get_enabled_user_biases",
"get_redis_client_for_ds",
"get_rule_hash",
"record_latest_release",
"RuleType",
"ExtendedBoostedRelease",
Expand Down
21 changes: 2 additions & 19 deletions src/sentry/dynamic_sampling/rules/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
from enum import Enum
from typing import Literal, NotRequired, TypedDict, Union

import orjson
from django.conf import settings
from redis import StrictRedis

from sentry.models.dynamicsampling import CUSTOM_RULE_START
from sentry.relay.types import RuleCondition
from sentry.utils import redis

CUSTOM_RULE_START = 3000

BOOSTED_RELEASES_LIMIT = 10

LATEST_RELEASES_BOOST_FACTOR = 1.5
Expand Down Expand Up @@ -117,23 +117,6 @@ class DecayingRule(Rule):
PolymorphicRule = Union[Rule, DecayingRule]


def get_rule_hash(rule: PolymorphicRule) -> int:
# We want to be explicit in what we use for computing the hash. In addition, we need to remove certain fields like
# the sampleRate.
return (
orjson.dumps(
{
"id": rule["id"],
"type": rule["type"],
"condition": rule["condition"],
},
option=orjson.OPT_SORT_KEYS,
)
.decode()
.__hash__()
)


def get_user_biases(user_set_biases: list[ActivatableBias] | None) -> list[ActivatableBias]:
if user_set_biases is None:
return DEFAULT_BIASES
Expand Down
6 changes: 5 additions & 1 deletion src/sentry/hybridcloud/apigateway_async/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import httpx
from asgiref.sync import sync_to_async
from django.conf import settings
from django.core.exceptions import RequestAborted
from django.http import HttpRequest, HttpResponse, JsonResponse, StreamingHttpResponse
from django.http.response import HttpResponseBase

Expand Down Expand Up @@ -196,7 +197,10 @@ async def proxy_cell_request(
metrics.incr("apigateway.proxy.request_failed", tags=metric_tags)
circuitbreaker.incr_failures()
return _adapt_response(resp, target_url)
except (httpx.TimeoutException, asyncio.CancelledError):
except asyncio.CancelledError:
metrics.incr("apigateway.proxy.request_aborted", tags=metric_tags)
raise RequestAborted()
except httpx.TimeoutException:
metrics.incr("apigateway.proxy.request_timeout", tags=metric_tags)
circuitbreaker.incr_failures()
# remote silo timeout. Use DRF timeout instead
Expand Down
Loading
Loading