Skip to content

Commit 397e6c1

Browse files
committed
Merge branch 'master' into ryan953/codeowner-coverage-in-precommit
2 parents 1785e7c + b7608da commit 397e6c1

File tree

72 files changed

+1859
-1022
lines changed

Some content is hidden

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

72 files changed

+1859
-1022
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get
439439
/static/app/components/loading/ @getsentry/app-frontend
440440
/static/app/components/events/interfaces/ @getsentry/app-frontend
441441
/static/app/components/forms/ @getsentry/app-frontend
442+
/static/app/components/markdownTextArea.tsx @getsentry/app-frontend
442443
/static/app/locale.tsx @getsentry/app-frontend
443444
## End of Frontend
444445

migrations_lockfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ replays: 0007_organizationmember_replay_access
3131

3232
seer: 0005_delete_seerorganizationsettings
3333

34-
sentry: 1062_backfill_eventattachment_date_expires
34+
sentry: 1063_remove_customdynamicsamplingrule
3535

3636
social_auth: 0003_social_auth_json_field
3737

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Generated by Django 5.2.11 on 2026-04-02
2+
import django.db.models.deletion
3+
from django.db import migrations
4+
5+
import sentry.db.models.fields.foreignkey
6+
from sentry.new_migrations.migrations import CheckedMigration
7+
from sentry.new_migrations.monkey.models import SafeDeleteModel
8+
from sentry.new_migrations.monkey.state import DeletionAction
9+
10+
11+
class Migration(CheckedMigration):
12+
is_post_deployment = False
13+
14+
dependencies = [
15+
("sentry", "1062_backfill_eventattachment_date_expires"),
16+
]
17+
18+
operations = [
19+
migrations.AlterField(
20+
model_name="customdynamicsamplingruleproject",
21+
name="custom_dynamic_sampling_rule",
22+
field=sentry.db.models.fields.foreignkey.FlexibleForeignKey(
23+
db_constraint=False,
24+
on_delete=django.db.models.deletion.CASCADE,
25+
to="sentry.customdynamicsamplingrule",
26+
),
27+
),
28+
migrations.AlterField(
29+
model_name="customdynamicsamplingruleproject",
30+
name="project",
31+
field=sentry.db.models.fields.foreignkey.FlexibleForeignKey(
32+
db_constraint=False,
33+
on_delete=django.db.models.deletion.CASCADE,
34+
to="sentry.project",
35+
),
36+
),
37+
migrations.AlterField(
38+
model_name="customdynamicsamplingrule",
39+
name="organization",
40+
field=sentry.db.models.fields.foreignkey.FlexibleForeignKey(
41+
db_constraint=False,
42+
on_delete=django.db.models.deletion.CASCADE,
43+
to="sentry.organization",
44+
),
45+
),
46+
SafeDeleteModel(
47+
name="CustomDynamicSamplingRuleProject",
48+
deletion_action=DeletionAction.MOVE_TO_PENDING,
49+
),
50+
SafeDeleteModel(
51+
name="CustomDynamicSamplingRule",
52+
deletion_action=DeletionAction.MOVE_TO_PENDING,
53+
),
54+
]

src/sentry/models/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from .deletedteam import * # NOQA
3232
from .deploy import * # NOQA
3333
from .distribution import * # NOQA
34-
from .dynamicsampling import * # NOQA
3534
from .environment import * # NOQA
3635
from .event import * # NOQA
3736
from .eventattachment import * # NOQA

src/sentry/models/dynamicsampling.py

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

