Skip to content

fix(plugins): skip python dependency install on modified_diff dry run - #3963

Open
EmilyRagan wants to merge 1 commit into
mainfrom
fix_modified_diff_python_install
Open

EmilyRagan wants to merge 1 commit into
mainfrom
fix_modified_diff_python_install

Conversation

@EmilyRagan

Copy link
Copy Markdown
Contributor

Problem

POST /openc3-api/plugins/modified_diff (called by ModifiedPluginDialog.loadDiff before a plugin upgrade) can return a 504.

The endpoint runs PluginModel.install_phase2(..., diff_only: true) inline in the request. The Python dependency block was guarded by unless validate_only rather than unless dry_run, so a diff-only run still invoked uvinstall/pipinstall. For plugins that ship a pyproject.toml or requirements.txt, the request waited on PyPI (minutes, or indefinitely on air-gapped systems) and also mutated the per-plugin venv, despite modified_diff being documented as read-only.

Change

  • Guard the Python install with dry_run, matching the other side effects in install_phase2.
  • Add a spec asserting no install command runs when diff_only is set.

validate_only is unchanged: it already feeds dry_run, and CLI validate still needs it as a distinct mode.

Not addressed

modified_diff can still be slow for large plugins, because it does one get_object per target file and builds a System per target. That can be a follow-up if needed.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.13%. Comparing base (e3a728f) to head (708cd01).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3963      +/-   ##
==========================================
- Coverage   80.13%   80.13%   -0.01%     
==========================================
  Files         901      901              
  Lines       68370    68365       -5     
  Branches     2699     2697       -2     
==========================================
- Hits        54789    54784       -5     
- Misses      12913    12916       +3     
+ Partials      668      665       -3     
Flag Coverage Δ
python 80.13% <ø> (ø)
ruby-api 82.65% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EmilyRagan EmilyRagan self-assigned this Sep 30, 2026
@EmilyRagan
EmilyRagan marked this pull request as ready for review September 30, 2026 22:49
@EmilyRagan
EmilyRagan marked this pull request as draft September 30, 2026 22:51
@EmilyRagan
EmilyRagan force-pushed the fix_modified_diff_python_install branch from 708cd01 to 7fa6ac5 Compare September 30, 2026 22:58
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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