From 2db4e5dbea00b4a46fd6eb1a7d7a599681b5946c Mon Sep 17 00:00:00 2001 From: Brent Westbrook <36778786+ntBre@users.noreply.github.com> Date: Tue, 5 Aug 2025 10:55:17 -0400 Subject: [PATCH] Use fixed hash width for `ty_server` diagnostics (#19766) Summary -- Fixes a snapshot test failure I saw in #19653 locally and in Windows CI by padding the hex ID to 16 digits to match the regex in `filter_result_id`. https://github.com/astral-sh/ruff/blob/78e5fe0a51fcbb1456d54c65b4632f60c268e389/crates/ty_server/tests/e2e/pull_diagnostics.rs#L380-L384 Test Plan -- I applied this to the branch from #19653 locally and saw that the tests now pass. I couldn't reproduce this failure directly on `main` or this branch, though. --- crates/ty_server/src/server/api/diagnostics.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ty_server/src/server/api/diagnostics.rs b/crates/ty_server/src/server/api/diagnostics.rs index d50edaeaf1..4728431732 100644 --- a/crates/ty_server/src/server/api/diagnostics.rs +++ b/crates/ty_server/src/server/api/diagnostics.rs @@ -42,7 +42,7 @@ impl Diagnostics<'_> { // Hash the length first to ensure different numbers of diagnostics produce different hashes diagnostics.hash(&mut hasher); - Some(format!("{:x}", hasher.finish())) + Some(format!("{:016x}", hasher.finish())) } /// Computes the result ID for the diagnostics.