From dbd362fd4dc9f9af3211fdf857670799e8cfb7ef Mon Sep 17 00:00:00 2001 From: poli0981 <127664709+poli0981@users.noreply.github.com> Date: Thu, 13 Aug 2026 17:31:51 +0700 Subject: [PATCH] fix(core): a pin bump should not fail a test about serialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `a_manifest_round_trips_through_its_on_disk_form` asserted `Some("0.16.0")` against a manifest whose tool versions `write_manifest` derives from the real ledger — so bumping the one pin Dependabot exists to bump broke a test that is about neither ruff nor versions. It broke on `main`, not in the PR. Dependabot opened the ruff bump on 2026-08-10 and its CI went green there; the health module landed on 08-12. A merge whose checks predate the code they would have caught is a shape worth naming: green on the PR is a statement about the base it was cut from. Now read out of `pins()`, which is where the number lives. What the test pins is that the tools map survives the round trip — the value it carries is the ledger's business. Co-Authored-By: Claude Opus 5 --- crates/pipdock-core/src/health/mod.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/pipdock-core/src/health/mod.rs b/crates/pipdock-core/src/health/mod.rs index 2d55296..50a171b 100644 --- a/crates/pipdock-core/src/health/mod.rs +++ b/crates/pipdock-core/src/health/mod.rs @@ -1017,7 +1017,18 @@ mod tests { let read = read_manifest(&dir).expect("written manifest is readable"); assert_eq!(read.pins_hash, "abc"); - assert_eq!(read.tools.get("ruff").map(String::as_str), Some("0.16.0")); + // Compared against the ledger rather than a literal. This assertion used to name + // `0.16.0`, which made a Dependabot bump of a pin Dependabot exists to bump fail a test + // about serialization — and it failed on `main`, because that PR's CI predates the health + // module. What is being pinned here is that the tools map survives the round trip, not + // which version is in it. + let pinned = pins() + .expect("ledger parses") + .into_iter() + .find(|p| p.name.to_string() == "ruff") + .map(|p| p.version.to_string()) + .expect("the ledger pins ruff"); + assert_eq!(read.tools.get("ruff"), Some(&pinned)); } /// The camelCase spelling is the shape a future IPC surface would inherit, so pin it now —