-
Notifications
You must be signed in to change notification settings - Fork 163
Description
What would you like to be added?
When users type a command that doesn't exist, but a similar valid command exists,
it might be more helpful if Prow could suggest the relevant commands. For example:
The
/label release-note-nonecannot be applied. Did you mean/release-note-none?
Why is this needed?
Users often make typos or confuse command syntax.
For example:
/label release-note-noneThis fails because release-note-none is not a valid label, but the correct command /release-note-none exists.
Currently, the message Prow shows is as follows:
The label(s) /label release-note-none cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor, ci-short, ci-extended, ci-full, official-cve-feed. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?
New contributors cannot understand what is wrong and have to search through documentation to figure out the correct command.
Expected behavior
Expected message Prow shows might be:
The
/label release-note-nonecannot be applied. Did you mean/release-note-none?
This would help users quickly identify and correct their mistakes, improving the contributor experience especially for newcomers.
I think this could be implemented using edit distance (e.g., Levenshtein distance) to find similar command names.
Additional notes
Ideally, the error message could combine the benefits of both the current approach (showing available options) and the proposed suggestion (showing similar commands).