Add raw_result to CommandResultItem#235
Conversation
| formatter = self.output.get_formatter(output_type) | ||
| self.output.out(cmd_result, formatter=formatter, out_file=out_file) | ||
| self.raise_event(EVENT_CLI_SUCCESSFUL_EXECUTE, result=cmd_result.result) | ||
| self.raise_event(EVENT_CLI_SUCCESSFUL_EXECUTE, result=cmd_result) |
There was a problem hiding this comment.
Send the full CommandResultItem in case post-output hint relies on other attributes:
Lines 23 to 32 in 587abe5
There was a problem hiding this comment.
Can we add another parameter into EVENT_CLI_SUCCESSFUL_EXECUTE to keep cmd_result instead of overwrite the value of result?
Although azure-cli didn't use EVENT_CLI_SUCCESSFUL_EXECUTE event now, but I'm afraid some other cli depend on knack might face breaking change in result type. Since event handler func usually use func(*arg, **kwargs) so adding new paremeter won't cause breaking change.
There was a problem hiding this comment.
Adding arg in function invocation may also trigger breaking change if the callee doesn't accept the new arg.
We never guaranteed there will be no breaking changes:
https://github.com/microsoft/knack
The project is in initial development phase. We recommend pinning to at least a specific minor version when marking knack as a dependency in your project.
evelyn-ys
left a comment
There was a problem hiding this comment.
Ok with me if breaking change is acceptable😆
Add
raw_resulttoCommandResultItem, so that the raw result (before query) can be used by post-output hint (Azure/azure-cli#16242).