Skip to content

Commit 82d9681

Browse files
committed
github-code-review worker: comprehensive fixes for signal handling, reliability, and safety
CRITICAL fixes: - Add pcntl_async_signals(true) before signal handlers - enables Ctrl-C to fire during exec() - Fix $running checks in checkoutBranch to be BEFORE exec() calls, not just after - Add missing getPRDiff() and applyPRDiff() functions with proper temp file cleanup - Consolidate getPRHeadBranch/getPRBaseBranch into getPRRef() with retry logic MAJOR fixes: - Assign new UUID on job requeue - prevents infinite retry loops on same job ID - Fix file_get_contents() false checks - prevent type mismatches - Add try/finally cleanup for temp files in getFileDiff - prevents disk leaks - Add repo path validation with regex and realpath() - prevents path traversal MINOR improvements: - Add PHPStan ignore comments for !$running (signal handler mutation) - Add initGitRepo error checking and logging - Add $hadValidParse flag to distinguish 'no issues' vs 'parse failed' - Create runCommandWithTimeout() helper with proc_open + stream_select - Extract cleanupCheckout() helper to eliminate duplicated cleanup code BUG fixes from review: - Fix undefined $actualBaseBranch when base branch lookup returns null - Add file_put_contents error checks in processIssue to handle disk failures
1 parent 1def725 commit 82d9681

2 files changed

Lines changed: 386 additions & 59 deletions

File tree

0 commit comments

Comments
 (0)