mbox series

[v2,0/5] toaster: Add per-recipe variable view

Message ID 20260814153602.2107764-1-paolo.wattebled@savoirfairelinux.com
Headers show
Series toaster: Add per-recipe variable view | expand

Message

Paolo Wattebled Aug. 14, 2026, 3:35 p.m. UTC
Toaster currently records global build variables but does not expose the
final values associated with individual recipes.

This series collects variables defined or modified by recipes, matching
bbappends and recipe include files. It stores one compressed, build-specific
snapshot per recipe and exposes the values through a searchable and paginated
Variables tab.

The snapshots contain final expanded values and variable flags, including
PACKAGECONFIG[...] entries. Values inherited unchanged from global
configuration or classes, functions and inactive overrides are excluded.

This information is intended to provide build-specific context to tools using
Toaster as a backend, including vulnerability-assessment agents consuming the
data through MCP.

The series is split into separate changes for variable collection, database
schema, persistence, reusable table controls and the user interface.

Changes in v2:
- Split the original patch into five incremental patches.
- Cover direct assignments, variable operations and active overrides.
- Include recipe and bbappend .inc files while excluding class-only metadata.
- Preserve variable flags, including PACKAGECONFIG[...] values.
- Store one compressed snapshot per build and recipe.
- Add transactional replacement and backward-compatibility handling.
- Add extraction, persistence, pagination, searching, escaping and count tests.
- Keep the BitBake cache version at 157.

Testing:
- PATH="$PWD/bin:$PATH" PYTHONPATH=lib python3 -m unittest \
    bb.tests.cache_extra bb.tests.parse
- Focused Toaster database and view tests
- Python compilation and git diff --check

Paolo Wattebled (5):
  cache_extra: Collect recipe variable snapshots
  toaster: Add recipe variable snapshot model
  toaster: Store recipe variable snapshots
  toaster: Generalize detail table controls
  toaster: Add recipe variables view on UI

 bin/bitbake-selftest                          |   1 +
 lib/bb/cache.py                               |   2 +-
 lib/bb/cache_extra.py                         | 101 +++++++-
 lib/bb/cookerdata.py                          |   5 +-
 lib/bb/tests/cache_extra.py                   | 235 ++++++++++++++++++
 lib/bb/ui/buildinfohelper.py                  |  21 +-
 .../orm/migrations/0022_recipevariable.py     |  27 ++
 lib/toaster/orm/models.py                     |  10 +
 lib/toaster/tests/db/test_db.py               | 101 ++++++++
 lib/toaster/tests/views/test_views.py         | 155 +++++++++++-
 lib/toaster/toastergui/buildtables.py         |  11 +-
 .../templates/detail_pagination_bottom.html   |   4 +-
 .../templates/detail_search_header.html       |   2 +-
 lib/toaster/toastergui/templates/recipe.html  |  32 +++
 .../toastergui/templates/recipe_packages.html |   7 +
 lib/toaster/toastergui/views.py               |  68 ++++-
 16 files changed, 770 insertions(+), 12 deletions(-)
 create mode 100644 lib/bb/tests/cache_extra.py
 create mode 100644 lib/toaster/orm/migrations/0022_recipevariable.py

--
2.55.0