@@ -673,11 +673,15 @@ def get_top_5_issues_by_count_for_file(
673
673
self , projects : list [Project ], sentry_filenames : list [str ], function_names : list [str ]
674
674
) -> list [dict [str , Any ]]:
675
675
"""
676
- Given a list of projects, Github filenames reverse-codemapped into filenames in Sentry,
676
+ Given a list of projects, filenames reverse-codemapped into filenames in Sentry,
677
677
and function names representing the list of functions changed in a PR file, return a
678
678
sublist of the top 5 recent unhandled issues ordered by event count.
679
679
"""
680
680
if not len (projects ):
681
+ logger .info (
682
+ "open_pr_comment.no_projects" ,
683
+ extra = {"sentry_filenames" : sentry_filenames },
684
+ )
681
685
return []
682
686
683
687
patch_parsers = get_patch_parsers_for_organization (projects [0 ].organization )
@@ -687,6 +691,10 @@ def get_top_5_issues_by_count_for_file(
687
691
language_parser = patch_parsers .get (sentry_filenames [0 ].split ("." )[- 1 ], None )
688
692
689
693
if not language_parser :
694
+ logger .info (
695
+ "open_pr_comment.no_language_parser" ,
696
+ extra = {"sentry_filenames" : sentry_filenames },
697
+ )
690
698
return []
691
699
692
700
group_ids = list (
@@ -699,6 +707,13 @@ def get_top_5_issues_by_count_for_file(
699
707
.order_by ("-times_seen" )
700
708
.values_list ("id" , flat = True )
701
709
)[:OPEN_PR_MAX_RECENT_ISSUES ]
710
+
711
+ if projects [0 ].organization_id == 1 :
712
+ logger .info (
713
+ "open_pr_comment.length_of_group_ids" ,
714
+ extra = {"group_ids_length" : len (group_ids )},
715
+ )
716
+
702
717
project_ids = [p .id for p in projects ]
703
718
704
719
multi_if = language_parser .generate_multi_if (function_names )
@@ -799,6 +814,12 @@ def get_top_5_issues_by_count_for_file(
799
814
query = query ,
800
815
)
801
816
817
+ if projects [0 ].organization_id == 1 :
818
+ logger .info (
819
+ "open_pr_comment.snuba_query" ,
820
+ extra = {"query" : request .to_dict ()["query" ]},
821
+ )
822
+
802
823
try :
803
824
return raw_snql_query (request , referrer = self .referrer .value )["data" ]
804
825
except Exception :
0 commit comments