steampipe
steampipe copied to clipboard
rationalise the use of status/progress hooks
We currently have the following context 'hooks'
-
StatusHooks
, which is used to display the spinner during interactive query execution -
SnapshotProgress
used to display snapshot generation progress messages -
MessageRenderer
used to add messages and warning to the InitData during query init (for failed prepared statements and FDW updates) - Dashboard has its own (non hooks-based) display mechanism
There is also some cross-referencing - utils.ShowError
calls statushooks.StatusDone(ctx)
to stop any ongoing status hooks. This is a bit of a confusion of concerns - ShowError
should just show the error
For now it has been moved to status_hooks
passage to avoid circular refs
Ideally we need tor simplify the hooks to be consistent - and to facilitate showing warnings at any time in the appropriate manner