Skip to content

Commit a727bc0

Browse files
authored
Reorder trace annotations (#1227)
1 parent d203ad3 commit a727bc0

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

graphql_api/types/bundle_analysis/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ def resolve_modules(
139139
return bundle_asset.modules
140140

141141

142-
@sentry_sdk.trace
143142
@bundle_asset_bindable.field("measurements")
144143
@sync_to_async
144+
@sentry_sdk.trace
145145
def resolve_asset_report_measurements(
146146
bundle_asset: AssetReport,
147147
info: GraphQLResolveInfo,
@@ -188,8 +188,8 @@ def resolve_assets(
188188
return list(bundle_report.assets())
189189

190190

191-
@sentry_sdk.trace
192191
@bundle_report_bindable.field("assetsPaginated")
192+
@sentry_sdk.trace
193193
def resolve_assets_paginated(
194194
bundle_report: BundleReport,
195195
info: GraphQLResolveInfo,
@@ -283,9 +283,9 @@ def resolve_bundle_report_filtered(
283283
)
284284

285285

286-
@sentry_sdk.trace
287286
@bundle_report_bindable.field("measurements")
288287
@sync_to_async
288+
@sentry_sdk.trace
289289
def resolve_bundle_report_measurements(
290290
bundle_report: BundleReport,
291291
info: GraphQLResolveInfo,

graphql_api/types/commit/commit.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ def resolve_list_uploads(commit: Commit, info, **kwargs):
103103
)
104104

105105

106-
@sentry_sdk.trace
107106
@commit_bindable.field("compareWithParent")
107+
@sentry_sdk.trace
108108
async def resolve_compare_with_parent(commit: Commit, info, **kwargs):
109109
if not commit.parent_commit_id:
110110
return MissingBaseCommit()
@@ -286,16 +286,16 @@ async def resolve_total_uploads(commit, info):
286286
return await command.get_uploads_number(commit)
287287

288288

289-
@sentry_sdk.trace
290289
@commit_bindable.field("bundleStatus")
291290
@sync_to_async
291+
@sentry_sdk.trace
292292
def resolve_bundle_status(commit: Commit, info) -> Optional[CommitStatus]:
293293
return commit_status(commit, CommitReport.ReportType.BUNDLE_ANALYSIS)
294294

295295

296-
@sentry_sdk.trace
297296
@commit_bindable.field("coverageStatus")
298297
@sync_to_async
298+
@sentry_sdk.trace
299299
def resolve_coverage_status(commit: Commit, info) -> Optional[CommitStatus]:
300300
return commit_status(commit, CommitReport.ReportType.COVERAGE)
301301

@@ -313,25 +313,25 @@ def resolve_commit_bundle_analysis(commit, info):
313313
### Commit Coverage Bindable ###
314314

315315

316-
@sentry_sdk.trace
317316
@commit_coverage_analytics_bindable.field("totals")
317+
@sentry_sdk.trace
318318
def resolve_coverage_totals(
319319
commit: Commit, info: GraphQLResolveInfo
320320
) -> Optional[ReportTotals]:
321321
command = info.context["executor"].get_command("commit")
322322
return command.fetch_totals(commit)
323323

324324

325-
@sentry_sdk.trace
326325
@commit_coverage_analytics_bindable.field("flagNames")
327326
@sync_to_async
327+
@sentry_sdk.trace
328328
def resolve_coverage_flags(commit: Commit, info: GraphQLResolveInfo) -> list[str]:
329329
return commit.full_report.get_flag_names() if commit.full_report else []
330330

331331

332-
@sentry_sdk.trace
333332
@commit_coverage_analytics_bindable.field("coverageFile")
334333
@sync_to_async
334+
@sentry_sdk.trace
335335
def resolve_coverage_file(commit, info, path, flags=None, components=None):
336336
fallback_file, paths = None, []
337337
if components:
@@ -358,9 +358,9 @@ def resolve_coverage_file(commit, info, path, flags=None, components=None):
358358
}
359359

360360

361-
@sentry_sdk.trace
362361
@commit_coverage_analytics_bindable.field("components")
363362
@sync_to_async
363+
@sentry_sdk.trace
364364
def resolve_coverage_components(commit: Commit, info, filters=None) -> List[Component]:
365365
info.context["component_commit"] = commit
366366
current_owner = info.context["request"].current_owner
@@ -377,9 +377,9 @@ def resolve_coverage_components(commit: Commit, info, filters=None) -> List[Comp
377377
### Commit Bundle Analysis Bindable ###
378378

379379

380-
@sentry_sdk.trace
381380
@commit_bundle_analysis_bindable.field("bundleAnalysisCompareWithParent")
382381
@sync_to_async
382+
@sentry_sdk.trace
383383
def resolve_commit_bundle_analysis_compare_with_parent(
384384
commit: Commit, info: GraphQLResolveInfo
385385
) -> Union[BundleAnalysisComparison, Any]:
@@ -406,9 +406,9 @@ def resolve_commit_bundle_analysis_compare_with_parent(
406406
return bundle_analysis_comparison
407407

408408

409-
@sentry_sdk.trace
410409
@commit_bundle_analysis_bindable.field("bundleAnalysisReport")
411410
@sync_to_async
411+
@sentry_sdk.trace
412412
def resolve_commit_bundle_analysis_report(commit: Commit, info) -> BundleAnalysisReport:
413413
bundle_analysis_report = load_bundle_analysis_report(commit)
414414

graphql_api/types/comparison/comparison.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ async def resolve_head_totals(
156156
return head_commit.commitreport.reportleveltotals
157157

158158

159-
@sentry_sdk.trace
160159
@comparison_bindable.field("patchTotals")
160+
@sentry_sdk.trace
161161
def resolve_patch_totals(
162162
comparison: ComparisonReport, info: GraphQLResolveInfo
163163
) -> dict:
@@ -174,9 +174,9 @@ def resolve_patch_totals(
174174
return {**totals, "coverage": coverage}
175175

176176

177-
@sentry_sdk.trace
178177
@comparison_bindable.field("flagComparisons")
179178
@sync_to_async
179+
@sentry_sdk.trace
180180
def resolve_flag_comparisons(
181181
comparison: ComparisonReport, info: GraphQLResolveInfo, filters=None
182182
) -> List[FlagComparison]:
@@ -193,9 +193,9 @@ def resolve_flag_comparisons(
193193
return list(all_flags)
194194

195195

196-
@sentry_sdk.trace
197196
@comparison_bindable.field("componentComparisons")
198197
@sync_to_async
198+
@sentry_sdk.trace
199199
def resolve_component_comparisons(
200200
comparison_report: ComparisonReport, info: GraphQLResolveInfo, filters=None
201201
) -> List[ComponentComparison]:
@@ -242,9 +242,9 @@ def resolve_flag_comparisons_count(
242242
return get_flag_comparisons(comparison.commit_comparison).count()
243243

244244

245-
@sentry_sdk.trace
246245
@comparison_bindable.field("hasDifferentNumberOfHeadAndBaseReports")
247246
@sync_to_async
247+
@sentry_sdk.trace
248248
def resolve_has_different_number_of_head_and_base_reports(
249249
comparison: ComparisonReport,
250250
info: GraphQLResolveInfo,

graphql_api/types/coverage_analytics/coverage_analytics.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def resolve_coverage_analytics_result_type(
5353
return None
5454

5555

56-
@sentry_sdk.trace
5756
@coverage_analytics_bindable.field("percentCovered")
57+
@sentry_sdk.trace
5858
def resolve_percent_covered(
5959
parent: CoverageAnalyticsProps, info: GraphQLResolveInfo
6060
) -> Optional[float]:
@@ -118,9 +118,9 @@ async def resolve_measurements(
118118
return measurements
119119

120120

121-
@sentry_sdk.trace
122121
@coverage_analytics_bindable.field("components")
123122
@sync_to_async
123+
@sentry_sdk.trace
124124
def resolve_components_measurements(
125125
parent: CoverageAnalyticsProps,
126126
info: GraphQLResolveInfo,
@@ -253,9 +253,9 @@ def resolve_components_count(
253253
return len(repo_yaml_components)
254254

255255

256-
@sentry_sdk.trace
257256
@coverage_analytics_bindable.field("flags")
258257
@sync_to_async
258+
@sentry_sdk.trace
259259
def resolve_flags(
260260
parent: CoverageAnalyticsProps,
261261
info: GraphQLResolveInfo,

graphql_api/types/impacted_file/impacted_file.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ def resolve_hashed_path(impacted_file: ImpactedFile, info) -> str:
6363
return md5_path.hexdigest()
6464

6565

66-
@sentry_sdk.trace
6766
@impacted_file_bindable.field("segments")
6867
@sync_to_async
68+
@sentry_sdk.trace
6969
def resolve_segments(
7070
impacted_file: ImpactedFile, info, filters=None
7171
) -> Union[UnknownPath, ProviderError, SegmentComparisons]:

graphql_api/types/pull/pull.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def is_first_pull_request(pull: Pull) -> bool:
5959
return pull.repository.pull_requests.order_by("id").first() == pull
6060

6161

62-
@sentry_sdk.trace
6362
@pull_bindable.field("compareWithBase")
63+
@sentry_sdk.trace
6464
async def resolve_compare_with_base(
6565
pull: Pull, info: GraphQLResolveInfo, **kwargs: Any
6666
) -> Union[CommitComparison, Any]:
@@ -90,9 +90,9 @@ async def resolve_compare_with_base(
9090
return ComparisonReport(commit_comparison)
9191

9292

93-
@sentry_sdk.trace
9493
@pull_bindable.field("bundleAnalysisCompareWithBase")
9594
@sync_to_async
95+
@sentry_sdk.trace
9696
def resolve_bundle_analysis_compare_with_base(
9797
pull: Pull, info: GraphQLResolveInfo, **kwargs: Any
9898
) -> Union[BundleAnalysisComparison, Any]:

0 commit comments

Comments
 (0)