99
1010import minio
1111import pytz
12+ import sentry_sdk
1213import shared .reports .api_report_service as report_service
1314from asgiref .sync import async_to_sync
1415from django .db .models import Prefetch , QuerySet
@@ -756,7 +757,7 @@ def head_report_without_applied_diff(self):
756757 return report
757758
758759 @cached_property
759- def has_different_number_of_head_and_base_sessions (self ):
760+ def has_different_number_of_head_and_base_sessions (self ) -> bool :
760761 """
761762 This method checks if the head and the base have different number of sessions.
762763 It makes use of the head_report_without_applied_diff property instead of the
@@ -989,10 +990,10 @@ class ComparisonReport(object):
989990 on a `CommitComparison`
990991 """
991992
992- commit_comparison : CommitComparison = None
993+ commit_comparison : CommitComparison
993994
994995 @cached_property
995- def files (self ) -> List [ImpactedFile ]:
996+ def files (self ) -> list [ImpactedFile ]:
996997 if not self .commit_comparison .report_storage_path :
997998 return []
998999
@@ -1001,29 +1002,29 @@ def files(self) -> List[ImpactedFile]:
10011002 ImpactedFile .create (** data ) for data in comparison_data .get ("files" , [])
10021003 ]
10031004
1004- def impacted_file (self , path : str ) -> Optional [ ImpactedFile ] :
1005+ def impacted_file (self , path : str ) -> ImpactedFile | None :
10051006 for file in self .files :
10061007 if file .head_name == path :
10071008 return file
10081009
1009- @cached_property
1010- def impacted_files (self ) -> List [ImpactedFile ]:
1010+ @property
1011+ def impacted_files (self ) -> list [ImpactedFile ]:
10111012 return self .files
10121013
10131014 @cached_property
1014- def impacted_files_with_unintended_changes (self ) -> List [ImpactedFile ]:
1015+ def impacted_files_with_unintended_changes (self ) -> list [ImpactedFile ]:
10151016 return [file for file in self .files if file .has_changes ]
10161017
10171018 @cached_property
1018- def impacted_files_with_direct_changes (self ) -> List [ImpactedFile ]:
1019+ def impacted_files_with_direct_changes (self ) -> list [ImpactedFile ]:
10191020 return [file for file in self .files if file .has_diff or not file .has_changes ]
10201021
1022+ @sentry_sdk .trace
10211023 def _fetch_raw_comparison_data (self ) -> dict :
10221024 """
10231025 Fetches the raw comparison data from storage
10241026 """
1025- repository = self .commit_comparison .compare_commit .repository
1026- archive_service = ArchiveService (repository )
1027+ archive_service = ArchiveService (repository = None )
10271028 try :
10281029 data = archive_service .read_file (self .commit_comparison .report_storage_path )
10291030 return json .loads (data )
0 commit comments