Bug 8721

Summary: We are not validating machine input
Product: [Build System, Metadata & Runtime] Toaster Reporter: Belen Barros Pena <belen.barros.pena>
Component: toasterAssignee: Awais <awais_belal>
Status: RESOLVED FIXED QA Contact: Libertad <libertad.gonzalez.de.la.cruz>
Severity: minor    
Priority: Low CC: awais_belal, belen.barros.pena, david.reyna, jessica.zhang, stanciux.mihail
Version: 2.0   
Target Milestone: 2.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard: GUI design available
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
Design - Validating machine input none

Description Belen Barros Pena 2015-11-24 10:50:39 UTC
When you type the machine name in the project configuration page, instead of selecting a suggestion from the type ahead, we should be checking that the machine name does not include spaces. Right now, you can type any spaces you want in there and save the invalid machine.
Comment 1 Belen Barros Pena 2015-11-24 10:52:32 UTC
Created attachment 2866 [details]
Design - Validating machine input
Comment 2 Belen Barros Pena 2016-02-15 14:45:53 UTC
I was asked to check if I could still reproduce this, and unfortunately I can. This is what's possible:

1. You can type a space in the middle of a valid machine name and save
2. You can type a space after a valid machine name and save
3. You can type a space before a valid machine name and save

In all 3 cases, your builds will fail during sanity checks:

 OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    Please set a valid MACHINE in your local.conf or environment

We should remove any spaces before or after the machine name on saving (2 and 3 above). To deal with 1, see the attached design document.
Comment 3 Belen Barros Pena 2016-04-25 14:05:08 UTC
Part of the "UI cleaning" work. Moving to 2.2
Comment 4 Awais 2017-02-27 12:19:33 UTC
Submitted https://patchwork.openembedded.org/patch/137645/
Comment 5 David Reyna 2017-03-08 03:00:39 UTC
I have tested this patch and it passes all three of Belen's test cases for me.

My only surprise was that when you insert a space in front you will probably not see the error message because it is hidden behind the lookahead options. If you click to the side, the lookahead disappears and the error message is then visible.

To me this acceptable,since the red halo around the entry is visible and the Save button is indeed disabled. Disappearing the lookahead is just a nice-to-have.
Comment 6 David Reyna 2017-04-05 23:38:36 UTC
Patch sent upstream.