-
Notifications
You must be signed in to change notification settings - Fork 33
Vehicle Component editor JSON Schema class refactor #612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
☂️ Python Coverage
Overall Coverage
New Files
Modified Files
|
Test Results 2 files ± 0 2 suites ±0 1m 56s ⏱️ +23s Results for commit cb5abd0. ± Comparison against base commit af95273. This pull request removes 47 and adds 84 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors the vehicle component editor to centralize JSON Schema handling in a new VehicleComponentsJsonSchema
class, injects the schema into data models and UI components, and updates tests to use the new schema-based workflows.
- Extracted datatype and description logic into
VehicleComponentsJsonSchema
- Injected schema into all
ComponentDataModel*
constructors and UI setup - Updated tests to instantiate and mock the new schema class
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
ardupilot_methodic_configurator/data_model_vehicle_components_json_schema.py | Introduces VehicleComponentsJsonSchema to manage schema logic |
ardupilot_methodic_configurator/frontend_tkinter_component_editor_base.py | Updates data model creation and UI delegation to use the new schema |
tests/ (multiple files) | Modifies tests to create and mock VehicleComponentsJsonSchema |
Comments suppressed due to low confidence (1)
ardupilot_methodic_configurator/frontend_tkinter_component_editor_base.py:444
- The method checks for
self.validate_data
but no such method is defined on the editor. You should call the actual validation API (e.g.,self.data_model.validate_all_data
) or implementvalidate_data
on the editor before this check.
if hasattr(self, "validate_data"):
mcu_series_field.pop("x-is-optional", None) | ||
|
||
logging_debug( | ||
_("Modified schema: MCU Series x-is-optional=%s to value=%u"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format string uses %u
which isn’t supported by Python’s old-style formatting; it should use %d
or %s
for the boolean/integer value to avoid runtime errors.
_("Modified schema: MCU Series x-is-optional=%s to value=%u"), | |
_("Modified schema: MCU Series x-is-optional=%s to value=%s"), |
Copilot uses AI. Check for mistakes.
ardupilot_methodic_configurator/frontend_tkinter_component_editor.py
Outdated
Show resolved
Hide resolved
db0f2bc
to
7f4f777
Compare
… separation of concerns
7f4f777
to
cb5abd0
Compare
No description provided.