Skip to content

Commit 38ce23b

Browse files
authored
Merge branch 'master' into seer/use-billing-endpoints
2 parents c5a0db2 + 76f6e1d commit 38ce23b

File tree

213 files changed

+4061
-3478
lines changed

Some content is hidden

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

213 files changed

+4061
-3478
lines changed

.github/workflows/acceptance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
8585
with:
8686
path: ${{ steps.config.outputs.webpack-path }}
87-
key: ${{ runner.os }}-v2-webpack-cache-${{ hashFiles('webpack.config.ts') }}
87+
key: ${{ runner.os }}-v2-webpack-cache-${{ hashFiles('rspack.config.ts', 'yarn.lock', 'package.json') }}
8888

8989
- name: node_modules cache
9090
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0

fixtures/stubs-for-mypy/progressbar/__init__.pyi

Lines changed: 0 additions & 2 deletions
This file was deleted.

fixtures/stubs-for-mypy/progressbar/bar.pyi

Lines changed: 0 additions & 14 deletions
This file was deleted.

fixtures/stubs-for-mypy/progressbar/widgets.pyi

Lines changed: 0 additions & 4 deletions
This file was deleted.

migrations_lockfile.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ remote_subscriptions: 0003_drop_remote_subscription
2121

2222
replays: 0005_drop_replay_index
2323

24-
sentry: 0903_missing_indexes_in_state
24+
sentry: 0904_onboarding_task_project_id_idx
2525

2626
social_auth: 0002_default_auto_field
2727

2828
tempest: 0002_make_message_type_nullable
2929

3030
uptime: 0042_extra_uptime_indexes
3131

32-
workflow_engine: 0062_workflow_engine_missing_indexes
32+
workflow_engine: 0065_add_status_to_detector_and_workflow

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@
267267
"deref-api-docs": "ts-node api-docs/index.ts tests/apidocs/openapi-spectacular.json tests/apidocs/openapi-derefed.json",
268268
"build-chartcuterie-config": "node --experimental-strip-types config/build-chartcuterie.ts",
269269
"build-acceptance-rspack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production rspack",
270-
"build-acceptance": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production webpack",
270+
"build-acceptance-webpack": "CODECOV_ENABLE_BA=false IS_ACCEPTANCE_TEST=1 NODE_ENV=production webpack",
271+
"build-acceptance": "yarn build-acceptance-rspack",
271272
"build-production": "NODE_ENV=production webpack --mode production",
272273
"build-production-rspack": "NODE_ENV=production rspack --mode production",
273274
"build": "NODE_OPTIONS=--max-old-space-size=4096 webpack",

requirements-base.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,14 @@ parsimonious>=0.10.0
4242
petname>=2.6
4343
phonenumberslite>=8.12.32
4444
Pillow>=11.0.0
45-
progressbar2>=3.41.0
4645
protobuf>=5.27.3
4746
proto-plus>=1.25.0
4847
python-rapidjson>=1.4
4948
psutil>=5.9.2
5049
psycopg2-binary>=2.9.10
5150
PyJWT>=2.4.0
5251
pydantic>=1.10.20,<2
53-
python-dateutil>=2.9.0
52+
python-dateutil>=2.9.0.post0
5453
pymemcache
5554
python-u2flib-server>=5.0.0
5655
fido2>=0.9.2
@@ -71,7 +70,7 @@ sentry-ophio>=1.1.3
7170
sentry-protos==0.2.0
7271
sentry-redis-tools>=0.5.0
7372
sentry-relay>=0.9.9
74-
sentry-sdk[http2]>=2.25.1
73+
sentry-sdk[http2]>=2.29.1
7574
slack-sdk>=3.27.2
7675
snuba-sdk>=3.0.43
7776
simplejson>=3.17.6

