Skip to content

fix(recipe): change serde alias to rename#751

Open
alexandregv wants to merge 1 commit intoblue-build:mainfrom
alexandregv:main
Open

fix(recipe): change serde alias to rename#751
alexandregv wants to merge 1 commit intoblue-build:mainfrom
alexandregv:main

Conversation

@alexandregv
Copy link
Copy Markdown

@alexandregv alexandregv commented Apr 12, 2026

Motivation

See #750

alias only affects deserialization, rename affects both serialization and deserialization.

Old behavior

$ bluebuild generate -d -q ./recipes/recipe.yaml -o ./recipes/recipe.flat.yaml
$ grep image recipes/recipe.flat.yaml
base_image: ghcr.io/ublue-os/silverblue-main
image_version: '44'
$ bluebuild validate ./recipes/recipe.flat.yaml
ERROR => Failed:
  × Recipe ./recipes/recipe.flat.yaml failed to validate
  ╰─▶   × 3 errors encountered
         ╭─[./recipes/recipe.flat.yaml:1:1]
       1 │ name: my-recipe
         · ┬┬┬
         · ││╰── "image-version" is a required property
         · │╰── "base-image" is a required property
         · ╰── Additional properties are not allowed ('base_image', 'image_version' were unexpected)
       3 │ base_image: ghcr.io/ublue-os/silverblue-main
       4 │ image_version: '44'
         ╰────

New behavior

$ bluebuild generate -d -q ./recipes/recipe.yaml -o ./recipes/recipe.flat.yaml
$ grep image recipes/recipe.flat.yaml
base-image: ghcr.io/ublue-os/silverblue-main
image-version: '44'
$ bluebuild validate ./recipes/recipe.flat.yaml
$ bluebuild switch ./recipes/recipe.flat.yaml

Tests

test result: ok. 56 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.08s

     Running unittests src/bin/bluebuild.rs (target/debug/deps/bluebuild-c3cbb03b31652e2a)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

   Doc-tests blue_build

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

Fix #750

@alexandregv alexandregv requested a review from gmpinder as a code owner April 12, 2026 21:27
Copy link
Copy Markdown
Member

@gmpinder gmpinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!

@gmpinder gmpinder enabled auto-merge (squash) April 12, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generate -d / --display-full-recipe uses wrong field name base_image image_version

2 participants