From e864cbfddc0efe1b89aa11cf4b7bdd10fac164fe Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 5 Apr 2024 16:22:55 +0200 Subject: [PATCH] Update - Only consider recipes when generating the list of recipes 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 ffb371e2b8a59144ddc37060cd20b6ee27808761) --- .../devtools/project/update/rewrite/QuarkusUpdateRecipe.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdateRecipe.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdateRecipe.java index 2d6339b98ae9d..2881032b0fd5d 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdateRecipe.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/project/update/rewrite/QuarkusUpdateRecipe.java @@ -51,6 +51,10 @@ public QuarkusUpdateRecipe addRecipe(Map 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; }