New issue
Advanced search Search tips

Issue 689652 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug

Blocking:
issue 697625



Sign in to add a comment

`git cl upload` on an abandoned gerrit change gives cryptic error message

Project Member Reported by martiniss@chromium.org, Feb 7 2017

Issue description

I was trying to upload to https://chromium-review.googlesource.com/c/437821/ while the change was abandoned, and I got this error message:

g cl upload --gerrit                                                                                                                                                                                                    
Using 50% similarity for rename/copy detection. Override with --similarity.
Running presubmit upload checks ...
Traceback (most recent call last):
  File "/usr/local/google/home/martiniss/dt/git_cl.py", line 5282, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/local/google/home/martiniss/dt/git_cl.py", line 5264, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/usr/local/google/home/martiniss/dt/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/usr/local/google/home/martiniss/dt/git_cl.py", line 4266, in CMDupload
    return cl.CMDUpload(options, args, orig_args)
  File "/usr/local/google/home/martiniss/dt/git_cl.py", line 1529, in CMDUpload
    change=change)
  File "/usr/local/google/home/martiniss/dt/git_cl.py", line 1473, in RunHook
    gerrit_obj=self._codereview_impl.GetGerritObjForPresubmit())
  File "/usr/local/google/home/martiniss/dt/presubmit_support.py", line 1242, in DoPresubmitChecks
    results += executer.ExecPresubmitScript(presubmit_script, filename)
  File "/usr/local/google/home/martiniss/dt/presubmit_support.py", line 1152, in ExecPresubmitScript
    result = eval(function_name + '(*__args)', context)
  File "<string>", line 1, in <module>
  File "<string>", line 122, in CheckChangeOnUpload
  File "<string>", line 48, in CommonChecks
  File "/usr/local/google/home/martiniss/dt/presubmit_canned_checks.py", line 882, in CheckOwners
    approval_needed=input_api.is_committing)
  File "/usr/local/google/home/martiniss/dt/presubmit_canned_checks.py", line 918, in GetCodereviewOwnerAndReviewers
    return func(input_api, email_regexp, approval_needed)
  File "/usr/local/google/home/martiniss/dt/presubmit_canned_checks.py", line 981, in _GerritOwnerAndReviewers
    r for r in input_api.gerrit.GetChangeReviewers(issue, approval_needed)
  File "/usr/local/google/home/martiniss/dt/presubmit_support.py", line 249, in GetChangeReviewers
    cr = self.GetChangeInfo(issue)['labels']['Code-Review']
KeyError: 'Code-Review'

 
Components: -Infra>Git Infra>Codereview>Gerrit Infra>SDK
Labels: Milestone-Launch Proj-Gerrit-Migration
Owner: tandrii@chromium.org
Status: Assigned (was: Untriaged)
Thansk for report.
Status: Started (was: Assigned)
Argh, weirdness of Gerrit: 

# Abandon issue:
>>> g.get_issue(442465, options=['DETAILED_LABELS'])[0]['labels'].keys()
[u'Commit-Queue']
>>> d, e = g.get_issue(442465, options=['DETAILED_LABELS'])
>>> d['status'], d['labels'].keys()
(u'ABANDONED', [u'Commit-Queue'])


# Restore issue:
>>> d, e = g.get_issue(442465, options=['DETAILED_LABELS'])
>>> d['status'], d['labels'].keys()
(u'NEW', [u'Commit-Queue', u'Code-Review'])

WTF? Filed: b/35381563
That said, git cl upload should bail much earlier if issue is abandoned.
Project Member

Comment 6 by bugdroid1@chromium.org, Feb 17 2017

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

commit 3e631421d257eec7478186fb92fae167be7e95f0
Author: Andrii Shyshkalov <tandrii@chromium.org>
Date: Fri Feb 17 14:24:46 2017

Gerrit git cl upload: abort early if change is submitted or abandoned.

BUG= 689652 
R=agable@chromium.org,martiniss@chromium.org

Change-Id: Ib9f5b08f5b31a1519a5f5916042885967a263d88
Reviewed-on: https://chromium-review.googlesource.com/443325
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>

[modify] https://crrev.com/3e631421d257eec7478186fb92fae167be7e95f0/tests/git_cl_test.py
[modify] https://crrev.com/3e631421d257eec7478186fb92fae167be7e95f0/git_cl.py

Status: ExternalDependency (was: Started)
This is blocked on internal Gerrit bug investigating weird dependent CLs submit issue (see https://b/35377658#comment10)
Blocking: 697625
Status: Started (was: ExternalDependency)
No longer blocked on external bug. Now blocked on landing https://chromium-review.googlesource.com/c/443545 
Project Member

Comment 10 by bugdroid1@chromium.org, Mar 8 2017

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

commit 0293956dabf2336f766645a00eb42f5bc3694473
Author: Andrii Shyshkalov <tandrii@chromium.org>
Date: Wed Mar 08 16:02:59 2017

git cl tests: refactor gerrit base calls for readability.

R=agable@chromium.org
BUG= 689652 

Change-Id: I3074eeef2b939d64bcd2e537bbc7ee288241bd79
Reviewed-on: https://chromium-review.googlesource.com/443108
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>

[modify] https://crrev.com/0293956dabf2336f766645a00eb42f5bc3694473/tests/git_cl_test.py

Project Member

Comment 11 by bugdroid1@chromium.org, Mar 10 2017

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

commit 5c3d0b374d5e296a07cbfcd8dc2eb14873b85570
Author: Andrii Shyshkalov <tandrii@chromium.org>
Date: Fri Mar 10 14:02:26 2017

Gerrit git cl upload: add test for early abort.

BUG= 689652 
R=agable@google.com

Change-Id: Ia0ca4dbacb0131658bbb41fc741f45b5e7f2cba9
Reviewed-on: https://chromium-review.googlesource.com/443545
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>

[modify] https://crrev.com/5c3d0b374d5e296a07cbfcd8dc2eb14873b85570/tests/git_cl_test.py

Status: Fixed (was: Started)
 Issue 652722  has been merged into this issue.

Sign in to add a comment