From dffb6244ebb432477b83631d68584bbc7186dd94 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 3 May 2026 12:10:38 +0900 Subject: fix(install): treat dev-reference shifts as upgrades MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- crates/mozart/tests/installer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/mozart/tests') 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); -- cgit v1.3.1