New issue
Advanced search Search tips

Issue 895722 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 9
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Mac
Pri: 3
Type: Bug



Sign in to add a comment

"git cl owners" fails with KeyError: 'REVIEWER'

Project Member Reported by alancutter@chromium.org, Oct 16

Issue description

depot_tools version: feec80e97144d81bb6fc7d1c8c9e4cb90019f4bc

Running "git cl owners" seems to die in metrics on Mac.


$ g cl issue
Issue number: 1282762 (https://chromium-review.googlesource.com/1282762)

$ g cl owners
Traceback (most recent call last):
  File "/Users/alancutter/repos/depot_tools/metrics.py", line 225, in print_notice_and_exit
    yield
  File "/Users/alancutter/repos/depot_tools/git_cl.py", line 6125, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/Users/alancutter/repos/depot_tools/git_cl.py", line 6107, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/Users/alancutter/repos/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/Users/alancutter/repos/depot_tools/metrics.py", line 210, in _inner
    return self._collect_metrics(func, command_name, *args, **kwargs)
  File "/Users/alancutter/repos/depot_tools/metrics.py", line 167, in _collect_metrics
    result = func(*args, **kwargs)
  File "/Users/alancutter/repos/depot_tools/git_cl.py", line 5747, in CMDowners
    [] if options.ignore_current else cl.GetReviewers(),
  File "/Users/alancutter/repos/depot_tools/git_cl.py", line 1746, in GetReviewers
    return self._codereview_impl.GetReviewers()
  File "/Users/alancutter/repos/depot_tools/git_cl.py", line 3252, in GetReviewers
    return [reviewer['email'] for reviewer in details['reviewers']['REVIEWER']]
KeyError: 'REVIEWER'

$ gclient metrics --opt-out
You have opted out. Please consider opting in.

$ g cl owners
Traceback (most recent call last):
  File "/Users/alancutter/repos/depot_tools/metrics.py", line 225, in print_notice_and_exit
    yield
  File "/Users/alancutter/repos/depot_tools/git_cl.py", line 6125, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/Users/alancutter/repos/depot_tools/git_cl.py", line 6107, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/Users/alancutter/repos/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/Users/alancutter/repos/depot_tools/git_cl.py", line 5747, in CMDowners
    [] if options.ignore_current else cl.GetReviewers(),
  File "/Users/alancutter/repos/depot_tools/git_cl.py", line 1746, in GetReviewers
    return self._codereview_impl.GetReviewers()
  File "/Users/alancutter/repos/depot_tools/git_cl.py", line 3252, in GetReviewers
    return [reviewer['email'] for reviewer in details['reviewers']['REVIEWER']]
KeyError: 'REVIEWER'

 
Components: -Tools Infra
Components: -Infra Infra>SDK
Status: Available (was: Untriaged)
Labels: OS-Linux
Summary: "git cl owners" fails with KeyError: 'REVIEWER' (was: "git cl owners" fails on Mac)
Uhoh, this is failing on Linux as well.

$ g cl owners
Traceback (most recent call last):
  File "/usr/local/google/home/alancutter/repos/depot_tools/metrics.py", line 225, in print_notice_and_exit
    yield
  File "/usr/local/google/home/alancutter/repos/depot_tools/git_cl.py", line 6127, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/local/google/home/alancutter/repos/depot_tools/git_cl.py", line 6109, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/usr/local/google/home/alancutter/repos/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/usr/local/google/home/alancutter/repos/depot_tools/metrics.py", line 210, in _inner
    return self._collect_metrics(func, command_name, *args, **kwargs)
  File "/usr/local/google/home/alancutter/repos/depot_tools/metrics.py", line 167, in _collect_metrics
    result = func(*args, **kwargs)
  File "/usr/local/google/home/alancutter/repos/depot_tools/git_cl.py", line 5749, in CMDowners
    [] if options.ignore_current else cl.GetReviewers(),
  File "/usr/local/google/home/alancutter/repos/depot_tools/git_cl.py", line 1746, in GetReviewers
    return self._codereview_impl.GetReviewers()
  File "/usr/local/google/home/alancutter/repos/depot_tools/git_cl.py", line 3252, in GetReviewers
    return [reviewer['email'] for reviewer in details['reviewers']['REVIEWER']]
KeyError: 'REVIEWER'
Issue 903913 has been merged into this issue.
Owner: mheikal@chromium.org
Status: Assigned (was: Available)
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/171c07458e2f624b26c3f82d70e51676ffa9a31f

commit 171c07458e2f624b26c3f82d70e51676ffa9a31f
Author: Mohamed Heikal <mheikal@chromium.org>
Date: Fri Nov 09 20:38:51 2018

Fix crash were CL has no reviewers

Currently git cl owners tries to fetch the current reviewers of a CL
from gerrit. However, this fails with a KeyError when there are no
reviewers currently. This cl fixes that bug.

Bug:  895722 
Change-Id: I78a998ee234d207523aa2cef4b5058ba7cfecbc2
Reviewed-on: https://chromium-review.googlesource.com/c/1330122
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>

[modify] https://crrev.com/171c07458e2f624b26c3f82d70e51676ffa9a31f/git_cl.py

Status: Fixed (was: Assigned)
This should be fixed now.
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6523f14f3f35ca88c8c9721b71c9ac5d152d792d

commit 6523f14f3f35ca88c8c9721b71c9ac5d152d792d
Author: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Date: Fri Nov 09 23:00:05 2018

Roll src/third_party/depot_tools e28390cc438f..af0ede1e73a7 (2 commits)

https://chromium.googlesource.com/chromium/tools/depot_tools.git/+log/e28390cc438f..af0ede1e73a7


git log e28390cc438f..af0ede1e73a7 --date=short --no-merges --format='%ad %ae %s'
2018-11-09 recipe-roller@chromium.org Roll recipe dependencies (trivial).
2018-11-09 mheikal@chromium.org Fix crash were CL has no reviewers


Created with:
  gclient setdep -r src/third_party/depot_tools@af0ede1e73a7

The AutoRoll server is located here: https://autoroll.skia.org/r/depot-tools-chromium-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.



BUG= chromium:895722 
TBR=agable@chromium.org

Change-Id: I1f65e12c3257a9fa87331f2e409dc702434e5c96
Reviewed-on: https://chromium-review.googlesource.com/c/1330007
Reviewed-by: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Commit-Queue: chromium-autoroll <chromium-autoroll@skia-public.iam.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#607014}
[modify] https://crrev.com/6523f14f3f35ca88c8c9721b71c9ac5d152d792d/DEPS

Sign in to add a comment