Skip to content

Add StepConfig workflow types#2559

Merged
sidharthachatterjee merged 1 commit intocloudflare:mainfrom
LuisDuarte1:lduarte/fix-workflows-step-config-types
Aug 20, 2024
Merged

Add StepConfig workflow types#2559
sidharthachatterjee merged 1 commit intocloudflare:mainfrom
LuisDuarte1:lduarte/fix-workflows-step-config-types

Conversation

@LuisDuarte1
Copy link
Copy Markdown
Contributor

@LuisDuarte1 LuisDuarte1 commented Aug 20, 2024

StepConfig was missing from previous type iterations, making the cloudflare:workers Workflow types kind of unusable 😅.

All utility types are prefixed with Workflow to avoid polluting the cloudflare:workers scope

@LuisDuarte1 LuisDuarte1 requested review from a team as code owners August 20, 2024 13:33
@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 20, 2024

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@LuisDuarte1
Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Aug 20, 2024
@LuisDuarte1 LuisDuarte1 force-pushed the lduarte/fix-workflows-step-config-types branch from e55c83e to 4a74e1e Compare August 20, 2024 13:55
Comment on lines +207 to +219
export type WorkflowSleepDuration = `${number} ${WorkflowDurationLabel}${"s" | ""}` | number;

export type WorkflowBackoff = 'constant' | 'linear' | 'exponential';

export type WorkflowStepConfig = {
retries?: {
limit: number;
delay: string | number;
backoff?: WorkflowBackoff;
};
timeout?: string | number;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I realise there are already Workflow types in this file, but I think they should probably be in a separate workflows.d.ts so we can more easily separate them.

}

export type DurationLabel =
export type WorkflowDurationLabel =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a breaking change—I assume this is being considered okay because Workflows is experimental?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yhep this is okay as we are still iterating on the types, we just thought that would be better to prefix everything with Workflow to not pollute the scope

@sidharthachatterjee sidharthachatterjee merged commit b22fdb2 into cloudflare:main Aug 20, 2024
@LuisDuarte1 LuisDuarte1 deleted the lduarte/fix-workflows-step-config-types branch August 21, 2024 10:09
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.

4 participants