sunnylink: regenerate settings_ui.json (restores the Ford pinion toggle)#152
Merged
Merged
Conversation
The bp-dev merge in BluePilotDev#145 resolved the settings_ui.json conflict by hand and fused two adjacent toggle objects into one: FordPrefSteerAngleCurvature kept its opening brace, then BPUseCustomSounds' keys were appended into the same object instead of starting a new one. JSON allows duplicate keys and the last wins, so the file still parsed and still grepped as containing both toggle names -- but once parsed, the pinion toggle was gone from the sunnylink settings UI along with its offroad_only enablement. The feature itself merged fine; only its remote settings entry disappeared. settings_ui.json is generated from settings_ui_src/ by tools/compile_settings_ui.py. The YAML source is correct and was never affected, so this simply regenerates the committed artifact from it. Verified: tools/compile_settings_ui.py --check now matches (it did not before), and sunnypilot/sunnylink/tests/ goes from 2 failed / 75 passed to 77 passed / 1 skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sunnylink: regenerate settings_ui.json (restores the Ford pinion toggle)
The bp-dev merge in #145 hand-resolved the
settings_ui.jsonconflict and fused twoadjacent toggle objects into one. The feature itself merged correctly — only its remote
settings entry disappeared. This regenerates the file from its source.
The evidence that motivated this
settings_ui.jsonon current bp-dev contains this (abridged):{ "key": "FordPrefSteerAngleCurvature", "title": "[Vehicle] Use Pinion Yaw Sensor", "description": "...", "key": "BPUseCustomSounds", <-- second key, same object "title": "[Audio] Use Custom Engage/Disengage Sounds", "enablement": [{ "type": "offroad_only" }] }FordPrefSteerAngleCurvatureopened an object, thenBPUseCustomSounds' keys wereappended into that same object instead of starting a new one. JSON permits duplicate
keys and the last one wins, so:
took its
offroad_onlyenablement with it.That combination is why it survived review: every cheap check passes. It only shows up
when you parse the file and look for the key, or when you run the compiler in
--checkmode.
Confirming on current bp-dev:
Why the fix is shaped this way
settings_ui.jsonis a generated artifact —sunnypilot/sunnylink/tools/compile_settings_ui.pyemits it from the authoring tree in
settings_ui_src/. The YAML source(
settings_ui_src/pages/vehicle.yaml) was resolved correctly during the merge and stillholds both toggles as separate, complete entries.
So this is not a hand-patch of the JSON. It is one run of the compiler, committing what
it emits. Hand-editing generated output is what produced the bug in the first place.
The evidence afterwards
tools/compile_settings_ui.py --checkreports a match. Before this commit it reporteddiffers from compiled output.sunnypilot/sunnylink/tests/goes from 2 failed / 75 passed to77 passed / 1 skipped. The two failures were
TestRoundtrip::test_committed_file_is_canonicalandTestSchemaCoverage::test_all_schema_keys_exist_in_params.FordPrefSteerAngleCurvature→[offroad_only],BPUseCustomSounds→[offroad_only],BPCustSoundsSelection→[offroad_only, param BPUseCustomSounds].separate the two objects. No content is added or removed.
What each change is
One commit, one generated file. No source, schema, or behaviour changes.
Test it yourself
Risks / limits
validate_settings_ui.pystillreports
duplicate keys: 'BlinkerMinLateralControlSpeed' in [steering, vehicle_settings.ford]. That key is declared in bothsteering.yamlandvehicle.yamlon stock bp-dev and predates this work — worth a separate fix.compile_settings_ui.py --checkwouldhave caught this at the merge, since the failure mode is invisible to review.