fix(workflow): reject over-long delay durations at definition time - #3024
Open
aeonbilal wants to merge 1 commit into
Open
fix(workflow): reject over-long delay durations at definition time#3024aeonbilal wants to merge 1 commit into
aeonbilal wants to merge 1 commit into
Conversation
`WorkflowDef::validate()` had no arm for action definitions, so a `delay` step's duration was never checked when the workflow was saved. The executor caps a delay at 270s, and the doc comments on the field gave "5m" and "1h" as the examples, both of which are over that cap. A workflow using either validated, saved, showed as enabled, and then failed at the same step on every run. Validate the duration where the schedule interval is already validated: parse it, reject anything over the cap, and reject strings that don't parse at all, which previously also failed only at run time. The 270s constant moves out of the executor's match arm so both sides share one definition instead of duplicating the literal. The doc comments now use durations that work and state the ceiling, and `parse_all_action_types` no longer pins the broken 5m case. Signed-off-by: Bilal Syed <bilal.hsyed@gmail.com>
aeonbilal
force-pushed
the
fix/workflow-delay-validation
branch
from
July 27, 2026 18:35
d37de0d to
aed9034
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
delaydurations inWorkflowDef::validate()instead of leaving them to the executorMAX_DELAY_SECSout of the executor's match arm so schema and executor share one definition"5m"and"1h"as examples even though both are over the capWhy
validate()had no arm for action definitions, so adelaystep's duration was never checked when a workflow was saved. The executor caps a delay at 270s (executor.rs), while the field's own doc comments gave"5m"(300s) and"1h"(3600s) as the examples. A workflow copying either one validated, saved, showed as enabled, then failed at the same step on every run, with the only signal being a run-time error the user has to go looking for.parse_all_action_typespinned the broken case: it asserted that a definition withduration: 5mparses successfully.The schedule trigger already validates this way. The
intervalbranch callsparse_duration_secsand rejects sub-60s intervals with a comment explaining the runtime constraint behind it. This adds the same treatment one arm over.Fixes #3021
Notes
MAX_DELAY_SECSispub(crate), matchingparse_duration_secsnext to it, whichschema.rsalready uses.Verification
cargo test -p buzz-workflow— 152 passed, 0 failedcargo clippy -p buzz-workflow --all-targets -- -D warnings— cleancargo fmt --check -p buzz-workflow— cleanNew tests cover rejection at
5m/1h/271s, acceptance at30s/4m/270s(the boundary), and rejection of an unparseable duration.