Skip to content
Success

Changes

Summary

  1. fix: prioritize exact suite matches over parent suite matches (#4008) (commit: 2196747) (details)
Commit 2196747ee59d0a69adab1fd3e6a2331afaf6ddaa by noreply
fix: prioritize exact suite matches over parent suite matches (#4008)

### Summary

I successfully fixed the issue where the flaky owner for the
`pkg/executor/importer` package was incorrectly reported as
`sunruoxi@pingcap.com` instead of `bear.c@pingcap.com`.

### Root Cause
The problem was in the `OwnerResolver.resolveViaMap` method in
`/tools/reporters/ci/flaky-tests/core/OwnerResolver.ts`. The logic
didn't properly distinguish between exact suite matches and parent suite
prefix matches when assigning the resolution level. Both types of
matches were assigned the same level ("suite"), causing the first
encountered match to win when priorities were equal.

### Changes Made

1. **Updated `types.ts`**: Added a new `OwnerResolutionLevel` value
`"parent-suite"` to distinguish between exact suite matches and parent
suite prefix matches.

2. **Updated `OwnerResolver.ts`**:
- Modified the level assignment logic to use `"suite"` for exact matches
and `"parent-suite"` for prefix matches
- Updated the level ranking to give exact suite matches (level 3) higher
precedence than parent suite matches (level 2)

3. **Updated `OwnerResolver.test.ts`**:
   - Fixed the import statement for `assertEquals`
- Updated the test case type to include the new `"parent-suite"` level
- Updated the existing parent suite test case to expect `"parent-suite"`
level instead of `"suite"`
- Added a new test case specifically for the exact vs parent suite
precedence issue
(commit: 2196747)
The file was modifiedtools/reporters/ci/flaky-tests/core/OwnerResolver.ts (diff)
The file was modifiedtools/reporters/ci/flaky-tests/core/types.ts (diff)
The file was modifiedtools/reporters/ci/flaky-tests/core/OwnerResolver.test.ts (diff)