37fc010656b75043d6ad0d4b91a9c672d915e327 lrnassar Mon Jul 13 08:08:08 2026 -0700 Fix codeReviewAi.py --daily exiting non-zero when there are no commits. refs #36890 The no-commits early return fell through to sys.exit(0 if ok else 1) as None, which is falsy, so a normal no-op run (e.g. a weekend with no commits) exited 1 and tripped the cron's failure guard. Return True from that path so an empty review window is treated as success. diff --git src/utils/codeReviewAi.py src/utils/codeReviewAi.py index 17e68cb904d..8399e62cdf7 100755 --- src/utils/codeReviewAi.py +++ src/utils/codeReviewAi.py @@ -1402,31 +1402,31 @@ print(f"DAILY CODE REVIEW MODE") print(f"Looking back: {hours} hours") print(f"CC: {cc_address or 'None'}") print(f"Alert: {alert_email or 'None'}") print(f"Auth: {auth_method}") print(f"Log dir: {log_dir}") print(f"Dry run: {dry_run}") print("=" * 60) # Phase 1: Gather commits print(f"\nPhase 1: Gathering commits from the last {hours} hours...") authors = get_commits_since(hours) if not authors: print("No commits found in the specified time window.") - return + return True total_commits = sum(len(a['commits']) for a in authors.values()) print(f"Found {total_commits} commit(s) from {len(authors)} author(s):") for email, data in authors.items(): print(f" {data['name']} <{email}>: {len(data['commits'])} commit(s)") # Phase 2: Review each author's commits print(f"\nPhase 2: Reviewing commits...") reviews = {} all_temp_files = [] for author_email, data in authors.items(): review, temp_files, error = review_daily_author(data['name'], data['commits'], log_dir) all_temp_files.extend(temp_files) reviews[author_email] = { 'name': data['name'],