[PR #3892] [MERGED] Telemetry: a user named "user" keeps the <user> label whole #5273

Closed
opened 2026-11-03 05:11:25 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3892
Author: @matyden
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @ludovic111

Base: main ← Head: telemetry/scrub-user-named-user


📝 Commits (1)

  • 230d89f Telemetry: a user named "user" keeps the label whole

📊 Changes

1 file changed (+9 additions, -1 deletions)

View changed files

📝 crates/horizon-telemetry/src/scrub.rs (+9 -1)

📄 Description

🤖 Opened by matyden's AI agent (Claude Code), not by matyden.

What and why

crates/horizon-telemetry/src/scrub.rs first replaces the folder after Users or home in a path with <user> (user_folders), then replaces the machine's user name (USER, USERNAME or LOGNAME) wherever it stands alone (replace_word). When that name is user, a common account name on Windows machines and VMs, the second pass matches the word inside the label the first pass just wrote: /Users/user/horizon becomes /Users/<<user>>/horizon.

The name itself stays hidden, but crash reports from such machines carry a broken label, and horizon-client-render's telemetry::tests::a_crash_keeps_only_what_says_what_happened fails there for an unchanged main. Other contributors hit it too: #578 ("a doubled <user> placeholder in this environment") and #3838 (the one red test, "fails identically on a clean checkout of origin/main").

replace_word now leaves a match between < and > as it is. A new assertion in the_user_name_goes_wherever_it_stands_alone covers a user named user; without the fix it fails with C:\Users\<<user>>\AppData.

Vanilla reference

Horizon-only: telemetry has no vanilla counterpart (docs/telemetry.md).

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on WIN-TU836SRDD9A, against upstream/main at 668419b92, 9 min 17 s)

Check Result
Scope ✅ 1 files, +9 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 423 passed (1 min 7 s)
rustfmt ✅ (13 s)
clippy ❌ failed (51 s)
tests: horizon-telemetry ✅ 41 passed (11 s)
doc tests ✅ 0 passed
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (3 min 22 s)
launcher tests ✅ 268 passed (3 min 26 s)
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The clippy ❌ is not from this change: horizon-client-render's gfx::log_display is never used on Windows, because its only caller, reported, is #[cfg(target_os = "linux")] (8202f02f4). It fails the same way on unchanged upstream/main here; CI's Linux run doesn't see it. cargo clippy -p horizon-telemetry --all-targets -- -D warnings is clean.

Checked before and after on Windows with the user name user, on upstream/main at 668419b92:

  • cargo test -p horizon-client-render --lib telemetry:: fails without this change (/Users/<<user>>/horizon/saves/<private>), and passes with it (6 passed);
  • cargo test -p horizon-telemetry: 34 passed; the new assertion fails without the fix.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3892 **Author:** [@matyden](https://github.com/matyden) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `telemetry/scrub-user-named-user` --- ### 📝 Commits (1) - [`230d89f`](https://github.com/horizon-rust/horizon/commit/230d89f7ecef5c000178db497eff756a44276d00) Telemetry: a user named "user" keeps the <user> label whole ### 📊 Changes **1 file changed** (+9 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-telemetry/src/scrub.rs` (+9 -1) </details> ### 📄 Description > 🤖 Opened by matyden's AI agent (Claude Code), not by matyden. ## What and why `crates/horizon-telemetry/src/scrub.rs` first replaces the folder after `Users` or `home` in a path with `<user>` (`user_folders`), then replaces the machine's user name (`USER`, `USERNAME` or `LOGNAME`) wherever it stands alone (`replace_word`). When that name is `user`, a common account name on Windows machines and VMs, the second pass matches the word inside the label the first pass just wrote: `/Users/user/horizon` becomes `/Users/<<user>>/horizon`. The name itself stays hidden, but crash reports from such machines carry a broken label, and `horizon-client-render`'s `telemetry::tests::a_crash_keeps_only_what_says_what_happened` fails there for an unchanged main. Other contributors hit it too: #578 ("a doubled `<user>` placeholder in this environment") and #3838 (the one red test, "fails identically on a clean checkout of origin/main"). `replace_word` now leaves a match between `<` and `>` as it is. A new assertion in `the_user_name_goes_wherever_it_stands_alone` covers a user named `user`; without the fix it fails with `C:\Users\<<user>>\AppData`. ## Vanilla reference Horizon-only: telemetry has no vanilla counterpart (docs/telemetry.md). ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on WIN-TU836SRDD9A, against upstream/main at 668419b92, 9 min 17 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +9 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 423 passed (1 min 7 s) | | rustfmt | ✅ (13 s) | | clippy | ❌ failed (51 s) | | tests: horizon-telemetry | ✅ 41 passed (11 s) | | doc tests | ✅ 0 passed | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (3 min 22 s) | | launcher tests | ✅ 268 passed (3 min 26 s) | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The clippy ❌ is not from this change: `horizon-client-render`'s `gfx::log_display` is never used on Windows, because its only caller, `reported`, is `#[cfg(target_os = "linux")]` (8202f02f4). It fails the same way on unchanged upstream/main here; CI's Linux run doesn't see it. `cargo clippy -p horizon-telemetry --all-targets -- -D warnings` is clean. Checked before and after on Windows with the user name `user`, on upstream/main at 668419b92: - `cargo test -p horizon-client-render --lib telemetry::` fails without this change (`/Users/<<user>>/horizon/saves/<private>`), and passes with it (6 passed); - `cargo test -p horizon-telemetry`: 34 passed; the new assertion fails without the fix. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:25 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5273
No description provided.