src/sentry/organizations/services/organization/impl.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from sentry.incidents.models.incident import IncidentActivity
2121
from sentry.models.activity import Activity
2222
from sentry.models.dashboard import Dashboard, DashboardFavoriteUser
23-
from sentry.models.dynamicsampling import CustomDynamicSamplingRule
2423
from sentry.models.groupassignee import GroupAssignee
2524
from sentry.models.groupbookmark import GroupBookmark
2625
from sentry.models.groupsearchview import GroupSearchView
@@ -581,7 +580,6 @@ def merge_users(self, *, organization_id: int, from_user_id: int, to_user_id: in
581580
Activity,
582581
AlertRule,
583582
AlertRuleActivity,
584-
CustomDynamicSamplingRule,
585583
Dashboard,
586584
DashboardFavoriteUser,
587585
GroupAssignee,

src/sentry/preprod/grouptype.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,7 @@
11
from __future__ import annotations
22

3-
from dataclasses import dataclass
4-
53
import sentry.preprod.size_analysis.grouptype # noqa: F401,F403
6-
from sentry.issues.grouptype import GroupCategory, GroupType
7-
from sentry.types.group import PriorityLevel
84

95
# We have to import sentry.preprod.size_analysis.grouptype above.
106
# grouptype modules in root packages (src/sentry/*) are auto imported
117
# but more deeply nested ones are not.
12-
13-
14-
@dataclass(frozen=True)
15-
class PreprodStaticGroupType(GroupType):
16-
"""
17-
Issues detected in a single uploaded artifact. For example an
18-
Android app not being 16kb page size ready.
19-
Typically these end up grouped across multiple builds e.g. if CI
20-
uploads a build of an app for each commit to main each of those
21-
uploads could result in an occurrence of some issue like the 16kb
22-
page size.
23-
"""
24-
25-
type_id = 11001
26-
slug = "preprod_static"
27-
description = "Static Analysis"
28-
category = GroupCategory.PREPROD.value
29-
category_v2 = GroupCategory.PREPROD.value
30-
default_priority = PriorityLevel.LOW
31-
released = False
32-
enable_auto_resolve = True
33-
enable_escalation_detection = False
34-
35-
36-
@dataclass(frozen=True)
37-
class PreprodDeltaGroupType(GroupType):
38-
"""
39-
Issues detected examining the delta between two uploaded artifacts.
40-
For example a binary size regression. These are typically *not*
41-
grouped. A size regression between v1 and v2 likely does not have
42-
the same root cause (and hence resolution) as another regression
43-
between v2 and v3.
44-
"""
45-
46-
type_id = 11002
47-
slug = "preprod_delta"
48-
description = "Static Analysis Delta"
49-
category = GroupCategory.PREPROD.value
50-
category_v2 = GroupCategory.PREPROD.value
51-
default_priority = PriorityLevel.LOW
52-
released = False
53-
enable_auto_resolve = True
54-
enable_escalation_detection = False

src/sentry/profiles/task.py

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from datetime import datetime, timezone
1010
from operator import itemgetter
1111
from time import time
12-
from typing import Any, TypedDict
12+
from typing import Any
1313
from uuid import UUID
1414

1515
import msgpack
@@ -58,7 +58,6 @@
5858
from sentry.profiles.utils import (
5959
Profile,
6060
apply_stack_trace_rules_to_profile,
61-
get_from_profiling_service,
6261
)
6362
from sentry.search.utils import DEVICE_CLASS
6463
from sentry.signals import first_profile_received
@@ -1075,62 +1074,6 @@ def _track_failed_outcome(profile: Profile, project: Project, reason: str) -> No
10751074
)
10761075

10771076

1078-
@metrics.wraps("process_profile.insert_vroom_profile")
1079-
def _insert_vroom_profile(profile: Profile) -> bool:
1080-
with sentry_sdk.start_span(op="task.profiling.insert_vroom"):
1081-
try:
1082-
path = "/chunk" if "profiler_id" in profile else "/profile"
1083-
response = get_from_profiling_service(
1084-
method="POST",
1085-
path=path,
1086-
json_data=profile,
1087-
metric=(
1088-
"profiling.profile.payload.size",
1089-
{
1090-
"type": "chunk" if "profiler_id" in profile else "profile",
1091-
"platform": profile["platform"],
1092-
},
1093-
),
1094-
)
1095-
1096-
sentry_sdk.set_tag("vroom.response.status_code", str(response.status))
1097-
1098-
reason = "bad status"
1099-
1100-
if response.status == 204:
1101-
return True
1102-
elif response.status == 429:
1103-
reason = "gcs timeout"
1104-
elif response.status == 412:
1105-
reason = "duplicate profile"
1106-
1107-
metrics.incr(
1108-
"process_profile.insert_vroom_profile.error",
1109-
tags={
1110-
"platform": profile["platform"],
1111-
"reason": reason,
1112-
"status_code": response.status,
1113-
},
1114-
sample_rate=1.0,
1115-
)
1116-
return False
1117-
except Exception as e:
1118-
sentry_sdk.capture_exception(e)
1119-
metrics.incr(
1120-
"process_profile.insert_vroom_profile.error",
1121-
tags={"platform": profile["platform"], "reason": "encountered error"},
1122-
sample_rate=1.0,
1123-
)
1124-
return False
1125-
1126-
1127-
def _push_profile_to_vroom(profile: Profile, project: Project) -> bool:
1128-
if _insert_vroom_profile(profile=profile):
1129-
return True
1130-
_track_failed_outcome(profile, project, "profiling_failed_vroom_insertion")
1131-
return False
1132-
1133-
11341077
def prepare_android_js_profile(profile: Profile) -> None:
11351078
profile["js_profile"] = {"profile": profile["js_profile"]}
11361079
p = profile["js_profile"]
@@ -1152,11 +1095,6 @@ def clean_android_js_profile(profile: Profile) -> None:
11521095
del p["dist"]
11531096

11541097

1155-
class _ProjectKeyKwargs(TypedDict):
1156-
project_id: int
1157-
use_case: str
1158-
1159-
11601098
@metrics.wraps("process_profile.track_outcome")
11611099
def _track_duration_outcome(
11621100
profile: Profile,

src/sentry/search/eap/preprod_size/attributes.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from typing import Literal
2+
13
from sentry.search.eap import constants
24
from sentry.search.eap.columns import ResolvedAttribute, datetime_processor
35
from sentry.search.eap.common_columns import COMMON_COLUMNS
@@ -56,6 +58,11 @@
5658
internal_name="git_head_ref",
5759
search_type="string",
5860
),
61+
ResolvedAttribute(
62+
public_alias="installable",
63+
internal_name="has_installable_file",
64+
search_type="boolean",
65+
),
5966
ResolvedAttribute(
6067
public_alias="timestamp",
6168
internal_name="sentry.timestamp",
@@ -65,3 +72,23 @@
6572
),
6673
]
6774
}
75+
76+
PREPROD_SIZE_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS: dict[
77+
Literal["string", "number", "boolean"], dict[str, str]
78+
] = {
79+
"string": {
80+
definition.internal_name: definition.public_alias
81+
for definition in PREPROD_SIZE_ATTRIBUTE_DEFINITIONS.values()
82+
if not definition.secondary_alias and definition.search_type == "string"
83+
},
84+
"boolean": {
85+
definition.internal_name: definition.public_alias
86+
for definition in PREPROD_SIZE_ATTRIBUTE_DEFINITIONS.values()
87+
if not definition.secondary_alias and definition.search_type == "boolean"
88+
},
89+
"number": {
90+
definition.internal_name: definition.public_alias
91+
for definition in PREPROD_SIZE_ATTRIBUTE_DEFINITIONS.values()
92+
if not definition.secondary_alias and definition.search_type != "string"
93+
},
94+
}

src/sentry/search/eap/utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
OURLOG_ATTRIBUTE_DEFINITIONS,
1717
)
1818
from sentry.search.eap.ourlogs.definitions import OURLOG_DEFINITIONS
19+
from sentry.search.eap.preprod_size.attributes import (
20+
PREPROD_SIZE_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
21+
)
1922
from sentry.search.eap.profile_functions.attributes import (
2023
PROFILE_FUNCTIONS_ATTRIBUTE_DEFINITIONS,
2124
PROFILE_FUNCTIONS_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
@@ -69,6 +72,7 @@ def add_start_end_conditions(
6972
SupportedTraceItemType.LOGS: LOGS_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
7073
SupportedTraceItemType.TRACEMETRICS: TRACE_METRICS_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
7174
SupportedTraceItemType.PROFILE_FUNCTIONS: PROFILE_FUNCTIONS_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
75+
SupportedTraceItemType.PREPROD: PREPROD_SIZE_INTERNAL_TO_PUBLIC_ALIAS_MAPPINGS,
7276
}
7377

7478
PUBLIC_ALIAS_TO_INTERNAL_MAPPING: dict[SupportedTraceItemType, dict[str, ResolvedAttribute]] = {

0 commit comments

Comments
 (0)