diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-03 12:10:38 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-03 12:10:38 +0900 |
| commit | dffb6244ebb432477b83631d68584bbc7186dd94 (patch) | |
| tree | 4be972cb21de544c53108a244ba4288f4467d544 /crates/mozart/tests | |
| parent | ed77ff97d6c137ef58f0464b7a9b08bc2b875bd2 (diff) | |
| download | php-mozart-dffb6244ebb432477b83631d68584bbc7186dd94.tar.gz php-mozart-dffb6244ebb432477b83631d68584bbc7186dd94.tar.zst php-mozart-dffb6244ebb432477b83631d68584bbc7186dd94.zip | |
fix(install): treat dev-reference shifts as upgrades
Composer's Transaction fires an UpdateOperation when an installed
package's source/dist reference moved, even if the version string is
unchanged — that is how a `dev-main#abcd` root require pinning a new
commit propagates through `composer install`. Mozart was checking only
(name, version) and short-circuiting to Skip, so the package stayed
pinned to whatever reference installed.json carried.
Compare references in compute_operations and route mismatches into
Action::Update. The trace recorder needs the from-side display string
to include the reference suffix (`dev-master abc123`) so the EXPECT
output matches Composer's UpdateOperation::format; thread that through
PackageOperation::Update as a separate from_full_pretty field while
keeping from_version (sans suffix) for the upgrade-vs-downgrade
direction check, which has to compare normalized versions like
Composer's VersionParser::isUpgrade does.
Unblocks update_reference, update_reference_picks_latest, and
updating_dev_updates_url_and_reference installer fixtures.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/tests')
| -rw-r--r-- | crates/mozart/tests/installer.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/mozart/tests/installer.rs b/crates/mozart/tests/installer.rs index a0eaab0..93c3496 100644 --- a/crates/mozart/tests/installer.rs +++ b/crates/mozart/tests/installer.rs @@ -416,8 +416,8 @@ installer_fixture!(update_package_present_in_lock_but_not_in_remote_due_to_min_s installer_fixture!(update_package_present_in_lower_repo_prio_but_not_main_due_to_min_stability); installer_fixture!(update_picks_up_change_of_vcs_type, ignore); installer_fixture!(update_prefer_lowest_stable); -installer_fixture!(update_reference, ignore); -installer_fixture!(update_reference_picks_latest, ignore); +installer_fixture!(update_reference); +installer_fixture!(update_reference_picks_latest); installer_fixture!(update_removes_unused_locked_dep, ignore); installer_fixture!(update_requiring_decision_reverts_and_learning_positive_literals); installer_fixture!(update_security_advisory_matching_direct_dependency, ignore); @@ -431,4 +431,4 @@ installer_fixture!(update_to_empty_from_locked, ignore); installer_fixture!(update_with_all_dependencies); installer_fixture!(update_without_lock); installer_fixture!(updating_dev_from_lock_removes_old_deps, ignore); -installer_fixture!(updating_dev_updates_url_and_reference, ignore); +installer_fixture!(updating_dev_updates_url_and_reference); |
