Skip to content

Commit d0c3f6e

Browse files
authored
Set default codeowner file path to UNKNOWN (#10502)
Set unknown file paths to UNKNOWN Merge branch 'master' into sarahchen6/fix-codeowners Simplify logic and comment out codeowners for testing Revert codeowners testing Co-authored-by: sarah.chen <sarah.chen@datadoghq.com>
1 parent f1d0f50 commit d0c3f6e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.gitlab/collect_results.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ function get_source_file () {
2626
class="${RESULT_XML_FILE%.xml}"
2727
class="${class##*"TEST-"}"
2828
class="${class##*"."}"
29-
# Extract the inner class name if there's a "$"
30-
if [[ "$class" == *"$"* ]]; then
31-
class="${class##*"$"}"
32-
fi
29+
class="${class##*"$"}" # remove inner class name if it exists
3330
set +e # allow grep to fail
3431
common_root=$(grep -rl "class $class\|static class $class" "$file_path" 2>/dev/null | head -n 1)
3532
set -e
@@ -39,14 +36,19 @@ function get_source_file () {
3936
while [[ $line != "$common_root"* ]]; do
4037
common_root=$(dirname "$common_root")
4138
if [[ "$common_root" == "$common_root/.." ]] || [[ "$common_root" == "/" ]]; then
39+
common_root=""
4240
break
4341
fi
4442
done
4543
done < <(grep -rl "class $class\|static class $class" "$file_path" 2>/dev/null)
4644

47-
if [[ -n "$common_root" ]] && [[ "$common_root" != "/" ]]; then
45+
if [[ -n "$common_root" && "$common_root" != "/" ]]; then
4846
file_path="/$common_root"
47+
else
48+
file_path="UNKNOWN"
4949
fi
50+
else
51+
file_path="UNKNOWN"
5052
fi
5153
fi
5254
}

0 commit comments

Comments
 (0)