mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-04 04:40:38 +08:00
feat: limit number of tickets to analyze to 3 in compliance check
This commit is contained in:
@ -51,6 +51,11 @@ def extract_ticket_links_from_pr_description(pr_description, repo_path, base_url
|
||||
issue_number = match[5][1:] # remove #
|
||||
if issue_number.isdigit() and len(issue_number) < 5 and repo_path:
|
||||
github_tickets.add(f'{base_url_html.strip("/")}/{repo_path}/issues/{issue_number}')
|
||||
|
||||
if len(github_tickets) > 3:
|
||||
get_logger().info(f"Too many tickets found in PR description: {len(github_tickets)}")
|
||||
# Limit the number of tickets to 3
|
||||
github_tickets = set(list(github_tickets)[:3])
|
||||
except Exception as e:
|
||||
get_logger().error(f"Error extracting tickets error= {e}",
|
||||
artifact={"traceback": traceback.format_exc()})
|
||||
|
Reference in New Issue
Block a user