fix: HistoryServer unit tests failure caused by ID normalization in ConvertBase64ToHex #4769
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 266 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.334
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #4769"
general
weight: 0.35
JiangJiaWei1103
<!-- Thank you for your contribution! -->
<!-- Please add a reviewer to the assignee section when you create a PR. If you don't have the access to it, we will shortly find a reviewer and assign them to your PR. -->
Why are these changes needed?
<!-- Please give a short summary of the change and the problem this solves. -->
Several unit tests in pkg/eventserver were failing because test IDs like "task-1", "actor-1", and "ID_12345" were being silently transformed before storage.
normalizeIDToHex calls ConvertBase64ToHex, which:
1. Returns the value unchanged if it matches ^[0-9a-fA-F]+$ (pure hex)
2. Otherwise, attempts raw URL-safe base64 decoding (base64.RawURLEncoding)
https://github.com/ray-project/kuberay/blob/262d0f458af7fc9e820307fa72371acdd8df704a/historyserver/pkg/utils/utils.go#L103-L119
The fact that these non-pure-hex ids would changed can be verified through
Affected tests:
Test Environment
The test before and after fix has been run on
1. Apple M3 (Arm) + Go 1.25.0
2. Intel Broadwell (x86_64) + Go 1.25.0
Fix
Replace all test IDs with pure hex strings (e.g. "AAaaFFff1234"), which match the ^[0-9a-fA-F]+$ pattern in ConvertBase64ToHex and are returned unchanged. No production code or test logic is modified.
Related issue number
<!-- For example: "Closes #1234" -->
Checks
- [x] Unit tests
- [ ] Manual tests
- [ ] This PR is not tested :(