Skip to content

feat: better define step retry delay and step timeout types#3191

Merged
sidharthachatterjee merged 1 commit intocloudflare:mainfrom
LuisDuarte1:lduarte/WOR-427-better-types
Nov 29, 2024
Merged

feat: better define step retry delay and step timeout types#3191
sidharthachatterjee merged 1 commit intocloudflare:mainfrom
LuisDuarte1:lduarte/WOR-427-better-types

Conversation

@LuisDuarte1
Copy link
Contributor

Previously, both types were specified as a string, which is not intended behavior. We only allow for a specific formatted string - same as WorkflowSleepDuration.

I've added WorkflowTimeoutDuration and WorkflowDelayDuration for better DX in the types by reducing confusion (otherwise you would see a WorkflowSleepDuration in a timeout field) - also gives us flexibility if we need to separate them later.

While this could be a breaking change in the types, we already validate it at runtime, so there are no worries here.

Previously, both types were specified as a string, which is not intended
behaviour. We only allow for a specific formatted string - same as
WorkflowSleepDuration.

I've added WorkflowTimeoutDuration and WorkflowDelayDuration for better
DX in the types by reducing confusion (otherwise you would see a
WorkflowSleepDuration in a timeout) - also gives us flexibility if we
need to seperate them later.

While you could think that this could be a breaking change in the types,
we already validate it at runtime.
@LuisDuarte1 LuisDuarte1 requested review from a team as code owners November 29, 2024 16:16
@LuisDuarte1 LuisDuarte1 changed the title feat: better define retry delay and step timeout types feat: better define step retry delay and step timeout types Nov 29, 2024
Copy link
Contributor

@vickykont vickykont left a comment

Choose a reason for hiding this comment

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

Looks good to me, but it might be best if someone that understands these types and what might introduce breaking changes approves.

@sidharthachatterjee
Copy link
Contributor

This is a breaking change. However, what makes it "breaking" is that the new types are actually accurate to what the implementation requires/anything that doesn't match these types (updated in this PR) actually fail. So we should merge this. I'll merge. Thanks folks!

@sidharthachatterjee sidharthachatterjee merged commit 845a262 into cloudflare:main Nov 29, 2024
@LuisDuarte1 LuisDuarte1 deleted the lduarte/WOR-427-better-types branch December 2, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants