Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve update_owners.py username detection and error message. #35812

Merged
merged 1 commit into from Oct 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions hack/update_owners.py
Expand Up @@ -116,12 +116,12 @@ def get_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')
origin_url = subprocess.check_output(['git', 'config', 'remote.origin.url'])
m = re.search(r'github.com[:/](.*)/', origin_url)
if m and m.group(1) != 'kubernetes':
return m.group(1)
raise ValueError('unable to determine GitHub user from '
'`git config remote.origin.url` output, run with --user instead')


def main():
Expand Down
3 changes: 2 additions & 1 deletion test/list/main.go
Expand Up @@ -237,7 +237,8 @@ func (t *testList) handlePath(path string, info os.FileInfo, err error) error {
return err
}
if strings.Contains(path, "third_party") ||
strings.Contains(path, "staging") {
strings.Contains(path, "staging") ||
strings.Contains(path, "_output") {
return filepath.SkipDir
}
if strings.HasSuffix(path, ".go") && strings.Contains(path, "e2e") ||
Expand Down