Skip to content

Commit

Permalink
feat: limit number of tickets to analyze to 3 in compliance check
Browse files Browse the repository at this point in the history
  • Loading branch information
hussam789 committed Jan 26, 2025
1 parent 50c52e3 commit a42c5f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pr_agent/tools/ticket_pr_compliance_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()})
Expand Down

0 comments on commit a42c5f4

Please sign in to comment.