Skip to content

Commit afea290

Browse files
Benjamin Denhartogalexeagle
authored andcommitted
fix: prevent dpulicate entries in owners files for global owners
this patch refactors the _GLOBAL_ODEOWNERS variable to a list, additionally refactoring the logic when appending _GLOBAL_OWNERS to the `teams` property of a `codeowners()` rule to ensure that users in _GLOBAL_OWNERS are not duplicated in the generated output.
1 parent a9a2ebe commit afea290

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/defaults.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def npm_package(**kwargs):
4444
**kwargs
4545
)
4646

47-
_GLOBAL_OWNERS = "@alexeagle"
47+
_GLOBAL_OWNERS = [
48+
"@alexeagle",
49+
]
4850

4951
def codeowners(name = "OWNERS", no_parent = False, **kwargs):
5052
"""Convenience macro to set some defaults
@@ -62,7 +64,7 @@ def codeowners(name = "OWNERS", no_parent = False, **kwargs):
6264

6365
# Googlers: see http://go/owners#noparent
6466
if not no_parent:
65-
teams.append(_GLOBAL_OWNERS)
67+
teams += [owner for owner in _GLOBAL_OWNERS if owner not in teams]
6668

6769
_codeowners(
6870
name = name,

0 commit comments

Comments
 (0)