Skip to content

Add a motor test sub-application requirements #596

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

Merged
merged 4 commits into from
Jul 6, 2025
Merged

Conversation

amilcarlucas
Copy link
Collaborator

This pull request introduces a new feature for managing and updating ArduPilot motor diagram SVG files, along with several related changes to the codebase and documentation. The key updates include adding a script for downloading motor diagrams, integrating it into the CI/CD pipeline, updating file paths for consistency, and enhancing documentation to support this feature.

New Feature: Motor Diagram Management

  • Added a new script, scripts/download_motor_diagrams.py, to automate downloading motor diagram SVG files from the ArduPilot documentation. This script includes error handling and validation for secure URL downloads.
  • Created a corresponding GitHub Actions workflow, .github/workflows/update_motor_diagrams.yml, to periodically run the script and create pull requests with updated diagrams.
  • Added a new instruction document, .github/instructions/update_motor_diagrams.md, providing detailed manual and automated update guidelines for motor diagrams.

Documentation Updates

  • Updated .github/copilot-instructions.md to include a link to the new motor diagrams update instructions.
  • Enhanced ARCHITECTURE.md to document the motor test sub-application, its integration with motor diagrams, and the autogenerated download_motor_diagrams.py script. [1] [2] [3] [4]

Codebase Refactoring

  • Updated file paths for the application icon and logo in backend_filesystem_program_settings.py to use a new images directory for better organization.
  • Adjusted the desktop entry path in SetupDeveloperPC.sh to reflect the new images directory.

Testing Enhancements

  • Updated tests in tests/test_backend_filesystem_program_settings.py to reflect the changes in file paths for the application icon and logo. [1] [2]

These changes collectively improve the maintainability and automation of motor diagram updates while enhancing the organization and clarity of the codebase and documentation.