requirements-dev-frozen.txt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ django==5.2.1
4444
django-crispy-forms==1.14.0
4545
django-csp==3.8
4646
django-pg-zero-downtime-migrations==0.18
47-
django-stubs-ext==5.1.3
47+
django-stubs-ext==5.2.0
4848
djangorestframework==3.16.0
4949
docker==7.1.0
5050
drf-spectacular==0.27.2
@@ -129,8 +129,7 @@ pip-tools==7.1.0
129129
platformdirs==4.2.0
130130
pluggy==1.5.0
131131
pre-commit==4.2.0
132-
progressbar2==3.41.0
133-
prompt-toolkit==3.0.41
132+
prompt-toolkit==3.0.51
134133
proto-plus==1.25.0
135134
protobuf==5.27.3
136135
psutil==5.9.7
@@ -155,10 +154,9 @@ pytest-rerunfailures==15.0
155154
pytest-sentry==0.3.0
156155
pytest-workaround-12888==1.0.0
157156
pytest-xdist==3.0.2
158-
python-dateutil==2.9.0
157+
python-dateutil==2.9.0.post0
159158
python-rapidjson==1.8
160159
python-u2flib-server==5.0.0
161-
python-utils==3.3.3
162160
python3-saml==1.15.0
163161
pyupgrade==3.19.1
164162
pyuwsgi==2.0.28.post1
@@ -184,18 +182,18 @@ sentry-arroyo==2.21.0
184182
sentry-cli==2.16.0
185183
sentry-covdefaults-disable-branch-coverage==1.0.2
186184
sentry-devenv==1.20.0
187-
sentry-forked-django-stubs==5.1.3.post2
188-
sentry-forked-djangorestframework-stubs==3.15.3.post1
185+
sentry-forked-django-stubs==5.2.0.post3
186+
sentry-forked-djangorestframework-stubs==3.16.0.post1
189187
sentry-forked-email-reply-parser==0.5.12.post1
190188
sentry-kafka-schemas==1.3.2
191189
sentry-ophio==1.1.3
192190
sentry-protos==0.2.0
193191
sentry-redis-tools==0.5.0
194192
sentry-relay==0.9.9
195-
sentry-sdk==2.27.0
193+
sentry-sdk==2.29.1
196194
sentry-usage-accountant==0.0.10
197195
simplejson==3.17.6
198-
six==1.16.0
196+
six==1.17.0
199197
slack-sdk==3.27.2
200198
sniffio==1.3.1
201199
snuba-sdk==3.0.43
@@ -234,15 +232,15 @@ types-setuptools==69.0.0.0
234232
types-simplejson==3.17.7.2
235233
types-unidiff==0.7.0.20240505
236234
typing-extensions==4.12.0
237-
tzdata==2023.3
235+
tzdata==2025.2
238236
ua-parser==0.10.0
239237
unidiff==0.7.4
240238
uritemplate==4.1.1
241239
urllib3==2.2.2
242240
vine==5.1.0
243241
virtualenv==20.26.6
244242
vroomrs==0.1.4
245-
wcwidth==0.2.10
243+
wcwidth==0.2.13
246244
werkzeug==3.0.6
247245
wheel==0.38.4
248246
wrapt==1.17.0

requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ pip-tools>=7.1.0
3838
packaging>=21.3
3939

4040
# for type checking
41-
sentry-forked-django-stubs>=5.1.3.post2
42-
sentry-forked-djangorestframework-stubs>=3.15.3.post1
41+
sentry-forked-django-stubs>=5.2.0.post3
42+
sentry-forked-djangorestframework-stubs>=3.16.0.post1
4343
lxml-stubs
4444
msgpack-types>=0.2.0
4545
mypy>=1.15

