Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
37b3a846
Commit
37b3a846
authored
Oct 27, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Oct 27, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #35743 from rmmh/owner-self
Automatic merge from submit-queue Make update_owners.py assign new tests to self by default.
parents
52988de1
df04f33a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
update_owners.py
hack/update_owners.py
+20
-7
No files found.
hack/update_owners.py
View file @
37b3a846
...
...
@@ -115,10 +115,19 @@ def get_maintainers():
return
sorted
(
ret
-
SKIP_MAINTAINERS
)
def
detect_github_username
():
remotes
=
subprocess
.
check_output
([
'git'
,
'remote'
,
'-v'
])
repos
=
set
(
re
.
findall
(
r'\w+(?=/kubernetes)'
,
remotes
))
repos
.
remove
(
'kubernetes'
)
if
len
(
repos
)
==
1
:
return
repos
.
pop
()
raise
ValueError
(
'unable to guess GitHub user from `git remote -v` output, use --user instead'
)
def
main
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
'--history'
,
action
=
'store_true'
,
help
=
'Generate test list from result history.'
)
parser
.
add_argument
(
'--user'
,
help
=
'User to assign new tests to (
default: random
).'
)
parser
.
add_argument
(
'--user'
,
help
=
'User to assign new tests to (
or RANDOM, default: current GitHub user
).'
)
parser
.
add_argument
(
'--check'
,
action
=
'store_true'
,
help
=
'Exit with a nonzero status if the test list has changed.'
)
options
=
parser
.
parse_args
()
...
...
@@ -148,6 +157,9 @@ def main():
sys
.
exit
(
1
)
sys
.
exit
(
0
)
if
not
options
.
user
:
options
.
user
=
detect_github_username
()
for
name
in
outdated_tests
:
owners
.
pop
(
name
)
...
...
@@ -164,17 +176,18 @@ def main():
if
owner
in
maintainers
)
for
test_name
in
set
(
test_names
)
-
set
(
owners
):
random_assignment
=
True
if
options
.
user
:
if
options
.
user
.
lower
()
==
'random'
:
new_owner
,
_count
=
random
.
choice
(
owner_counts
.
most_common
()[
-
4
:])
else
:
new_owner
=
options
.
user
random_assignment
=
False
else
:
new_owner
,
_count
=
random
.
choice
(
owner_counts
.
most_common
()[
-
4
:])
owner_counts
[
new_owner
]
+=
1
owners
[
test_name
]
=
(
new_owner
,
random_assignment
)
print
'# Tests per maintainer:'
for
owner
,
count
in
owner_counts
.
most_common
():
print
'
%-20
s
%3
d'
%
(
owner
,
count
)
if
options
.
user
.
lower
()
==
'random'
:
print
'# Tests per maintainer:'
for
owner
,
count
in
owner_counts
.
most_common
():
print
'
%-20
s
%3
d'
%
(
owner
,
count
)
write_owners
(
OWNERS_PATH
,
owners
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment