Skip to content

Run-time check for update validator signature - #723

Merged
dandavison merged 4 commits into
mainfrom
689-upd-val-sig
Jan 18, 2025
Merged

dandavison merged 4 commits into
mainfrom
689-upd-val-sig

Conversation

@dandavison

@dandavison dandavison commented Jan 9, 2025 •

Copy link
Copy Markdown
Contributor

Fixes #689

This PR causes the workflow decorator to raise an exception if the workflow definition contains an (update, validator) pair with inconsistent signatures. The exception will therefore be raised at import time when running a workflow worker. We re-use the same definition of "inconsistent signatures" that we use when comparing the @workflow.run and workflow __init__ methods. We already had type-checking for this, but we lacked a run-time check; an exception would have been raised eventually, but at update validation time.

@dandavison
dandavison requested a review from a team as a code owner January 9, 2025 17:25

@cretz cretz left a comment

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.

Great!

@dandavison
dandavison force-pushed the 689-upd-val-sig branch 11 times, most recently from 18be6ed to 6273e3b Compare January 18, 2025 01:15
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.

[Feature Request] Do runtime check to ensure update validator has the same parameter signature as update it validates

3 participants