[email-rotation] give extend_rotation an --ensure-weeks flag#4
Conversation
This allows for easy cronjob writing. You can e.g., automatically `--ensure-weeks=16` every month, and `extend_rotation.py` will handle making sure that you always have rotations covering up to a quarter out. Tested by running locally on a few different values of `--ensure-weeks`.
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new --ensure-weeks flag to the extend_rotation.py script, allowing users to specify how many weeks into the future the rotation schedule should cover. This enables automated cronjob usage where you can ensure a consistent coverage period (e.g., 16 weeks for quarterly planning) rather than adding a fixed number of rotations.
- Replaces fixed
--num-rotationsparameter with mutually exclusive--num-rotationsand--ensure-weeksoptions - Adds
calculate_rotations_to_cover()function to determine how many rotations are needed for a given time period - Updates the main logic to calculate required rotations based on the chosen flag
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| extend_rotation.py | Implements the new --ensure-weeks flag with supporting logic and argument parsing changes |
| extend_rotation_test.py | Adds comprehensive test coverage for the new calculate_rotations_to_cover() function |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Hey @kbeyls, would you be willing to TAL at this really fast, since you looked over the initial code drop? :) Will squash the copilot fixup commit away when I go to merge. |
|
Thanks for your reviews! |
This allows for easy cronjob writing. You can e.g., automatically
--ensure-weeks=16every month, andextend_rotation.pywill handle making sure that you always have rotations covering up to a quarter out.Tested by running locally on a few different values of
--ensure-weeks.