Skip to content

Do not skip component editor if blanking component data was selected #599

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 1 commit into from
Jun 29, 2025

Conversation

amilcarlucas
Copy link
Collaborator

The user needs to enter the component data before proceeding, skipping is not an option

This pull request refines the logic in the component_editor function within ardupilot_methodic_configurator/__main__.py to ensure that the component editor is only skipped under specific conditions.

Logic refinement:

  • Updated the condition for skipping the component editor to include additional checks. The editor is now skipped only if state.args.skip_component_editor is true and the vehicle_dir_window has a valid configuration_template and non-empty blank_component_data.

@Copilot Copilot AI review requested due to automatic review settings June 28, 2025 11:59
Copilot

This comment was marked as outdated.

Copy link
Contributor

github-actions bot commented Jun 28, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
6983 5279 76% 73% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/main.py 88% 🟢
TOTAL 88% 🟢

updated for commit: 80279da by action🐍

Copy link
Contributor

github-actions bot commented Jun 28, 2025

Test Results

    2 files  ±0      2 suites  ±0   1m 28s ⏱️ -1s
1 373 tests ±0  1 366 ✅ ±0   7 💤 ±0  0 ❌ ±0 
2 746 runs  ±0  2 732 ✅ ±0  14 💤 ±0  0 ❌ ±0 

Results for commit 80279da. ± Comparison against base commit 5efa55e.

♻️ This comment has been updated with latest results.

…nent data was selected

The user needs to enter the component data before proceeding, skipping is not an option
AI fix

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@amilcarlucas amilcarlucas merged commit ff0a51d into master Jun 29, 2025
26 checks passed
@amilcarlucas amilcarlucas deleted the fix_ce branch June 29, 2025 22:32
@amilcarlucas amilcarlucas requested a review from Copilot June 29, 2025 22:32
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 refines the skip condition logic in the component_editor function to ensure that component data is required when blanking is selected.

  • Updated the skip condition in ardupilot_methodic_configurator/main.py to require a valid vehicle_dir_window with configuration_template and non-empty blank_component_data.
  • Modified the test in tests/test__main__.py to simulate the scenario where the skip condition is met.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
ardupilot_methodic_configurator/main.py Refines the skip condition logic to ensure the component editor is not skipped improperly.
tests/test__main__.py Updates the test setup to mirror the new condition by setting vehicle_dir_window to None.
Comments suppressed due to low confidence (1)

tests/test__main__.py:1158

  • [nitpick] Consider adding additional test cases to cover scenarios where vehicle_dir_window exists but either configuration_template is missing or blank_component_data.get() returns a falsy value, to ensure complete coverage of the new skip logic.
        application_state.vehicle_dir_window = None

@@ -317,7 +317,12 @@ def component_editor(state: ApplicationState) -> None:
)

# Handle skip component editor option
if state.args.skip_component_editor:
should_skip_editor = state.args.skip_component_editor and not (
Copy link
Preview

Copilot AI Jun 29, 2025

Choose a reason for hiding this comment

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

The combined boolean condition is somewhat complex; consider refactoring it into a helper function or adding inline comments for each sub-condition to improve readability and maintainability.

Copilot uses AI. Check for mistakes.

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