Repository navigation
fix(packages): restore a branch at its commit, and keep paths out of manager_language (3.6) - #2559
Conversation
The lock kept only "dev-main", so a restore resolved the branch wherever it stood by then, and treating a commit on one side as equal let that pass without consent. The commit now travels with the pin (dev-main#<commit>), through the lock and the record, and a branch whose commit is not known on both sides counts as a change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user editor stores any value and the settings merge took it as it was. The manager theme normalises it, but a manager on the front end kept it, and it reached include in the error handler, the updater and extras plugins and the store. Only a locale name now gets into the configuration, which also covers packages that read the setting, and those includes ask for one too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@elcreator Please fix the path-repository regression before merging this and #2558. Unchanged dev path packages are classified as changed. This is a static finding against Conditions: a custom package (or its private dependency) has a dev version, no
After a release replaces the lock and the package needs restoring, Requested correction: preserve the reference used for comparison through both the live-lock and saved-record paths, including private dependencies, separately from the constraint passed to Composer. A path Please add regressions on both branches using Composer-formatted output (ideally generated by
The current SokilAI |
Composer prints the dist reference of a dev package that has no source, so an unchanged path package read as a change and needed consent on every update. Keep that reference in the pin and the record to compare, and drop it before anything reaches Composer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Seiger Confirmed and fixed in 38794e3, thanks. Composer falls back to
|
Problem
1. A package on a branch could move without consent. This is the regression reported on #2551 and #2552.
lockPackages()keeps onlyversion, so a site ondev-mainat commit A was pinned as plaindev-main. After a release replaced the lock, Composer resolved the branch wherever it stood by then, andunexpectedChanges()accepted that because a commit on one side only counted as equal.plan()returnedokwith consent off.Reproduced on both branches with real Composer 2.10.2, a real lock and a real record, before changing anything.
2.
manager_languagecould hold a path. The user editor stores any value, andgetUserSettings()merged it as it was.ManagerThemenormalises the setting in the manager only, so a manager on the front end kept the stored value. Several includes read it without askingManagerLanguage::isName(): the error handler, the updater and extras plugins, the store and its installer, and the old web user form. Packages that build a path from the setting read it the same way. Writing the value takes a permission to edit users, and each include has a fixed suffix.Change
Packages
lockPackages()keeps the commit of a git or hg branch. The pin becomesdev-main#<commit>, throughpreviousVersions()and the record file.dev-main <reference>. That is a path repository with its defaultreference: auto, orconfig, and it covers private dependencies. This reference is only compared:composerVersion()drops it beforeupdateArguments()and the command the installer prints, so it never becomes#<reference>.updateArguments()needs no change: Composer accepts that form, so the restore comes back at the commit the site ran. An older Composer that ignores the commit resolves the branch and is refused like any other change.reference: nonehas no reference on either side and passes as before.AGENTS.mdrecords the rule.Language
Core::getSettings()andgetUserSettings()let only a locale name into the configuration, which also covers packages. A bad per-user value leaves the system language in place; a bad system value reads as English. A deleted locale still passes, asManagerLanguagedocuments.ManagerLanguage::isName()themselves, because the error handler can run before the settings are loaded.Behaviour to expect
make:sitereads the live lock first and is not affected.Tests
New regression test from the review: a real lock at A, replaced by a release, restored at B without consent is refused, read from the lock and from the record. The same commit passes.
ManagerLanguageSettingTestcovers the settings merge and each include;StoreLanguageTestcovers a path as the store language.All 21 new cases failed on unfixed 3.6.x. On 3.5.x the unfixed behaviour was shown by the Composer reproduction above, not by running these tests.
Added for the path-repository review, with dry runs written by Composer's own
InstallOperation::format(): an unchanged path package and its private dependency restore without consent from the lock and from the record, on two updates in a row; a changed reference needs consent on either package;reference: nonepasses; the reference stays out of the arguments and the printed command. The 8 cases of the service failed on the previous head on both branches, and the printed-command case failed on 3.6.x without its line.Real Composer with the fix, on both branches, branch moved to B: the update exits 0, the lock holds A, B's file is not in
vendor, and the record keeps A.Real Composer 2.11.1 with real path repositories (merge plugin,
reference: auto), on both branches. The previous head refuses an unchanged package withdev-main => dev-main 5c2465e. With the fix it restores from the lock and the record, through a real restore and a second update. A changed private dependency is refused, andreference: nonepasses. The stagedmake:sitedry run was not driven.Full suite on Linux: 3.5.x 2346 passed, 3.6.x 2532 passed, 9 skipped on each. PHPStan reports no errors.
On a real site, 3.5.x and 3.6.x, each branch installed in phramark's
evo-lattestack: guest and admin pass. With a path stored asmanager_languagefor the site's user, the manager's login, edit, save and logout pass with no fatals, and the front end and manager answer 200. The stored value stays in the table and is ignored.The manager's language page itself was not driven in a browser.
🤖 Generated with Claude Code