-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(cron): add when
to table + examples for DST leap handling
#13723
Conversation
Signed-off-by: Alan Clucas <alan@clucas.org>
when
and DST docswhen
to table + examples for DST leap handling
As requested in #13474 (review) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't have a chance to review this but did have comments WIP, so I'll leave them here
| `timezone` | Machine timezone | [IANA Timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) to run `Workflows`. Example: `America/Los_Angeles` | | ||
| `suspend` | `false` | If `true` Workflow scheduling will not occur. Can be set from the CLI, GitOps, or directly | | ||
| `concurrencyPolicy` | `Allow` | What to do if multiple `Workflows` are scheduled at the same time. `Allow`: allow all, `Replace`: remove all old before scheduling new, `Forbid`: do not allow any new while there are old | | ||
| `startingDeadlineSeconds` | `0` | Seconds after [the last scheduled time](#crash-recovery) during which a missed `Workflow` will still be run. | | ||
| `successfulJobsHistoryLimit` | `3` | Number of successful `Workflows` to persist | | ||
| `failedJobsHistoryLimit` | `1` | Number of failed `Workflows` to persist | | ||
| `stopStrategy` | `nil` | v3.6 and after: defines if the CronWorkflow should stop scheduling based on a condition | | ||
| `when` | None | v3.6 and after: An optional [expression](walk-through/conditionals.md) which will be evaluated on each cron schedule hit and the workflow will only run if it evaluates to `true` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| `when` | None | v3.6 and after: An optional [expression](walk-through/conditionals.md) which will be evaluated on each cron schedule hit and the workflow will only run if it evaluates to `true` | | |
| `when` | None | v3.6 and after: An optional [expression](variables.md#expression) that determines if a run should be scheduled | |
- simplify, per k8s style guide
- match language in feat(cron): cronworkflows
when
clause #13474 (comment)
also:
- "cron schedule hit" is also not an existing term in these docs.
- "if it evaluates to
true
" is the definition of a conditional variables.md#expression
is the canonical link for "expression" per docs: consolidate expression links #12617, and that page contains variables for this statement too.- Since an independent
when
section wasn't added on this page, I also wouldn't necessary link toconditionals.md
since it has different variables and also still usesgovaluate
syntax, both of which would be confusing. If it had its own section with variables, then you could link toconditionals.md
as a pre-existing reference forwhen
- Since an independent
!!! Warning "Can run at 3:00" | ||
If you create this CronWorkflow between the desired time and 3:00 it will run at 3:00 as it has never run before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!!! Warning "Can run at 3:00" | |
If you create this CronWorkflow between the desired time and 3:00 it will run at 3:00 as it has never run before. | |
!!! Warning "Can run at 3:00" | |
If you create this CronWorkflow between the desired time and 3:00 it will run at 3:00 as it has never run before. |
This syntax is incorrect, the contents of an admonition block must be 4 space indented. Please do check the HTML output of mkdocs
if you're not sure. There is technically a preview in CI as well, it's just not easy to access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this was merged before I had a chance to review, can see what this syntax error currently looks like live:
``` | ||
|
||
This will schedule at the first 01:30 on a skip backwards change. | ||
The second will not run because of the `when` expression, which prevents this workflow running more often than once every 2 hours.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second will not run because of the `when` expression, which prevents this workflow running more often than once every 2 hours.. | |
The second will not run because of the `when` expression, which prevents this workflow running more often than once every 2 hours. |
typo
@@ -109,6 +110,41 @@ For example, with `timezone: America/Los_Angeles`: | |||
| | 2 | 2020-11-02 02:01:00 -0800 PST | | |||
| | 3 | 2020-11-03 02:01:00 -0800 PST | | |||
|
|||
#### Skip forward (missing schedule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per #13365 (comment), even if you left these split, I would still simplify these, per the style guide, and still use the word "leap" as that is the common term for this compared to "skip" (which has various other connotations, particularly in the context of workflows)
Motivation
This PR brings in the "once a day" documentation from #13365
Fixes #13700 whilst I'm there
Modifications
Add
when
clause to cron workflows "options" listDocument skip forward and skip backward correctors for DST as previously documented in #13365
Verification
make docs
passes