kubernetes-sigs / prow

Prow is a Kubernetes based CI/CD system developed to serve the Kubernetes community. This repository contains Prow source code and Hugo sources for Prow documentation site.
https://docs.prow.k8s.io
Apache License 2.0
129 stars 99 forks source link

Comment when no plugin or external-plugin handles a command #324

Open smg247 opened 1 week ago

smg247 commented 1 week ago

Prow has many plugins, with the option of adding yet more external plugins to the installation. Often times, users interacting with prow will mis-type a plugin command, and the respective plugin won't pick it up and it will look like their command is just being ignored. To combat this, we have added some common misspellings and mistakes to regex in specific external plugins in order to generate an error. It would be even better if there were some mechanism that commented whenever a user began a command with /, and the command wasn't picked up by any plugin or external plugin. It would simply have to look for that, and comment back to the user that their command is invalid with a link to the plugin-help page.

Implementation notes: This might be complicated, and may require the addition of a boolean return value on the *Handler functions in order to signify that the command was handled by that handler.

smg247 commented 1 week ago

/kind feature

petr-muller commented 1 week ago

This would be very useful, but quite tricky for external plugins - IIRC hook just passes the received webhook call to the external plugin via http and does not block, so I dont think we have a centralized place that could receive all "not handled, sorry" responses.

smg247 commented 6 days ago

We may need to spin up another thread that waits for a "yes, I handled this" or "ignoring" response from each external plugin. Definitely have some details to work out.

Prucek commented 4 days ago

Could we use something like smee.io? Konflux is using it: https://konflux-ci.dev/docs/advanced-how-tos/installing/enabling-builds/ https://github.com/konflux-ci/konflux-ci/blob/main/pkg/konftool/gh_app/web.go#L36

smg247 commented 3 days ago

@Prucek, that is interesting, but how would smee help us discern when none of the plugins have handled the request?

Prucek commented 3 days ago

I thought, before forwarding the call to hook, it could do a check, what plugins are available, but I guess it's not that easy