requirements-frozen.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ parsimonious==0.10.0
8888
petname==2.6
8989
phonenumberslite==8.12.55
9090
pillow==11.0.0
91-
progressbar2==3.41.0
92-
prompt-toolkit==3.0.41
91+
prompt-toolkit==3.0.51
9392
proto-plus==1.25.0
9493
protobuf==5.27.3
9594
psutil==5.9.7
@@ -101,10 +100,9 @@ pycparser==2.21
101100
pydantic==1.10.20
102101
pyjwt==2.4.0
103102
pymemcache==4.0.0
104-
python-dateutil==2.9.0
103+
python-dateutil==2.9.0.post0
105104
python-rapidjson==1.8
106105
python-u2flib-server==5.0.0
107-
python-utils==3.3.3
108106
python3-saml==1.15.0
109107
pyuwsgi==2.0.28.post1
110108
pyvat==1.3.15
@@ -130,10 +128,10 @@ sentry-ophio==1.1.3
130128
sentry-protos==0.2.0
131129
sentry-redis-tools==0.5.0
132130
sentry-relay==0.9.9
133-
sentry-sdk==2.27.0
131+
sentry-sdk==2.29.1
134132
sentry-usage-accountant==0.0.10
135133
simplejson==3.17.6
136-
six==1.16.0
134+
six==1.17.0
137135
slack-sdk==3.27.2
138136
sniffio==1.3.1
139137
snuba-sdk==3.0.43
@@ -148,14 +146,14 @@ tldextract==5.1.2
148146
toronado==0.1.0
149147
tqdm==4.66.4
150148
typing-extensions==4.12.0
151-
tzdata==2023.3
149+
tzdata==2025.2
152150
ua-parser==0.10.0
153151
unidiff==0.7.4
154152
uritemplate==4.1.1
155153
urllib3==2.2.2
156154
vine==5.1.0
157155
vroomrs==0.1.4
158-
wcwidth==0.2.10
156+
wcwidth==0.2.13
159157
xmlsec==1.3.14
160158
zstandard==0.18.0
161159

rspack.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ if (env.WEBPACK_CACHE_PATH) {
768768
// https://rspack.dev/config/experiments#cachestorage
769769
storage: {
770770
type: 'filesystem',
771-
directory: env.WEBPACK_CACHE_PATH,
771+
directory: path.join(__dirname, env.WEBPACK_CACHE_PATH),
772772
},
773773
};
774774
}

src/sentry/api/bases/organization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
from sentry.utils import auth
3838
from sentry.utils.hashlib import hash_values
3939
from sentry.utils.numbers import format_grouped_length
40-
from sentry.utils.sdk import bind_organization_context, set_measurement
40+
from sentry.utils.sdk import bind_organization_context, set_span_data
4141

4242

