Skip to content

refactor(parameter editor): do not unnecessarily reset the FC#1348

Merged
amilcarlucas merged 3 commits intomasterfrom
SID_AXIS
Mar 4, 2026
Merged

refactor(parameter editor): do not unnecessarily reset the FC#1348
amilcarlucas merged 3 commits intomasterfrom
SID_AXIS

Conversation

@amilcarlucas
Copy link
Collaborator

No need to reset the FC if SID_AXIS changes, only when it changes from 0 to something else

No need to reset the FC if SID_AXIS changes, only when it changes from 0 to something else
Copilot AI review requested due to automatic review settings March 4, 2026 00:17
Copy link
Contributor

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

Refactors the parameter reset workflow to avoid unnecessarily prompting for/triggering a flight controller reset when SID_AXIS changes between non-zero values, and adds tests covering the intended SID_AXIS edge cases.

Changes:

  • Updates upload_parameters_that_require_reset_workflow so SID_AXIS only triggers the “possible reset” path when moving from 0 (or missing) to a non-zero value.
  • Adds test cases for SID_AXIS transitions: 0→nonzero, nonzero→nonzero, nonzero→0, and missing→nonzero.

Reviewed changes

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

File Description
tests/test_data_model_parameter_editor.py Adds unit tests validating the new SID_AXIS reset behavior.
ardupilot_methodic_configurator/data_model_parameter_editor.py Refines the reset-trigger condition for SID_AXIS to only apply on 0→non-zero transitions.

Comment on lines +623 to +624
mock_ask_confirmation = MagicMock(return_value=True)
mock_show_error = MagicMock()
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

These new tests set up mock_ask_confirmation, but the assertions don’t verify whether the confirmation callback was invoked (or not) for each scenario. Adding explicit assertions like mock_ask_confirmation.assert_called_once() for the reset-triggering cases, and mock_ask_confirmation.assert_not_called() for the non-reset cases would make the tests more precise and prevent regressions where the UI prompt behavior changes unintentionally.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@copilot open a new pull request to apply changes based on this feedback

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Amilcar Lucas <amilcar.lucas@iav.de>
Copy link
Contributor

Copilot AI commented Mar 4, 2026

@amilcarlucas I've opened a new pull request, #1350, to work on those changes. Once the pull request is ready, I'll request review from you.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
11564 10529 91% 89% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/data_model_parameter_editor.py 65% 🟢
TOTAL 65% 🟢

updated for commit: 34ac513 by action🐍

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Test Results

    2 files      2 suites   28m 16s ⏱️
3 032 tests 3 027 ✅  5 💤 0 ❌
6 064 runs  6 054 ✅ 10 💤 0 ❌

Results for commit 8e8d0ca.

Co-authored-by: amilcarlucas <24453563+amilcarlucas@users.noreply.github.com>
@amilcarlucas amilcarlucas enabled auto-merge (squash) March 4, 2026 13:36
@amilcarlucas amilcarlucas disabled auto-merge March 4, 2026 13:37
@amilcarlucas amilcarlucas merged commit 47fd6cd into master Mar 4, 2026
24 of 25 checks passed
@amilcarlucas amilcarlucas deleted the SID_AXIS branch March 4, 2026 13:37
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.

3 participants