fix(membership): support truncated UUIDs in tasklist exclusion#7768
fix(membership): support truncated UUIDs in tasklist exclusion#7768jakobht wants to merge 2 commits intocadence-workflow:masterfrom
Conversation
…ng to catch those Signed-off-by: Jakob Haahr Taankvist <jht@uber.com>
|
Please add a reference to the related GitHub issue in the PR description. You can use any of the following formats:
|
| { | ||
| name: "task list with short UUID (end segment is 11 characters)", | ||
| taskListName: "tasklist-550e8400-e29b-41d4-a716-4466554400a", | ||
| want: true, | ||
| }, | ||
| { | ||
| name: "task list with short UUID (end segment is 10 characters)", | ||
| taskListName: "tasklist-550e8400-e29b-41d4-a716-4466554400suffix", | ||
| want: true, | ||
| }, |
There was a problem hiding this comment.
🚨 Bug: New truncated-UUID tests don't actually test the regex
The two new test cases for short UUIDs (lines 24-33) omit both excludeShortLivedTaskLists (defaults to false) and percentageOnboarded (defaults to 0). With these defaults:
excludeShortLivedTaskLists = false && uuidRegexp.MatchString(...)→ alwaysfalse(short-circuited), so the UUID regex is never evaluated.!belowPercentage(name, 0)→!(hash%100 < 0)→ alwaystrue(uint64 is never < 0).
So want: true passes trivially for any task list name, regardless of whether the regex matches. These tests provide no coverage for the regex change.
You can verify by changing want to false or using a non-UUID name — they'll still pass with want: true.
Suggested fix:
Set the flags to actually exercise the UUID path:
{
name: "task list with short UUID (end segment is 11 characters)",
taskListName: "tasklist-550e8400-e29b-41d4-a716-4466554400a",
want: true,
percentageOnboarded: 100,
excludeShortLivedTaskLists: true,
},
Was this helpful? React with 👍 / 👎 | Reply gitar fix to apply this suggestion
🔍 CI failure analysis for 33de09b: Build failure due to duplicate field names in test struct literal in tasklist_differentiator_test.go; the new test cases added for truncated and uppercase UUIDs were not properly closed, causing compilation errors across all test jobs.OverviewAll 3 CI jobs failed with the same root cause: a Go compilation error in FailuresDuplicate Struct Fields in Test Case (confidence: high)
Summary
Code Review 🚫 Blocked 0 resolved / 2 findingsAdds truncated UUID support to tasklist exclusion but is blocked by two critical issues: duplicate struct fields causing a compile error in test case definitions, and new truncated-UUID tests that don't actually exercise the regex due to missing required test configuration parameters. 🚨 Bug: Duplicate struct fields cause compile error in test📄 common/membership/tasklist_differentiator_test.go:34-43 The "task list with uppercase UUID" test case (line 34) is missing its closing This means the tests cannot run, so none of the new behavior is verified. Suggested fix🚨 Bug: New truncated-UUID tests don't actually test the regex📄 common/membership/tasklist_differentiator_test.go:24-33 The two new test cases for short UUIDs (lines 24-33) omit both
So You can verify by changing Suggested fix🤖 Prompt for agentsRules
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
What changed?
Updated the UUID regex in tasklist differentiator to accept 10-12 hex characters in the final segment instead of exactly 12.
Why?
Short-lived tasklists are being created with truncated UUIDs (10 or 11 hex characters in the last segment). These were not being matched by the existing strict UUID pattern, causing them to bypass the shard distributor exclusion logic.
How did you test it?
go test -v ./common/membership/... -run TestTaskListExcludedFromShardDistributorPotential risks
Low - the regex change is minimal and backwards compatible. Existing full UUIDs continue to match, while also matching slightly truncated variants.
Release notes
N/A
Documentation Changes
N/A