-
Notifications
You must be signed in to change notification settings - Fork 289
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
Doctor plugin & Kubernetes plugin usage #1106
Conversation
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.
Please fix the reported issuse in this PR and the rest issues in the follow-up PR. Thanks!
Follow-up PR:
- add support for
--bk-cmd-header='AI assistance'
in botkube core - add support for rendering inline buttons and dropdowns in the same line
- in general if all buttons in a given section doesn't have description then they are printed in a single line. In this case we should also handle the dropdown and print dropdowns also in the line with buttons.
both things were handled on the hackathon PR but there require some polishing: https://github.com/kubeshop/botkube/pull/1066/files
c77ca03
to
775b56b
Compare
@mszostok I tried to handle them all in this PR, I already included AI assistance partially, so just wanted to wrap up them all. Let's sync tomorrow to visit it once more. |
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.
currently the kubectl builder doesn't work, the renderer logic needs to be adjusted 👍
internal/executor/doctor/executor.go
Outdated
} | ||
doctorParams, err := normalizeCommand(in.Command) | ||
if err != nil { | ||
return executor.ExecuteOutput{}, fmt.Errorf("while nomralizing command: %w", err) |
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.
return executor.ExecuteOutput{}, fmt.Errorf("while nomralizing command: %w", err) | |
return executor.ExecuteOutput{}, fmt.Errorf("while normalizing command: %w", err) |
pkg/execute/params.go
Outdated
@@ -140,3 +149,46 @@ func regexFlag(flag, escapedParamVal string) (*regexp.Regexp, error) { | |||
escapedParamVal, | |||
escapedParamVal)) | |||
} | |||
|
|||
func extractHeaderParam(cmd string) (string, string, error) { |
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.
we already have generic extractParam
please use it instead of this 👍
pkg/bot/slack_renderer.go
Outdated
return []slack.Block{ | ||
// We use actions layout as we have only buttons that we want to display in a single line. | ||
// https://api.slack.com/reference/block-kit/blocks#actions | ||
slack.NewActionBlock( | ||
"", | ||
btns..., | ||
selects.BlockID, |
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.
this might be nil and we get a panic, I tried to use kubectl builder and it doesn't work.
also line with extracting the slice of elements causes panic
@mszostok I have applied suggestions and tested accordingly. |
pkg/execute/params.go
Outdated
multipleFilters = "incorrect use of --filter flag: found more than one filter flag" | ||
missingCmdFilterValue = `incorrect use of --filter flag: an argument is missing. use --filter="value" or --filter value` |
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.
please remove :)
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.
awesome work 🚀
Co-authored-by: Mateusz Szostok <[email protected]>
a52f2a6
to
edd6a2b
Compare
Description
Changes proposed in this pull request:
Testing
PLUGIN_DOWNLOAD_URL_BASE_PATH="http://localhost:8080/plugin-dist" make gen-plugins-index
kubectl run nginx --image=nginx2
to see error event in slackRelated issue(s)
#1070