Repository navigation
fix(scheduler): triggerNow reports a skip instead of claiming success - #113
Conversation
`triggerNow` returned a boolean that was `false` only when the directory was not in the watch list, and `true` for both "a pass ran" and "a pass was skipped because one was already in flight". The second case became reachable when #109 put the per-directory guard in front of every entry point, so a caller asking whether its request was honoured was told yes when nothing ran. `runOrganization` now returns a `PassOutcome`: ran, or skipped with a `not-watched` or `in-flight` reason and the directory the outcome refers to. `triggerNow` returns that directly rather than collapsing it back to a boolean. A discriminated union rather than a string, so a caller cannot read an outcome the code did not produce. The guard is untouched. The cron retry loop gained a comment saying why a skip is not retried: it is a tick that lost the directory, and re-checking a busy directory just spends the attempt budget. Two tests cover it. One corrects the existing "should trigger even if the directory is already in flight", which stubbed `runOrganization` and so never reached the guard it named while pinning `true`. The second exercises the real guard with no stub and asserts the sweep was not called behind the skip. Mutation-checked by restoring the unconditional `true` in `triggerNow`: both go red. Commit made by Step 5 Preview Free in OpenCode on behalf of Kriday.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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 |
|
Reviewed locally on |
ReviewVerdict: approve. No blockers found. Correctness
API / contract
Tests
Verification I ran
Residual risk (not blocking)
|
triggerNow now reports skip result honestly.