fix: Promise.any race condition in validator script check (#1007)#1010
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR introduces comprehensive documentation describing bug root causes and fixes and corrects a timing-dependent test flake in the workflow validator by replacing Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related issues
Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code ReviewVerdict: PASS — no issues found. The root cause diagnosis is correct: The fix ( No edge cases missed, no regressions introduced. |
) * Investigate issues #1001, #1002, #1003: interactive-prd workflow bugs * fix: replace Promise.any with Promise.all in validator script check (#1007) Promise.any resolves with the first fulfilled promise regardless of value. Since fileExists always fulfills (never rejects), Promise.any could return false even when a later extension check would return true — a race condition that flaked on Windows CI. Fixes #1007
…fix-dag-bash-validation Fix DAG validation emitting wrong error for empty bash/prompt nodes
…fix-dag-bash-validation Fix DAG validation emitting wrong error for empty bash/prompt nodes
) (coleam00#1010) * Investigate issues coleam00#1001, coleam00#1002, coleam00#1003: interactive-prd workflow bugs * fix: replace Promise.any with Promise.all in validator script check (coleam00#1007) Promise.any resolves with the first fulfilled promise regardless of value. Since fileExists always fulfills (never rejects), Promise.any could return false even when a later extension check would return true — a race condition that flaked on Windows CI. Fixes coleam00#1007
…fix-dag-bash-validation Fix DAG validation emitting wrong error for empty bash/prompt nodes
) (coleam00#1010) * Investigate issues coleam00#1001, coleam00#1002, coleam00#1003: interactive-prd workflow bugs * fix: replace Promise.any with Promise.all in validator script check (coleam00#1007) Promise.any resolves with the first fulfilled promise regardless of value. Since fileExists always fulfills (never rejects), Promise.any could return false even when a later extension check would return true — a race condition that flaked on Windows CI. Fixes coleam00#1007
Summary
validateWorkflowResourcesusedPromise.anyto check if a named script file exists, butfileExistsalways fulfills (never rejects), soPromise.anyreturned the first resolved value regardless of truthiness — a race condition that flaked on Windows CIPromise.all+.some(Boolean)which is deterministicChanges
packages/workflows/src/validator.tsPromise.anywithPromise.all+.some()Testing
bun run validatepasses (0 failures across all packages)Validation
Fixes #1007
Summary by CodeRabbit
Documentation
Refactor