Skip to content

Commit 3e70f09

Browse files
committed
fix: correct base_branch before requeue to avoid repeated fallback lookups
1 parent 82d9681 commit 3e70f09

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

scripts/github-code-review.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,14 @@ function handleFailure(array $job, string $reason): void
12921292
// Generate new UUID for requeued job to avoid deduplication issues
12931293
$job['id'] = CodeReviewQueue::uuidV4();
12941294

1295+
// Before requeueing, verify base_branch is correct to avoid repeated fallback lookups
1296+
$storedBase = $job['base_branch'] ?? '';
1297+
$correctBase = getPRRef($job['repo'] ?? '', (int)($job['pr_number'] ?? 0), 'base');
1298+
if ($correctBase !== null && $correctBase !== $storedBase) {
1299+
verbose_log("correcting base_branch from '{$storedBase}' to '{$correctBase}' before requeue", 2);
1300+
$job['base_branch'] = $correctBase;
1301+
}
1302+
12951303
error_log("github-code-review: requeueing job {$job['id']} (retry {$retryCount}/" . MAX_RETRIES . "): {$reason}");
12961304
CodeReviewQueue::requeue($job);
12971305
}

0 commit comments

Comments
 (0)