fix: Apply suggestions_score_threshold filter to inline code suggestions in dual publishing mode

- Added score filtering to push_inline_code_suggestions
- Ensured inline suggestions are properly filtered when dual publishing is enabled
- High-importance suggestions appear in both table and inline; others only inline
This commit is contained in:
diana-jung 2025-11-26 14:38:29 +09:00 committed by GitHub
parent 5ec92b3535
commit ab808fd114
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -539,7 +539,10 @@ class PRCodeSuggestions:
async def push_inline_code_suggestions(self, data): async def push_inline_code_suggestions(self, data):
code_suggestions = [] code_suggestions = []
if not data['code_suggestions']: score_threshold = max(1, int(get_settings().pr_code_suggestions.suggestions_score_threshold))
filtered_suggestions = [d for d in data['code_suggestions'] if int(d.get('score', 0)) >= score_threshold]
if not filtered_suggestions:
get_logger().info('No suggestions found to improve this PR.') get_logger().info('No suggestions found to improve this PR.')
if self.progress_response: if self.progress_response:
return self.git_provider.edit_comment(self.progress_response, return self.git_provider.edit_comment(self.progress_response,
@ -547,7 +550,7 @@ class PRCodeSuggestions:
else: else:
return self.git_provider.publish_comment('No suggestions found to improve this PR.') return self.git_provider.publish_comment('No suggestions found to improve this PR.')
for d in data['code_suggestions']: for d in filtered_suggestions:
try: try:
if get_settings().config.verbosity_level >= 2: if get_settings().config.verbosity_level >= 2:
get_logger().info(f"suggestion: {d}") get_logger().info(f"suggestion: {d}")