Repository navigation
Launcher generator: leave unset manifest entries empty (New) - #3040
Conversation
Add an "unset" option to the bool manifest toggle and write unset manifest entries as an empty "key =" line instead of "key = false". Empty values now start on "unset", so confirming without choosing no longer turns an entry into true. Also let the test _FakeEdit accept extra kwargs so the ItemRow edit mode tests pass, and update the README.
3ce9b67 to
e08b1a9
Compare
There was a problem hiding this comment.
Update: Rick applied all 8 suggestions in 5e12071 and 71d41e9. I checked the new head 71d41e9:
- 133 unit tests pass.
- I made a launcher for a real device (plan
ce-oem-iot-desktop-24-04) with 26 entries left unset. The file has nokey =lines, and checkbox accepts all 65 manifest values.
The blocking issue is fixed, so I no longer request changes. The other points are not blocking. They are recorded in OEMQA-7026: empty values from the launcher template, a test that reads the launcher back, a README note for old launchers, the notes below, and usability feedback from a first-time user.
Thanks for the change. I followed the README step by step as a new user, at the PR head (e08b1a9):
- Unit tests: 133 tests pass when I run the README command from
tests/. Onmain, 3ItemRowtests fail with_FakeEdit.__init__() got an unexpected keyword argument 'wrap', so the_FakeEdit(**kwargs)change is correct. - TUI:
./gen_launcher.py --providers-dir <checkout>→/filter →ce-oem-iot-ubuntucore-26→ the editor shows 97 manifest entries. The toggle shows[true] [false] [unset].t,f,u,SpaceandEnterwork as the README says, andswrites the launcher. I set 3 entries; the other 94 are written askey =. - Run the launcher (next step in the README): checkbox stops at the manifest step, before any job runs:
Invalid manifest com.example::has_probe value ''
Blocking issue: checkbox reads key = as the string '', not as None, and '' is not a valid bool. To keep an entry "None", leave the key out of [manifest]. Details and the repro are in the inline comment on write_launcher(). The other suggestions update the docstrings, README and test to match, so you can apply them as one batch.
Other notes (not blocking)
- README "Running the tests": the command works only from
tests/. From the tool root it givesModuleNotFoundError(errors=2). Please addcd teststo the example. - README says "123 unit tests total". There are now 133. Maybe remove the number, so that it does not become wrong again.
- PR "Tests" section: please also add a run of a generated launcher with
checkbox-cli(orcheckbox-cli-wrapper). The unit tests and the snap build do not show the issue above.
Co-authored-by: Isaac Yang <47034756+seankingyang@users.noreply.github.com>
…-generator/src/gen_launcher.py Co-authored-by: Isaac Yang <47034756+seankingyang@users.noreply.github.com>
Rick applied all suggestions (5e12071, 71d41e9). I checked the fix on a real launcher. The other points are not blocking; they are in OEMQA-7026.
seankingyang
left a comment
There was a problem hiding this comment.
Thanks, Rick. I checked 71d41e9: 133 tests pass, and a launcher made for a real device has no key = lines, so checkbox accepts all manifest values. The remaining non-blocking points are tracked in OEMQA-7026.
Description
As discussed during the sprint, we would like to keep unmet manifests as None instead of setting them to False.
Add an "unset" option to the bool manifest toggle and write unset manifest entries as an empty "key =" line instead of "key = false". Empty values now start on "unset", so confirming without choosing no longer turns an entry into true.
Also let the test _FakeEdit accept extra kwargs so the ItemRow edit mode tests pass, and update the README.
Resolved issues
Documentation
Tests
test build
https://github.com/canonical/checkbox/actions/runs/42941307237/job/130375999660