Skip to content

Commit

Permalink
Update - Only consider recipes when generating the list of recipes
Browse files Browse the repository at this point in the history
Only documents of type /recipe should be taken into account when
generating the list of recipes.

See
https://github.com/quarkusio/quarkus-updates/blob/db61f918fce71751a50a9f69a98a451ebadf07df/recipes/src/main/resources/quarkus-updates/org.apache.camel.quarkus/camel-quarkus/3alpha.yaml#L27-L32
for an example of the problem.

(cherry picked from commit ffb371e)
  • Loading branch information
gsmet committed Apr 9, 2024
1 parent 44418fd commit e864cbf
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public QuarkusUpdateRecipe addRecipe(Map<String, Object> recipe) {
if (!recipe.containsKey("name") || !(recipe.get("name") instanceof String)) {
throw new IllegalArgumentException("Recipe name is required");
}
// some YAML documents might not be recipes. For instance, they could be categories.
if (!recipe.containsKey("type") || !recipe.get("type").toString().endsWith("/recipe")) {
return this;
}
this.recipes.add(recipe);
return this;
}
Expand Down

0 comments on commit e864cbf

Please sign in to comment.