Run the debugging process.
(self)
| 470 | print() |
| 471 | |
| 472 | def debug(self) -> None: |
| 473 | """Run the debugging process.""" |
| 474 | # Get run info |
| 475 | run_info = self.get_run_info() |
| 476 | if run_info: |
| 477 | print(f"\nWorkflow: {run_info.get('displayTitle', 'Unknown')}") |
| 478 | print(f"Status: {run_info.get('status', 'Unknown')}") |
| 479 | print(f"Conclusion: {run_info.get('conclusion', 'Unknown')}") |
| 480 | print(f"Created: {run_info.get('createdAt', 'Unknown')}") |
| 481 | |
| 482 | # Get failed jobs |
| 483 | failed_jobs = self.get_failed_jobs() |
| 484 | if not failed_jobs: |
| 485 | print("\nNo failed jobs found!") |
| 486 | return |
| 487 | |
| 488 | print(f"\nFound {len(failed_jobs)} failed job(s):") |
| 489 | for job in failed_jobs: |
| 490 | print(f" - {job['name']} ({job['conclusion']})") |
| 491 | |
| 492 | # Try build summary artifact first (much faster than full logs) |
| 493 | print() |
| 494 | log_file = self.try_download_build_summary() |
| 495 | if log_file: |
| 496 | print("Using build summary artifact (faster than full logs)") |
| 497 | else: |
| 498 | # Fall back to full log download |
| 499 | log_file = self.download_logs() |
| 500 | |
| 501 | if not log_file: |
| 502 | print("Failed to download logs. Cannot continue analysis.", file=sys.stderr) |
| 503 | return |
| 504 | |
| 505 | self.log_file = log_file |
| 506 | |
| 507 | # Analyze logs |
| 508 | self.analyze_logs(log_file) |
| 509 | |
| 510 | # Print summary |
| 511 | self.print_summary() |
| 512 | |
| 513 | # Show log file location at the end |
| 514 | if self.log_file: |
| 515 | print("=" * 80) |
| 516 | print(f"Full logs saved to: {self.log_file}") |
| 517 | print("=" * 80) |
| 518 | |
| 519 | |
| 520 | def main(): |
no test coverage detected