Merge pull request #35812 from rmmh/owner-better

Automatic merge from submit-queue

Improve update_owners.py username detection and error message.

Fixes the root cause of #35808.
This commit is contained in:
Kubernetes Submit Queue 2016-10-28 14:44:38 -07:00 committed by GitHub
commit bbe36f9186
2 changed files with 8 additions and 7 deletions

View File

@ -116,12 +116,12 @@ def get_maintainers():
def detect_github_username(): def detect_github_username():
remotes = subprocess.check_output(['git', 'remote', '-v']) origin_url = subprocess.check_output(['git', 'config', 'remote.origin.url'])
repos = set(re.findall(r'\w+(?=/kubernetes)', remotes)) m = re.search(r'github.com[:/](.*)/', origin_url)
repos.remove('kubernetes') if m and m.group(1) != 'kubernetes':
if len(repos) == 1: return m.group(1)
return repos.pop() raise ValueError('unable to determine GitHub user from '
raise ValueError('unable to guess GitHub user from `git remote -v` output, use --user instead') '`git config remote.origin.url` output, run with --user instead')
def main(): def main():

View File

@ -237,7 +237,8 @@ func (t *testList) handlePath(path string, info os.FileInfo, err error) error {
return err return err
} }
if strings.Contains(path, "third_party") || if strings.Contains(path, "third_party") ||
strings.Contains(path, "staging") { strings.Contains(path, "staging") ||
strings.Contains(path, "_output") {
return filepath.SkipDir return filepath.SkipDir
} }
if strings.HasSuffix(path, ".go") && strings.Contains(path, "e2e") || if strings.HasSuffix(path, ".go") && strings.Contains(path, "e2e") ||