Skip to content

Commit fa3e938

Browse files
authored
Merge branch 'master' into ryan953/rm-nonbadges
2 parents 8dd3139 + d8f7510 commit fa3e938

File tree

156 files changed

+2555
-2009
lines changed

Some content is hidden

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

156 files changed

+2555
-2009
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: 'Collect Test Data'
2+
description: 'Collects test data and uploads it to our internal test data collection service.'
3+
4+
inputs:
5+
artifact_path:
6+
description: 'Path to test data output artifact to upload to our internal test data collection service'
7+
required: true
8+
gcs_bucket:
9+
description: 'The GCS bucket to upload the test data to'
10+
required: true
11+
gcp_project_id:
12+
description: 'The GCP project ID to use for uploading the test data'
13+
required: true
14+
workload_identity_provider:
15+
description: 'The workload identity provider to use for uploading the test data'
16+
required: true
17+
service_account_email:
18+
description: 'The service account email to use for uploading the test data'
19+
required: true
20+
matrix_instance_number:
21+
description: 'The instance number of the matrix job'
22+
required: false
23+
24+
runs:
25+
using: 'composite'
26+
steps:
27+
- name: Collect test data
28+
uses: getsentry/action-collect-test-data@c0a2fd3f79d3867e2c8b486ccb1c4bf925477742 # v0.3.0
29+
with:
30+
path: ${{ inputs.artifact_path }}
31+
gcs_path: ${{ inputs.gcs_bucket }}/pytest/${{ github.repository }}/${{ github.workflow }}/${{ github.job }}${{ inputs.matrix_instance_number != '' && '/instance' || '' }}${{ inputs.matrix_instance_number != '' && inputs.matrix_instance_number || '' }}/${{ github.repository_id }}/${{ github.run_id }}/${{ github.run_attempt }}
32+
gcp_project_id: ${{ inputs.gcp_project_id }}
33+
workload_identity_provider: ${{ inputs.workload_identity_provider }}
34+
service_account_email: ${{ inputs.service_account_email }}
35+
continue-on-error: true

.github/workflows/acceptance.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
name: acceptance
4747
runs-on: ubuntu-22.04
4848
timeout-minutes: 30
49+
permissions:
50+
contents: read
51+
id-token: write
4952
strategy:
5053
# This helps not having to run multiple jobs because one fails, thus, reducing resource usage
5154
# and reducing the risk that one of many runs would turn red again (read: intermittent tests)
@@ -113,6 +116,17 @@ jobs:
113116
- name: Run acceptance tests (#${{ steps.setup.outputs.matrix-instance-number }} of ${{ steps.setup.outputs.matrix-instance-total }})
114117
run: make run-acceptance
115118

119+
- name: Collect test data
120+
uses: ./.github/actions/collect-test-data
121+
if: ${{ !cancelled() && needs.files-changed.outputs.backend_all == 'true' }}
122+
with:
123+
artifact_path: .artifacts/pytest.acceptance.json
124+
gcs_bucket: ${{ secrets.COLLECT_TEST_DATA_GCS_BUCKET }}
125+
gcp_project_id: ${{ secrets.COLLECT_TEST_DATA_GCP_PROJECT_ID }}
126+
workload_identity_provider: ${{ secrets.SENTRY_GCP_DEV_WORKLOAD_IDENTITY_POOL }}
127+
service_account_email: ${{ secrets.COLLECT_TEST_DATA_SERVICE_ACCOUNT_EMAIL }}
128+
matrix_instance_number: ${{ steps.setup.outputs.matrix-instance-number }}
129+
116130
# This job runs when FE or BE changes happen, however, we only upload coverage data for
117131
# BE changes since it conflicts with codecov's carry forward functionality
118132
# Upload coverage data even if running the tests step fails since

.github/workflows/backend.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ jobs:
6767
name: backend test
6868
runs-on: ubuntu-22.04
6969
timeout-minutes: 60
70+
permissions:
71+
contents: read
72+
id-token: write
7073
strategy:
7174
# This helps not having to run multiple jobs because one fails, thus, reducing resource usage
7275
# and reducing the risk that one of many runs would turn red again (read: intermittent tests)
@@ -106,6 +109,17 @@ jobs:
106109
run: |
107110
make test-python-ci
108111
112+
- name: Collect test data
113+
uses: ./.github/actions/collect-test-data
114+
if: ${{ !cancelled() }}
115+
with:
116+
artifact_path: .artifacts/pytest.json
117+
gcs_bucket: ${{ secrets.COLLECT_TEST_DATA_GCS_BUCKET }}
118+
gcp_project_id: ${{ secrets.COLLECT_TEST_DATA_GCP_PROJECT_ID }}
119+
workload_identity_provider: ${{ secrets.SENTRY_GCP_DEV_WORKLOAD_IDENTITY_POOL }}
120+
service_account_email: ${{ secrets.COLLECT_TEST_DATA_SERVICE_ACCOUNT_EMAIL }}
121+
matrix_instance_number: ${{ steps.setup.outputs.matrix-instance-number }}
122+
109123
# Upload coverage data even if running the tests step fails since
110124
# it reduces large coverage fluctuations
111125
- name: Handle artifacts
@@ -245,6 +259,9 @@ jobs:
245259
name: monolith-dbs test
246260
runs-on: ubuntu-22.04
247261
timeout-minutes: 20
262+
permissions:
263+
contents: read
264+
id-token: write
248265
steps:
249266
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
250267
with:
@@ -260,6 +277,16 @@ jobs:
260277
run: |
261278
make test-monolith-dbs
262279
280+
- name: Collect test data
281+
uses: ./.github/actions/collect-test-data
282+
if: ${{ !cancelled() }}
283+
with:
284+
artifact_path: .artifacts/pytest.monolith-dbs.json
285+
gcs_bucket: ${{ secrets.COLLECT_TEST_DATA_GCS_BUCKET }}
286+
gcp_project_id: ${{ secrets.COLLECT_TEST_DATA_GCP_PROJECT_ID }}
287+
workload_identity_provider: ${{ secrets.SENTRY_GCP_DEV_WORKLOAD_IDENTITY_POOL }}
288+
service_account_email: ${{ secrets.COLLECT_TEST_DATA_SERVICE_ACCOUNT_EMAIL }}
289+
263290
# Upload coverage data even if running the tests step fails since
264291
# it reduces large coverage fluctuations
265292
- name: Handle artifacts

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fetch-release-registry:
9191

9292
run-acceptance:
9393
@echo "--> Running acceptance tests"
94-
pytest tests/acceptance --cov . --cov-report="xml:.artifacts/acceptance.coverage.xml" --json-report --json-report-file=".artifact/pytest.acceptance.json" --json-report-omit=log
94+
pytest tests/acceptance --cov . --cov-report="xml:.artifacts/acceptance.coverage.xml" --json-report --json-report-file=".artifacts/pytest.acceptance.json" --json-report-omit=log
9595
@echo ""
9696

9797
test-cli: create-db

fixtures/backup/model_dependencies/detailed.json

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,11 +1748,6 @@
17481748
"kind": "FlexibleForeignKey",
17491749
"model": "sentry.docintegration",
17501750
"nullable": false
1751-
},
1752-
"file_id": {
1753-
"kind": "ImplicitForeignKey",
1754-
"model": "sentry.file",
1755-
"nullable": true
17561751
}
17571752
},
17581753
"model": "sentry.docintegrationavatar",
@@ -1766,9 +1761,6 @@
17661761
[
17671762
"control_file_id"
17681763
],
1769-
[
1770-
"file_id"
1771-
],
17721764
[
17731765
"ident"
17741766
]
@@ -5538,11 +5530,6 @@
55385530
"model": "sentry.controlfile",
55395531
"nullable": true
55405532
},
5541-
"file_id": {
5542-
"kind": "ImplicitForeignKey",
5543-
"model": "sentry.file",
5544-
"nullable": true
5545-
},
55465533
"sentry_app": {
55475534
"kind": "FlexibleForeignKey",
55485535
"model": "sentry.sentryapp",
@@ -5560,9 +5547,6 @@
55605547
[
55615548
"control_file_id"
55625549
],
5563-
[
5564-
"file_id"
5565-
],
55665550
[
55675551
"ident"
55685552
]
@@ -5986,11 +5970,6 @@
59865970
"model": "sentry.controlfile",
59875971
"nullable": true
59885972
},
5989-
"file_id": {
5990-
"kind": "ImplicitForeignKey",
5991-
"model": "sentry.file",
5992-
"nullable": true
5993-
},
59945973
"user": {
59955974
"kind": "FlexibleForeignKey",
59965975
"model": "sentry.user",
@@ -6008,9 +5987,6 @@
60085987
[
60095988
"control_file_id"
60105989
],
6011-
[
6012-
"file_id"
6013-
],
60145990
[
60155991
"ident"
60165992
],

fixtures/backup/model_dependencies/flat.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@
240240
"sentry.docintegration": [],
241241
"sentry.docintegrationavatar": [
242242
"sentry.controlfile",
243-
"sentry.docintegration",
244-
"sentry.file"
243+
"sentry.docintegration"
245244
],
246245
"sentry.email": [],
247246
"sentry.environment": [
@@ -763,7 +762,6 @@
763762
],
764763
"sentry.sentryappavatar": [
765764
"sentry.controlfile",
766-
"sentry.file",
767765
"sentry.sentryapp"
768766
],
769767
"sentry.sentryappcomponent": [
@@ -823,7 +821,6 @@
823821
"sentry.user": [],
824822
"sentry.useravatar": [
825823
"sentry.controlfile",
826-
"sentry.file",
827824
"sentry.user"
828825
],
829826
"sentry.useremail": [

fixtures/backup/model_dependencies/sorted.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"sentry.controltombstone",
1515
"sentry.deletedorganization",
1616
"sentry.docintegration",
17+
"sentry.docintegrationavatar",
1718
"sentry.fileblob",
1819
"sentry.identityprovider",
1920
"sentry.integration",
@@ -51,6 +52,7 @@
5152
"sentry.team",
5253
"sentry.teamreplica",
5354
"sentry.user",
55+
"sentry.useravatar",
5456
"sentry.userip",
5557
"sentry.useroption",
5658
"sentry.userpermission",
@@ -92,7 +94,6 @@
9294
"sentry.eventattachment",
9395
"sentry.environment",
9496
"sentry.email",
95-
"sentry.docintegrationavatar",
9697
"sentry.distribution",
9798
"sentry.discoversavedquery",
9899
"sentry.deploy",
@@ -124,7 +125,6 @@
124125
"feedback.feedback",
125126
"sentry.userreport",
126127
"sentry.useremail",
127-
"sentry.useravatar",
128128
"sentry.teamkeytransaction",
129129
"sentry.snubaquery",
130130
"sentry.sentryapp",

fixtures/backup/model_dependencies/truncate.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"sentry_controltombstone",
1515
"sentry_deletedorganization",
1616
"sentry_docintegration",
17+
"sentry_docintegrationavatar",
1718
"sentry_fileblob",
1819
"sentry_identityprovider",
1920
"sentry_integration",
@@ -51,6 +52,7 @@
5152
"sentry_team",
5253
"sentry_teamreplica",
5354
"auth_user",
55+
"sentry_useravatar",
5456
"sentry_userip",
5557
"sentry_useroption",
5658
"sentry_userpermission",
@@ -92,7 +94,6 @@
9294
"sentry_eventattachment",
9395
"sentry_environment",
9496
"sentry_email",
95-
"sentry_docintegrationavatar",
9697
"sentry_distribution",
9798
"sentry_discoversavedquery",
9899
"sentry_deploy",
@@ -124,7 +125,6 @@
124125
"feedback_feedback",
125126
"sentry_userreport",
126127
"sentry_useremail",
127-
"sentry_useravatar",
128128
"sentry_performanceteamkeytransaction",
129129
"sentry_snubaquery",
130130
"sentry_sentryapp",

fixtures/js-stubs/monitor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
ScheduleType,
66
} from 'sentry/views/monitors/types';
77

8+
import {ActorFixture} from './actor';
89
import {ProjectFixture} from './project';
9-
import {UserFixture} from './user';
1010

1111
export function MonitorFixture(params: Partial<Monitor> = {}): Monitor {
1212
return {
@@ -16,7 +16,7 @@ export function MonitorFixture(params: Partial<Monitor> = {}): Monitor {
1616
project: ProjectFixture(),
1717
slug: 'my-monitor',
1818
status: 'active',
19-
owner: `user:${UserFixture().id}`,
19+
owner: ActorFixture(),
2020
type: MonitorType.CRON_JOB,
2121
config: {
2222
checkin_margin: 5,

migrations_lockfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ feedback: 0004_index_together
99
hybridcloud: 0016_add_control_cacheversion
1010
nodestore: 0002_nodestore_no_dictfield
1111
replays: 0004_index_together
12-
sentry: 0697_remove_monitor_owner_actor_id_db
12+
sentry: 0698_remove_file_id_from_control_avatars
1313
social_auth: 0002_default_auto_field

requirements-base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ sentry-arroyo>=2.16.5
6666
sentry-kafka-schemas>=0.1.68
6767
sentry-ophio==0.2.7
6868
sentry-redis-tools>=0.1.7
69-
sentry-relay>=0.8.56
69+
sentry-relay>=0.8.57
7070
sentry-sdk==2.0.0rc3
7171
snuba-sdk>=2.0.32
7272
simplejson>=3.17.6

requirements-dev-frozen.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ sentry-forked-djangorestframework-stubs==3.14.5.post1
183183
sentry-kafka-schemas==0.1.68
184184
sentry-ophio==0.2.7
185185
sentry-redis-tools==0.1.7
186-
sentry-relay==0.8.56
186+
sentry-relay==0.8.57
187187
sentry-sdk==2.0.0rc3
188188
sentry-usage-accountant==0.0.10
189189
simplejson==3.17.6

requirements-frozen.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ sentry-arroyo==2.16.5
123123
sentry-kafka-schemas==0.1.68
124124
sentry-ophio==0.2.7
125125
sentry-redis-tools==0.1.7
126-
sentry-relay==0.8.56
126+
sentry-relay==0.8.57
127127
sentry-sdk==2.0.0rc3
128128
sentry-usage-accountant==0.0.10
129129
simplejson==3.17.6

src/sentry/api/endpoints/event_owners.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
from sentry.api.bases.project import ProjectEndpoint
99
from sentry.api.serializers import serialize
1010
from sentry.api.serializers.models.actor import ActorSerializer
11-
from sentry.models.actor import ActorTuple
1211
from sentry.models.projectownership import ProjectOwnership
1312
from sentry.models.team import Team
13+
from sentry.utils.actor import ActorTuple
1414

1515

1616
@region_silo_endpoint

src/sentry/api/fields/actor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
from drf_spectacular.utils import extend_schema_field
55
from rest_framework import serializers
66

7-
from sentry.models.actor import ActorTuple
87
from sentry.models.organizationmember import OrganizationMember
98
from sentry.models.team import Team
109
from sentry.models.user import User
10+
from sentry.utils.actor import ActorTuple
1111

1212

1313
@extend_schema_field(field=OpenApiTypes.STR)

src/sentry/api/helpers/group_index/update.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from sentry.issues.status_change import handle_status_update
2828
from sentry.issues.update_inbox import update_inbox
2929
from sentry.models.activity import Activity, ActivityIntegration
30-
from sentry.models.actor import Actor, ActorTuple
30+
from sentry.models.actor import Actor
3131
from sentry.models.group import STATUS_UPDATE_CHOICES, Group, GroupStatus
3232
from sentry.models.groupassignee import GroupAssignee
3333
from sentry.models.groupbookmark import GroupBookmark
@@ -56,6 +56,7 @@
5656
from sentry.types.activity import ActivityType
5757
from sentry.types.group import SUBSTATUS_UPDATE_CHOICES, GroupSubStatus, PriorityLevel
5858
from sentry.utils import metrics
59+
from sentry.utils.actor import ActorTuple
5960

6061
from . import ACTIVITIES_COUNT, BULK_MUTATION_LIMIT, SearchFunction, delete_group_list
6162
from .validators import GroupValidator, ValidationError

src/sentry/api/serializers/models/project.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,9 +1046,11 @@ def format_options(self, attrs: dict[str, Any]) -> dict[str, Any]:
10461046
self.get_value_with_default(attrs, "sentry:feedback_user_report_notifications")
10471047
),
10481048
"sentry:feedback_ai_spam_detection": bool(
1049-
options.get("sentry:feedback_ai_spam_detection")
1049+
self.get_value_with_default(attrs, "sentry:feedback_ai_spam_detection")
1050+
),
1051+
"sentry:replay_rage_click_issues": self.get_value_with_default(
1052+
attrs, "sentry:replay_rage_click_issues"
10501053
),
1051-
"sentry:replay_rage_click_issues": options.get("sentry:replay_rage_click_issues"),
10521054
"quotas:spike-protection-disabled": options.get("quotas:spike-protection-disabled"),
10531055
}
10541056

0 commit comments

Comments
 (0)