Bug 7751 - Toaster allows me to build when no machine is set in the default configuration
Summary: Toaster allows me to build when no machine is set in the default configuration
Status: NEW
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 1.8
Hardware: x86 Multiple
: Medium normal
Target Milestone: Future
Assignee: Toaster default assignee
QA Contact:
URL:
Whiteboard: GUI design available
Depends on: 7329
Blocks:
  Show dependency tree
 
Reported: 2015-05-13 10:12 UTC by Belen Barros Pena
Modified: 2023-12-14 04:28 UTC (History)
7 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
no-machine-set.png (122.08 KB, image/png)
2015-05-13 10:12 UTC, Belen Barros Pena
no flags Details
Design - Handling incomplete project configurations (2.11 MB, application/pdf)
2015-05-14 09:07 UTC, Belen Barros Pena
no flags Details
Design - Handling incomplete project configurations (2.15 MB, application/pdf)
2015-07-27 13:34 UTC, Belen Barros Pena
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Belen Barros Pena 2015-05-13 10:12:47 UTC
Created attachment 2502 [details]
no-machine-set.png

To reproduce:

1. Remove the MACHINE variable from the meta-yocto/conf/toasterconf.json file
2. Set up Toaster from scratch
3. When prompted to select the configuration file, select the toasterconf.json you edited in step 1
4. Create a Toaster project

Outcome: in the project page, the machine is not set. The 'change' icon does not work, and you can start a build.

Expected outcome: a warning message should be displayed in the project page, and all build controls should be disabled.
Comment 1 Belen Barros Pena 2015-05-14 09:07:24 UTC
Created attachment 2506 [details]
Design - Handling incomplete project configurations
Comment 2 Michael Wood 2015-05-26 11:18:25 UTC
(In reply to comment #1)
> Created attachment 2506 [details]
> Design - Handling incomplete project configurations

The problem with this design is that it requires any page where building is available to know the *current* project's configuration, if you have changed the configuration in another tab or another user has done so, then the only way to update the current state of the build feature is to poll for a configuration change (sadly we can't support websockets with django/wsgi). This is do-able but it's not fool proof, you can end up with a race condition where the page hasn't updated yet and a machine has been unset and then you're still able to trigger a build. 

I think the only fully reliable way would be to check at the point of clicking build and then provide feedback.
Comment 3 Belen Barros Pena 2015-05-26 12:49:58 UTC
(In reply to comment #2)
> (In reply to comment #1)
> > Created attachment 2506 [details]
> > Design - Handling incomplete project configurations
> 
> 
> I think the only fully reliable way would be to check at the point of
> clicking build and then provide feedback.

Ugh: this would be bit ugly. Let me see if we can come up with something better.
Comment 4 Belen Barros Pena 2015-06-03 10:43:36 UTC
Some alternatives we have discussed:

* A simple polling mechanism that returns if the project configuration is valid or not

* Check on page load if the project configuration is valid. In the project page, the all layers page and the layer details page we would also need to check when you make a configuration change

* Check when running Toaster if a default machine is set as part of the application configuration. If not complain (although we will still need to handle the case where people delete all layers from a project)

This bug depends on bug 7329, so we still have time to think about how to do this.
Comment 5 Belen Barros Pena 2015-07-27 13:34:20 UTC
Created attachment 2603 [details]
Design - Handling incomplete project configurations

Update the document to reflect changes brought in by the image customisation feature
Comment 6 Belen Barros Pena 2016-04-25 14:27:16 UTC
I don't think this should be in progress review, so changing back to 'new' and moving to 2.2 (it's part of the UI cleaning).

The problem still exists. If for whatever reason the toasterconf.json file you loaded at set up time does not have the MACHINE variable set, your Toaster projects will be created with no machine selected, and they still let you build. If no machine is selected for whatever reason, you should not be able to build anything.