plugins rollback: switches back on, without saying so, every plugin disabled since the last install #600
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#600
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo at
95348908d, reading the snapshot code and runningset_disabled,removeandroll_backagainst a temporary plugins directory.Related to #246.
Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atplugins/installing.py:553-589(take_snapshot),:609-628(restore_snapshot),:642-659(roll_back),:949-957(set_disabled) and:852-862(remove);plugins/management/commands/plugins.py:123-146has not moved. Reading and writing the record now live inplugins/record.py(write_recordat:162, #248), whichinstallinghands out under the same names.The snapshot is taken only before an install, and it includes the record,
plugins.json.roll_back()puts back the whole directory and the whole record as they were then, so every laterset_disabled()andremove()is undone too. The command compares only versions, so a plugin that was switched off and is now on again is not mentioned at all.plugins/installing.py:727-763(take_snapshot, which copies_copyable(directory), record included),plugins/installing.py:783-802(restore_snapshot),plugins/installing.py:816-833(roll_back),plugins/installing.py:1123-1131(set_disabled) andplugins/installing.py:1026-1036(remove), neither of which touches the snapshot, andplugins/management/commands/plugins.py:123-146(_rollback, which compares{entry.name: entry.version}only).manage.py plugins rollbackto undo X. Y is enabled again in every process, and nothing in the output says so; Z's files and record line return, with only "Put Z 1.0 back." to show for it. Checked: "before rollback [('plug-a', True), ('plug-b', False)]", then "after rollback [('plug-a', False), ('plug-c', False)]": plug-a re-enabled and the removed plug-c restored.disabledflag; or spend the snapshot wheneverset_disabledorremovewrites the record, so a rollback never crosses a later decision. Have the command print changes to the disabled state as well as versions.Done when
tests/test_plugin_rollback.pyhas a test that installs two plugins, disables the first, rolls back the second, and asserts the first is still disabled (or that the rollback is refused), and a command test that the output names any plugin whose disabled state changed.