New issue
Advanced search Search tips

Issue 890109 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

gerrit search sometimes fails due to KeyError: 'currentPatchSet'

Project Member Reported by akes...@chromium.org, Sep 28

Issue description

I haven't traced down precisely which CL is causing this, but it happens consistently for a redacted query.

Probably need to add some simple hardening around this key lookup

gerrit: Unhandled exception:
Traceback (most recent call last):
  File "./gerrit", line 169, in <module>
    DoMain()
  File "./gerrit", line 165, in DoMain
    commandline.ScriptWrapperMain(FindTarget)
  File "/usr/local/google/home/akeshet/chromiumos/chromite/lib/commandline.py", line 912, in ScriptWrapperMain
    ret = target(argv[1:])
  File "/usr/local/google/home/akeshet/chromiumos/chromite/scripts/gerrit.py", line 607, in main
    functor(opts, *opts.args)
  File "/usr/local/google/home/akeshet/chromiumos/chromite/scripts/gerrit.py", line 262, in UserActSearch
    PrintCls(opts, cls)
  File "/usr/local/google/home/akeshet/chromiumos/chromite/scripts/gerrit.py", line 178, in PrintCls
    PrettyPrintCl(opts, cl, lims=lims, show_approvals=show_approvals)
  File "/usr/local/google/home/akeshet/chromiumos/chromite/scripts/gerrit.py", line 136, in PrettyPrintCl
    approvs = GetApprovalSummary(opts, cl)
  File "/usr/local/google/home/akeshet/chromiumos/chromite/scripts/gerrit.py", line 109, in GetApprovalSummary
    if 'approvals' in cls['currentPatchSet']:
 
Labels: -Restrict-View-Google
Owner: akes...@chromium.org
Status: Started (was: Untriaged)
Aviv already sent a CL to fix it :)
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/ad30cec2921a6c78831c1b7655bb043a52e91bf1

commit ad30cec2921a6c78831c1b7655bb043a52e91bf1
Author: Aviv Keshet <akeshet@chromium.org>
Date: Tue Oct 02 12:19:45 2018

gerrit: add a key existence check for gerrit search queries

BUG= chromium:890109 
TEST=manually tested with previously failing query

Change-Id: Ibeb793f8d51eba214661f5b43711e42fd38c75d4
Reviewed-on: https://chromium-review.googlesource.com/1249668
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/ad30cec2921a6c78831c1b7655bb043a52e91bf1/scripts/gerrit.py

Status: Fixed (was: Started)

Sign in to add a comment