Bug 8705

Summary: Store valid values for variables in the Toaster database
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: Toaster default assignee <toaster>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: Medium CC: belen.barros.pena, david.reyna, jessica.zhang, jose.perez.carranza, randy.macleod, stanciux.mihail
Version: 2.0   
Target Milestone: Future   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on: 7596    
Bug Blocks:    

Description Belen Barros Pena 2015-11-19 14:45:08 UTC
While fixing bug 7828, we came across something that has been coming up again and again as far as I can remember: how to keep the list of valid image types (the ones listed in the IMAGE_TYPES variable) up to date in Toaster (and before Toaster, in Hob). This enhancement is an attempt to solve this issue for good. 

It turns out those valid values are not stored in the Toaster database: right now they are hardcoded in the views.py file. And are, of course, out of date. 

IMAGE_TYPES / IMAGE_FSTYPES is not the only case where a variable has a set of valid values. There is PACKAGE_CLASSES, MACHINE_FEATURES, DISTRO_FEATURES and IMAGE_FEATURES. And we suspect there are others.

Ideally, Toaster would store up-to-date, valid values for all such variables (or, if not for all, at least for the most used). The main problem is how to get the list of valid values, since they are scattered around class and configuration files.
Comment 1 Belen Barros Pena 2016-02-11 18:27:04 UTC
After some discussion with Paul, turns out this bug depends on bug 7596, which in turn depends on 7985. 

Knowing the list of valid values for a certain value will also require some configuration parsing.
Comment 2 David Reyna 2018-08-15 09:02:03 UTC
There is still value in tracking this defect, even if the core bitbake enhancement 7596 is never fixed.

There are for example hard coded values in Toaster for common development variables, specifically "IMAGE_FSTYPES" that require manual updating, and are thus brittle.