4343
class NoProjects(Exception):
@@ -566,7 +566,7 @@ def get_filter_params(
566566
len_projects = len(projects)
567567
sentry_sdk.set_tag("query.num_projects", len_projects)
568568
sentry_sdk.set_tag("query.num_projects.grouped", format_grouped_length(len_projects))
569-
set_measurement("query.num_projects", len_projects)
569+
set_span_data("query.num_projects", len_projects)
570570

571571
params: FilterParams = {
572572
"start": start,

src/sentry/api/endpoints/accept_organization_invite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929

3030
def handle_empty_organization_id_or_slug(
31-
member_id: int, user_id: int, request: HttpRequest
31+
member_id: int, user_id: int | None, request: HttpRequest
3232
) -> RpcUserInviteContext | None:
3333
member_mapping: OrganizationMemberMapping | None = None
3434
member_mappings: Mapping[int, OrganizationMemberMapping] = {
@@ -70,7 +70,7 @@ def handle_empty_organization_id_or_slug(
7070
def get_invite_state(
7171
member_id: int,
7272
organization_id_or_slug: int | str | None,
73-
user_id: int,
73+
user_id: int | None,
7474
request: HttpRequest,
7575
) -> RpcUserInviteContext | None:
7676

src/sentry/api/endpoints/accept_project_transfer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from sentry.models.organization import Organization
2020
from sentry.models.project import Project
2121
from sentry.signals import project_transferred
22+
from sentry.users.models.user import User
2223
from sentry.utils import metrics
2324
from sentry.utils.signing import unsign
2425

@@ -36,7 +37,7 @@ class AcceptProjectTransferEndpoint(Endpoint):
3637
authentication_classes = (SessionAuthentication,)
3738
permission_classes = (SentryIsAuthenticated,)
3839

39-
def get_validated_data(self, data, user):
40+
def get_validated_data(self, data, user: User):
4041
try:
4142
data = unsign(force_str(data), salt=SALT)
4243
except SignatureExpired:
@@ -64,6 +65,9 @@ def get_validated_data(self, data, user):
6465

6566
@sudo_required
6667
def get(self, request: Request) -> Response:
68+
if not request.user.is_authenticated:
69+
return Response(status=400)
70+
6771
try:
6872
data = request.GET["data"]
6973
except KeyError:
@@ -92,6 +96,9 @@ def get(self, request: Request) -> Response:
9296

9397
@sudo_required
9498
def post(self, request: Request) -> Response:
99+
if not request.user.is_authenticated:
100+
return Response(status=400)
101+
95102
try:
96103
data = request.data["data"]
97104
except KeyError:

src/sentry/api/endpoints/api_authorizations.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ class ApiAuthorizationsEndpoint(Endpoint):
2727
permission_classes = (SentryIsAuthenticated,)
2828

2929
def get(self, request: Request) -> Response:
30+
if not request.user.is_authenticated:
31+
return Response(status=400)
32+
3033
queryset = ApiAuthorization.objects.filter(
3134
user_id=request.user.id, application__status=ApiApplicationStatus.active
3235
).select_related("application")
@@ -40,6 +43,9 @@ def get(self, request: Request) -> Response:
4043
)
4144

4245
def delete(self, request: Request) -> Response:
46+
if not request.user.is_authenticated:
47+
return Response(status=400)
48+
4349
authorization = request.data.get("authorization")
4450
if not authorization:
4551
return Response({"authorization": ""}, status=400)

src/sentry/api/endpoints/api_tokens.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def get_appropriate_user_id(request: Request) -> int:
3939
For GET endpoints, the GET dict is used.
4040
For all others, the DATA dict is used.
4141
"""
42+
assert request.user.is_authenticated
43+
4244
# Get the user id for the user that made the current request as a baseline default
4345
user_id = request.user.id
4446
if has_elevated_mode(request):

src/sentry/api/endpoints/assistant.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ class AssistantEndpoint(Endpoint):
6565

6666
def get(self, request: Request) -> Response:
6767
"""Return all the guides with a 'seen' attribute if it has been 'viewed' or 'dismissed'."""
68+
if not request.user.is_authenticated:
69+
return Response(status=400)
70+
6871
seen_ids = set(
6972
AssistantActivity.objects.filter(user_id=request.user.id).values_list(
7073
"guide_id", flat=True
@@ -85,6 +88,9 @@ def put(self, request: Request):
8588
'useful' (optional): true / false,
8689
}
8790
"""
91+
if not request.user.is_authenticated:
92+
return Response(status=400)
93+
8894
serializer = AssistantSerializer(data=request.data)
8995

9096
if not serializer.is_valid():

src/sentry/api/endpoints/broadcast_details.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ def get(self, request: Request, broadcast_id) -> Response:
6060
return self._serialize_response(request, broadcast)
6161

6262
def put(self, request: Request, broadcast_id) -> Response:
63+
if not request.user.is_authenticated:
64+
return Response(status=400)
65+
6366
broadcast = self._get_broadcast(request, broadcast_id)
6467
validator = self._get_validator(request)(data=request.data, partial=True)
6568
if not validator.is_valid():

src/sentry/api/endpoints/broadcast_index.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,10 @@ def get(
132132
paginator_cls=paginator_cls,
133133
)
134134

135-
def put(self, request: Request):
135+
def put(self, request: Request) -> Response:
136+
if not request.user.is_authenticated:
137+
return Response(status=401)
138+
136139
validator = BroadcastValidator(data=request.data, partial=True)
137140
if not validator.is_valid():
138141
return self.respond(validator.errors, status=400)
@@ -146,9 +149,6 @@ def put(self, request: Request):
146149
queryset = queryset.filter(id__in=ids)
147150

148151
if result.get("hasSeen"):
149-
if not request.user.is_authenticated:
150-
return self.respond(status=401)
151-
152152
if ids:
153153
unseen_queryset = queryset
154154
else:
@@ -166,6 +166,8 @@ def put(self, request: Request):
166166
return self.respond(result)
167167

168168
def post(self, request: Request) -> Response:
169+
if not request.user.is_authenticated:
170+
return Response(status=400)
169171
if not request.access.has_permission("broadcasts.admin"):
170172
return self.respond(status=401)
171173

src/sentry/api/endpoints/group_autofix_setup_check.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ def get(self, request: Request, group: Group) -> Response:
100100
"""
101101
Checks if we are able to run Autofix on the given group.
102102
"""
103+
if not request.user.is_authenticated:
104+
return Response(status=400)
105+
103106
org: Organization = request.organization
104107

105108
integration_check = None

0 commit comments

Comments
 (0)