feat(samples): add schedule_sample with full lifecycle demo#136
feat(samples): add schedule_sample with full lifecycle demo#136abhishekj720 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
905f3bd to
45226d8
Compare
525f6a5 to
54330f4
Compare
Adds samples/schedule_sample/schedule_sample.py — a two-subcommand script (worker + demo) that walks through the complete schedule lifecycle: create → describe → pause → unpause → backfill → update → list → delete. Also adds samples/README.md cataloguing the sample with run instructions, and updates the main README to point to it. The demo wraps the lifecycle in try/finally so the schedule is cleaned up and the client closed even if an intermediate step raises. Signed-off-by: abhishek.jha <abhishek.jha@uber.com>
54330f4 to
28926fe
Compare
Co-authored-by: Abhishek Jha <17800780+abhishekj720@users.noreply.github.com>
Code Review ✅ Approved 5 resolved / 5 findingsAdds comprehensive schedules sample and stress testing utilities, resolving client leakage, error handling, and output discrepancies. No open issues found. ✅ 5 resolved✅ Edge Case: Cleanup delete in except can mask the original error
✅ Quality: Backfill comment/output claims 2 triggers but window yields ~120
✅ Quality: schedule_stress: Client never closed, leaking gRPC channels
✅ Quality: schedule_stress main does not catch KeyboardInterrupt
✅ Quality: schedule_sample worker leaks client (never closed)
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Summary
samples/schedule_sample.py— a two-subcommand script (worker+demo) that walks through the complete Cadence Schedules lifecycle: create → describe → pause → unpause → backfill → update → list → deletesamples/README.mdcataloguing the sample with run instructions, following the cadence-samples Go repo patternREADME.mdwith a short "Samples" pointer tosamples/README.mdtry/finallyso the schedule is cleaned up and the client closed even if an intermediate step raisesTest plan
uv run python samples/schedule_sample.py worker— starts worker cleanlyuv run python samples/schedule_sample.py demo— runs full lifecycle, prints each stepuv tool run ruff check samples/— no lint errors