Skip to content
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

Merged
merged 2 commits into from
Oct 17, 2024

Conversation

Joibel
Copy link
Member

@Joibel Joibel commented Oct 7, 2024

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" list

Document skip forward and skip backward correctors for DST as previously documented in #13365

Verification

make docs passes

Signed-off-by: Alan Clucas <alan@clucas.org>
@Joibel Joibel added area/docs Incorrect, missing, or mistakes in docs area/cron-workflows labels Oct 7, 2024
@Joibel Joibel marked this pull request as ready for review October 7, 2024 14:29
@Joibel Joibel added this to the v3.6.0 milestone Oct 7, 2024
@agilgur5 agilgur5 changed the title docs: CronWorkflows when and DST docs docs(cron): add when to table + examples for DST leap handling Oct 7, 2024
@agilgur5 agilgur5 self-assigned this Oct 7, 2024
@agilgur5
Copy link
Member

agilgur5 commented Oct 7, 2024

This PR brings in the "once a day" documentation from #13365

As requested in #13474 (review)

Copy link
Member

@isubasinghe isubasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Joibel Joibel merged commit 62203c1 into argoproj:main Oct 17, 2024
18 checks passed
@Joibel Joibel deleted the dst-docs branch October 17, 2024 09:46
Copy link
Member

@agilgur5 agilgur5 left a 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` |
Copy link
Member

@agilgur5 agilgur5 Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `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 |

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 to conditionals.md since it has different variables and also still uses govaluate syntax, both of which would be confusing. If it had its own section with variables, then you could link to conditionals.md as a pre-existing reference for when

Comment on lines +130 to +131
!!! 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
!!! 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.

Copy link
Member

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:
Screenshot 2024-10-17 at 8 02 07 PM

```

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..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Member

@agilgur5 agilgur5 Oct 18, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cron-workflows area/docs Incorrect, missing, or mistakes in docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add docs for CronWorkflows when
3 participants