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

Fixes to List Workflows Basic route handler #758

Conversation

adhityamamallan
Copy link
Member

Summary

  • Add extra validation to Zod schema to ensure that only one filter is set
  • Explicitly pass filter type to GRPC endpoint
  • Rewrite the endpoint logic a bit to fix type errors

Test plan

Ran locally as part of the overall Basic Visibility changes

earliestTime: queryParams.timeRangeStart,
latestTime: queryParams.timeRangeEnd,
},
...((queryParams.workflowId || queryParams.runId) && {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: This looks cool, but might be easier to make it more readable explicitly:

var params = ...
if queryParams.workflowId || queryParams.runId {
   params.filters = 'executionFilter'
   executionFilter: {
        workflowId: queryParams.workflowId,
        runId: queryParams.runId,
      },
}
if queryParams.workflowType {
   params.filters = 'typeFilter'
   typeFilter: {
        name: queryParams.workflowType,
      },
}

Though, this is what we usually do in Go. I'm unsure about JS style :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess this would be more JS-y; I tend to avoid lets and vars if possible.

@adhityamamallan adhityamamallan merged commit 8943728 into cadence-workflow:release/4.0.0 Dec 13, 2024
1 check passed
@adhityamamallan adhityamamallan deleted the route-handler-fixes branch December 13, 2024 09:31
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.

2 participants