@Copilot Copilot AI review requested due to automatic review settings June 27, 2025 13:16
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds automated management for ArduPilot motor diagram SVGs and reorganizes image assets, along with updates to packaging, tests, and documentation.

  • Introduces scripts/download_motor_diagrams.py plus a GitHub Actions workflow and manual update instructions.
  • Refactors code and installer scripts to use a new images/ directory for icons and SVGs.
  • Updates tests and documentation (ARCHITECTURE.md, .github/*) to reflect the new feature and asset paths.

Reviewed Changes

Copilot reviewed 10 out of 55 changed files in this pull request and generated no comments.

Show a summary per file
File Description
windows/ardupilot_methodic_configurator.iss Updated installer to deploy icons/SVGs from images/
ardupilot_methodic_configurator/backend_filesystem_program_settings.py Changed icon/logo paths to images/ subdirectory
tests/test_backend_filesystem_program_settings.py Updated tests to expect new images/ directory paths
scripts/download_motor_diagrams.py Added script to download motor diagrams from docs
.github/workflows/update_motor_diagrams.yml CI workflow to run the download script weekly
.github/instructions/update_motor_diagrams.md Manual and AI guidelines for updating motor diagrams
.github/copilot-instructions.md Added link to motor diagram update instructions
ARCHITECTURE_motor_test.md New detailed architecture for the motor test sub-app
ARCHITECTURE.md Registered the motor test sub-app and download script
SetupDeveloperPC.sh Updated desktop entry icon path to images/ directory
Comments suppressed due to low confidence (2)

scripts/download_motor_diagrams.py:78

  • Add unit tests for download_motor_diagrams(), mocking urllib.request.urlretrieve, directory creation, and URL validation to ensure the new script is covered by pytest.
def download_motor_diagrams() -> None:

tests/test_backend_filesystem_program_settings.py:18

  • [nitpick] Instead of using a backslash for import continuation, wrap the import in parentheses for better readability and to satisfy PEP 8.
from ardupilot_methodic_configurator.backend_filesystem_program_settings import \

Copy link
Contributor

github-actions bot commented Jun 27, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7676 5931 77% 73% 🟢

New Files

File Coverage Status
ardupilot_methodic_configurator/backend_filesystem_json_with_schema.py 100% 🟢
ardupilot_methodic_configurator/data_model_motor_test.py 77% 🟢
TOTAL 88% 🟢

Modified Files

File Coverage Status
ardupilot_methodic_configurator/main.py 87% 🟢
ardupilot_methodic_configurator/backend_filesystem_program_settings.py 99% 🟢
ardupilot_methodic_configurator/backend_flightcontroller.py 42% 🟢
TOTAL 76% 🟢

updated for commit: 3655c4c by action🐍

Copy link
Contributor

github-actions bot commented Jun 27, 2025

Test Results

    2 files  ±  0      2 suites  ±0   1m 42s ⏱️ ±0s
1 563 tests +142  1 556 ✅ +142   7 💤 ±0  0 ❌ ±0 
3 126 runs  +284  3 112 ✅ +284  14 💤 ±0  0 ❌ ±0 

Results for commit 3655c4c. ± Comparison against base commit 78bcf75.

This pull request removes 17 and adds 159 tests. Note that renamed tests count towards both.
tests.test_backend_filesystem_program_settings.TestProgramSettings ‑ test_application_icon_filepath
tests.test_backend_filesystem_program_settings.TestProgramSettings ‑ test_application_logo_filepath
tests.test_backend_filesystem_program_settings.TestProgramSettings ‑ test_create_new_vehicle_dir_already_exists
tests.test_backend_filesystem_program_settings.TestProgramSettings ‑ test_create_new_vehicle_dir_failure
tests.test_backend_filesystem_program_settings.TestProgramSettings ‑ test_display_usage_popup
tests.test_backend_filesystem_program_settings.TestProgramSettings ‑ test_get_setting
tests.test_backend_filesystem_program_settings.TestProgramSettings ‑ test_get_setting_gui_complexity
tests.test_backend_filesystem_program_settings.TestProgramSettings ‑ test_get_settings_as_dict_file_exists
tests.test_backend_filesystem_program_settings.TestProgramSettings ‑ test_get_settings_as_dict_file_not_exists
tests.test_backend_filesystem_program_settings.TestProgramSettings ‑ test_set_display_usage_popup
…
tests.test_backend_filesystem_json_with_schema.TestDataValidation ‑ test_user_can_validate_correct_data_successfully
tests.test_backend_filesystem_json_with_schema.TestDataValidation ‑ test_user_handles_validation_without_schema_gracefully
tests.test_backend_filesystem_json_with_schema.TestDataValidation ‑ test_user_sees_validation_errors_for_invalid_data
tests.test_backend_filesystem_json_with_schema.TestFilesystemJSONWithSchemaInitialization ‑ test_user_can_create_instance_with_valid_filenames
tests.test_backend_filesystem_json_with_schema.TestFilesystemJSONWithSchemaIntegration ‑ test_user_completes_full_workflow_successfully
tests.test_backend_filesystem_json_with_schema.TestFilesystemJSONWithSchemaIntegration ‑ test_user_workflow_fails_gracefully_on_invalid_data
tests.test_backend_filesystem_json_with_schema.TestJSONDataLoading ‑ test_user_can_load_valid_json_data_successfully
tests.test_backend_filesystem_json_with_schema.TestJSONDataLoading ‑ test_user_handles_corrupted_json_file_gracefully
tests.test_backend_filesystem_json_with_schema.TestJSONDataLoading ‑ test_user_handles_missing_json_file_gracefully
tests.test_backend_filesystem_json_with_schema.TestJSONDataLoading ‑ test_user_loads_invalid_data_with_warning_logged
…

♻️ This comment has been updated with latest results.

@amilcarlucas amilcarlucas force-pushed the motor_test_app branch 5 times, most recently from 2db9348 to bec06a6 Compare June 30, 2025 17:06
@amilcarlucas amilcarlucas force-pushed the motor_test_app branch 2 times, most recently from 66bfa58 to f111ef3 Compare July 5, 2025 13:06
@amilcarlucas amilcarlucas merged commit f856f6e into master Jul 6, 2025
22 of 28 checks passed
@amilcarlucas amilcarlucas deleted the motor_test_app branch July 6, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant