blue-build / cli

BlueBuild's command line program that builds custom Fedora Atomic images based on your recipe.yml
https://blue-build.org/
Apache License 2.0
51 stars 5 forks source link

bug: multiple module types in one .yml file fails silently #162

Closed michaelhaaf closed 2 months ago

michaelhaaf commented 2 months ago

Background

The current documentation about recipe.yml files does explain clearly that a modules key is required when you have more than one module type in the same file.

Let's say you didn't notice this, and you extend a flat module file (with only one type of module) by adding a second type of module. Here's a simple example, where a working common-fonts.yml with just the fonts module has an rpm-ostree module added to it like so:

diff --git a/config/common-fonts.yml b/config/common-fonts.yml
--- a/config/common-fonts.yml
+++ b/config/common-fonts.yml
type: fonts
fonts:
   nerd-fonts:
     - Iosevka
     - FiraCode
     - JetBrainsMono
     - NerdFontsSymbolsOnly

+type: rpm-ostree
+install:
+  - ibm-plex-fonts-all

What happens?

Current behavior

In a real-life example with a very similar change: The build succeeds, despite a "duplicate type" error being logged (link should open at line # of error log).

Note: the module fails to complete. I only noticed because I didn't actually test this on a new system until 2 weeks later, and none of the fonts I'm used to being present were there.

Expected behavior

Build should fail -- the module failed to run, in this case the fonts failed to install.

Test environment

BlueBuild GitHub Action (not reproduced locally). See link in "Current behavior" section

Example recipe

Here are the module recipes used in the "Current Behavior" section:

gmpinder commented 2 months ago

Ah good catch. I'll be sure to have it properly fail