Skip to content
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

Suggest alternatives when active recipes are not found #4169

Merged
merged 1 commit into from
May 8, 2024

Conversation

timtebeek
Copy link
Contributor

What's changed?

When active recipe(s) not found, provide a helpful Did you mean: ... of closest match.

What's your motivation?

Misconfigurations are common and hard to spot, as seen in supporting OSS and even colleagues.
In particular when generated Refaster recipes are used, folks might fail to add the Recipe or Recipes suffix.
By providing the nearest match as a suggestion folks have an easier way to troubleshoot this themselves.

Anything in particular you'd like reviewers to focus on?

  1. I'd expect calls to Environment#activateRecipes(Iterable<String> activeRecipes) to be rare enough to be ok with the streams use there. Outside perhaps tests I'd expect that to be called once per recipe run. Calling that out for review.
  2. We already have a dependency on commons-lang3, which has the getLevenshteinDistance we use here. Didn't want to add a new dependency just for that, but in theory it's deprecated. In practice we're unlikely to move to a new major version any time soon.

Have you considered any alternatives or workarounds?

We could use a different method of providing alternatives.

Any additional context

This came up twice today; once in OSS and once internally; combined time savings would already have paid this off today.

@timtebeek timtebeek added the enhancement New feature or request label May 6, 2024
@timtebeek timtebeek self-assigned this May 6, 2024
@timtebeek
Copy link
Contributor Author

Also discussed on Slack; I'll take "makes sense" as approval to merge.

@timtebeek timtebeek merged commit ec09e19 into main May 8, 2024
1 check passed
@timtebeek timtebeek deleted the suggest-alternatives-when-recipe-not-found branch May 8, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

1 participant