fix(plugins): protect modified files on upgrade and surface diff failures - #3969
Open
EmilyRagan wants to merge 5 commits into
Open
EmilyRagan wants to merge 5 commits into
EmilyRagan wants to merge 5 commits into
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
…istory - Show the delete-modified checkbox on upgrade when Version History is disabled, since kept modified files override the new plugin - Show modified_diff failures in the dialog instead of reporting that no modified files conflict - Check the delete box in the upgrade playwright test when it is shown Co-Authored-By: Claude <noreply@anthropic.com>
EmilyRagan
force-pushed
the
fix_modified_plugin_dialog_upgrade
branch
from
September 30, 2026 23:11
708cd01 to
4a16877
Compare
EmilyRagan
changed the base branch from
fix_modified_diff_python_install
to
main
September 30, 2026 23:11
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3969 +/- ##
==========================================
- Coverage 80.13% 80.12% -0.02%
==========================================
Files 901 901
Lines 68370 68374 +4
Branches 2699 2650 -49
==========================================
- Hits 54789 54784 -5
- Misses 12913 12924 +11
+ Partials 668 666 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude <noreply@anthropic.com>
EmilyRagan
marked this pull request as ready for review
September 30, 2026 23:19
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problems
PluginModel.modified_diffrescued every error and returned[], andModifiedPluginDialog.loadDiffalso turned any request failure (including a 504) into[]. The dialog then said "None of {plugin}'s modified files conflict with the new plugin. Installing will proceed normally.", even though no check had completed.TargetModel#apply_upgrade_versiononly runs when the EnterpriseVersionStoreis present, so in Core the modified copy undertargets_modified/stays in place and keeps overriding the new plugin's file. Nothing is versioned, and the old "delete modified files" option was removed, so Core users had no way to take the plugin's version.TargetModel#version_store_available?only checked that the EnterpriseVersionStoreclass loads, not that it is enabled. WithOPENC3_VERSION_HISTORY_DIRunset,VersionStore.commitdoes nothing, butapply_upgrade_versionstill deleted the modified copy. The user's content was gone with no saved version.Changes
PluginModel.modified_diffno longer swallows errors. The controller already returns them as a 500 with a message.ModifiedPluginDialogshows an inline error when the diff fails. It explains that continuing keeps all modified files, which then override the new plugin. The request setsIgnore-Errorsfor 5xx so the global banner, which would include the truncated plugin hash, doesn't also appear.PluginsTabpasses the existingscriptVersionsEnabledflag (from/openc3-api/info) into the dialog asversionHistory. When it is false (Core, or Enterprise withoutOPENC3_VERSION_HISTORY_DIR), an upgrade shows the modified-file list and theDELETE MODIFIEDcheckbox, as it did before Version History, plus a note that kept files override the plugin.version_history_filesis not sent in that case.version_store_available?now also requiresVersionStore.enabled?. When Version History is disabled, the backend ignoresversion_history_filesand leaves modified copies in place, even if the frontend sends that list.Testing
openc3/spec/models/plugin_model_spec.rb: 61 examples, 0 failuresopenc3/spec/models/target_model_spec.rb: 109 examples, 0 failures, including newversion_store_available?cases (enabled, disabled, gem absent)openc3-cosmos-cmd-tlm-api/spec/controllers/plugins_controller_spec.rb: 32 examples, 0 failures, including a new 500 case--max-warnings 0on the changed Vue files, and Prettier on the Playwright spec🤖 Generated with Claude Code