Find related issues for multiple issues at once.
(args, data)
| 456 | |
| 457 | |
| 458 | def cmd_batch_related(args, data): |
| 459 | """Find related issues for multiple issues at once.""" |
| 460 | issues = all_issues(data) |
| 461 | issue_map = {i["number"]: i for i in issues} |
| 462 | |
| 463 | state_filter = args.state.upper() if args.state else None |
| 464 | limit_per = args.limit or 5 |
| 465 | |
| 466 | for number in args.numbers: |
| 467 | target = issue_map.get(number) |
| 468 | if not target: |
| 469 | print(f"Issue #{number} not found.", file=sys.stderr) |
| 470 | continue |
| 471 | |
| 472 | results = find_related(target, issues, state_filter, limit_per) |
| 473 | query_sigs = extract_signatures(target["title"] + " " + (target["body"] or "")[:1000]) |
| 474 | |
| 475 | print(f"=== #{target['number']}: {target['title'][:65]} ===") |
| 476 | print(f" Labels: {', '.join(target['labels']) or 'none'} Signatures: {query_sigs or 'none'}") |
| 477 | |
| 478 | if results: |
| 479 | for score, issue, sig_ol, tok_ol in results: |
| 480 | print(format_related_result(score, issue, sig_ol, tok_ol, verbose=args.verbose)) |
| 481 | else: |
| 482 | print(" No related issues found.") |
| 483 | print() |
| 484 | |
| 485 | |
| 486 | def cmd_show(args, data): |
nothing calls this directly
no test coverage detected