Skip to content

Commit

Permalink
[gitlab] Fix junit upload job when no owners are specified (#11563)
Browse files Browse the repository at this point in the history
Follow-up of #11562.
Makes the junit upload task not fail when no codeowners are assigned, as having no codeowners is a valid codeowners state, according to the codeowners syntax.
  • Loading branch information
KSerrania authored Apr 4, 2022
1 parent 1687f5c commit 416a923
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tasks/libs/junit_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ def split_junitxml(xml_path, codeowners, output_dir):
# don't, so for determining ownership we append "/" temporarily.
owners = codeowners.of(path + "/")
if not owners:
raise KeyError(f"No code owner found for {path}")
main_owner = "none"
else:
main_owner = owners[0][1][len(CODEOWNERS_ORG_PREFIX) :]

main_owner = owners[0][1][len(CODEOWNERS_ORG_PREFIX) :]
try:
xml = output_xmls[main_owner]
except KeyError:
Expand Down

0 comments on commit 416a923

Please sign in to comment.