-
Notifications
You must be signed in to change notification settings - Fork 660
Make /v1/database/:name/call/:func call procedures too, remove procedure route #3883
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
base: master
Are you sure you want to change the base?
Conversation
gefjon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. I tested locally and was able to call procedures. I'd like to see a smoketest added, please - something trivial that just calls a procedure and inspects its return value.
|
It sounds like this is an API break - does that mean that older versions of the CLI will not be able to |
| .after_help("Run `spacetime help call` for more detailed information.\n") | ||
| } | ||
|
|
||
| enum CallResult<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like this is just a description of what the call result will be, not the result itself, is that right?
| fn add_reducer_ctx_to_err(error: &mut String, module_def: &ModuleDef, reducer_name: &str) { | ||
| let mut reducers = module_def | ||
| /// decorate `error` with more helpful info about reducers and procedures. | ||
| fn add_reducer_procedure_ctx_to_err(error: &mut String, module_def: &ModuleDef, reducer_name: &str) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you test some of these error cases as well? either manually or with a smoketest?
I don't think that's true. When calling reducers, the return format of the route is unchanged, to the best of my ability to determine. It's only when calling a procedure that the route returns something different, and the old CLI won't do that because it checks the moduledef first. |
Okay, great. I was just going off of this description:
|
Description of Changes
Closes #3659
API and ABI breaking changes
Remove route and alter the semantics of the
callroute on both server andcliExpected complexity level and risk
1
Testing
proceduresand observe calling theclithe result is print.