Repository navigation
fix(updates): major WordPress releases need Saddle's own setting (#359) - #360
Merged
Merged
Conversation
update-core applied a major release when WordPress's "automatic updates for all new versions" switch was on. WordPress turns that on by default for sites installed since 5.6, so on most sites the owner never chose it, and it decides what WordPress does unattended, not what an app may do after a preview. - New setting "Major WordPress releases" in Saddle → Settings → Updates, off by default. agent: read, and its option is protected, so no tool and no module setter can turn it on. - update-core applies a major only when it is on, whatever WordPress's own switch says. Minor and security releases are unchanged. - The runner checks it again when the run starts: turned off after the confirm, the update is skipped and logged. - Copy: tool description, refusal, context line, readme, CLAUDE.md hard line, ROADMAP. .pot regenerated. Closes #359 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Saddle → Settings is drawn by hand, so a schema field alone never showed: the owner had no switch to flip. It is now the fourth Safety switch, saved on flip through POST /preferences like the other three, with the id the app's refusal links to (#saddle-field-saddle-core_major_updates). The registry field is control: custom so no generic form draws it twice. Set through one setter, Saddle_Offer_Runner::set_core_majors(). Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Closes #359. On Fahim's "fix major release issue what best fit and release 1.5.2".
Why
update-core(#357) applied a major release when WordPress's own "automatic updates for all new versions" switch was on. WordPress turns that switch on for every site installed since 5.6, so on most sites an app could apply a major release the owner never chose to allow. The switch also answers a different question: what WordPress does on its own, unattended. An update through Saddle is attended (preview, then confirm), like the "Update to version" button in Dashboard → Updates, which ignores that switch.What
POST /preferences, owner only), like the other three. Its id is the address an app hands the owner when it is refused (#saddle-field-saddle-core_major_updates). One setter,Saddle_Offer_Runner::set_core_majors(), for the switch and the settings registry (fieldcontrol: custom, so no generic form draws it twice).agent: read(update-module-settings refuses withsaddle_setting_owner_only),update-optiononly writes its allowlist, and the optionsaddle_core_major_updatesis onSaddle_Settings_Guard::PROTECTED_OPTIONS, so a module's setter that touches it is put back.update-coreapplies a major only when it is on, whatever WordPress's own switch says. Minor and security releases are unchanged. When both are offered, the minor still comes first.skipped, core is never asked, and the activity log says why..potregenerated.Visible change
Yes: a fourth Safety switch on Saddle → Settings, "Major WordPress releases", with the line "Apps can update WordPress to a new major version." and a "?" that explains it. Admin bundle rebuilt.
Testing
phpcs0 errors (6 warnings, none new); JS 342/342,lint:jscleanPOST /preferencesturns it on and off; an editor gets 403 and nothing changesagent: read, default false, protected; update-module-settings refuses it/preferences; the preview showed a major with its three risks; the confirmed run updated the site 7.0.7 → 7.1.3 in 79 s and the site stayed up. On a second install the Safety switch showed, saved on a click, and get-module-settings read it as on.auto_update_core_major=enabled), the reason for this change🤖 Generated with Claude Code