New issue
Advanced search Search tips

Issue 740601 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

PostUploadHook crashes when using CQ_INCLUDE_TRYBOTS= syntax

Reported by jwo...@igalia.com, Jul 10 2017

Issue description

If you add a footer like R=reviewer@chromium.org to your Gerrit CL, then `git cl upload` can crash after uploading your patch. The R= syntax causes the expected behavior of adding the reviewer(s) to the CL as expected, so I don't think this is my fault for confusing the tools.

Here's a CL where I use that syntax:

https://chromium-review.googlesource.com/c/546941/3

And here's the output from `git cl upload` that shows the stacktrace:

v8$ git cl upload
Running presubmit upload checks ...
Done processing /home/jwolfe/v8/v8/test/cctest/test-compiler.cc
Done processing /home/jwolfe/v8/v8/src/flag-definitions.h
Total errors found: 0
Total violating files: 0

Presubmit checks took 3.1s to calculate.

Presubmit checks passed.
 src/flag-definitions.h                         |  8 ++++----
 test/cctest/test-compiler.cc                   |  4 ++--
 test/message/paren_in_arg_string.out           |  8 ++++----
 test/mjsunit/harmony/async-generators-basic.js |  6 +++---
 test/mjsunit/regress/regress-2470.js           |  2 +-
 test/mjsunit/regress/regress-crbug-109362.js   | 11 ++++++-----
 test/mjsunit/regress/regress-crbug-663410.js   |  2 +-
 test/test262/test262.status                    |  3 ---
 8 files changed, 21 insertions(+), 23 deletions(-)
Title for patchset [Enable --harmony-function-tostring by default]: rebase
remote: Processing changes: updated: 1, done            
remote: 
remote: Updated Changes:        
remote:   https://chromium-review.googlesource.com/546941 Enable --harmony-function-tostring by default        
remote: 
To https://chromium.googlesource.com/v8/v8.git
 * [new branch]      dbc72d2de9e152e3f88597e9d214ee73392043e5 -> refs/for/refs/heads/master%notify=NONE,m=rebase
Traceback (most recent call last):
  File "/home/jwolfe/depot_tools/git_cl.py", line 6055, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/jwolfe/depot_tools/git_cl.py", line 6037, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/home/jwolfe/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/home/jwolfe/depot_tools/git_cl.py", line 4904, in CMDupload
    return cl.CMDUpload(options, args, orig_args)
  File "/home/jwolfe/depot_tools/git_cl.py", line 1673, in CMDUpload
    sys.stdout)
  File "/home/jwolfe/depot_tools/presubmit_support.py", line 1194, in DoPostUploadExecuter
    presubmit_script, filename, cl, change))
  File "/home/jwolfe/depot_tools/presubmit_support.py", line 1097, in ExecPresubmitScript
    return post_upload_hook(cl, change, OutputApi(False))
  File "<string>", line 371, in PostUploadHook
  File "/home/jwolfe/depot_tools/presubmit_support.py", line 309, in EnsureCQIncludeTrybotsAreAdded
    description, 'Cq-Include-Trybots')
  File "/home/jwolfe/depot_tools/git_footers.py", line 150, in remove_footer
    l for l in footer_lines if normalize_name(parse_footer(l)[0]) != key]
TypeError: 'NoneType' object has no attribute '__getitem__'

 
Cc: aga...@chromium.org
Components: -Infra Infra>Codereview>Gerrit

Comment 2 by aga...@chromium.org, Jul 10 2017

Cc: -aga...@chromium.org
Owner: aga...@chromium.org
Status: Assigned (was: Untriaged)
Summary: PostUploadHook crashes when using CQ_INCLUDE_TRYBOTS= syntax (was: remove_footer crashes when using R= syntax)
Ah, it's not the R=, it's the CQ_INCLUDE_TRYBOTS=, and it's running into some failure in a post-upload hook, so the change gets uploaded just fine but then something fails locally afterwards.

Post-upload hooks don't serve any purpose and I think they're silly, but I don't think I can get rid of them right now. I'll see if I can figure out what exactly this one is doing.

Comment 3 by aga...@chromium.org, Jul 10 2017

Status: Started (was: Assigned)
https://chromium-review.googlesource.com/565779

Comment 4 by aga...@chromium.org, Jul 10 2017

Labels: Milestone-Afterglow Proj-Gerrit-Migration

Comment 5 by dpa...@chromium.org, Jul 11 2017

Cc: dbeam@chromium.org
Labels: -Pri-3 Pri-2
FYI I am also noticing that when uploading CLs to gerrit the following line
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

which is added automatically at [1], is not showing up (this used to work in rietveld).

[1] https://cs.chromium.org/chromium/src/ui/webui/resources/PRESUBMIT.py?type=cs&l=9

Comment 6 by dbeam@chromium.org, Jul 11 2017

hey agable@: post upload hooks are often used (in my experience, at least) for adding optional try bots to specific paths in src/.  Doing a quick search for EnsureCQIncludeTrybotsAreAdded yields a bunch of these:
https://cs.chromium.org/search/?q=EnsureCQIncludeTrybotsAreAdded&type=cs

I do think it's silly that it's done post-upload (as opposed to just pushing the right CL description the first time...).

dpapad@: in gerrit the try bots should be added to something called "git footers" and it may not look exactly the same (i.e. it may be in the commit message maybe?  and as Cq-Include-Trybots: instead of CQ_INCLUDE_TRYBOTS=)
https://cs.chromium.org/chromium/tools/depot_tools/presubmit_support.py?type=cs&l=294-297,308-312

Comment 7 by aga...@chromium.org, Jul 11 2017

Yeah, I'm aware of what they do. I object to that being a good purpose, and even if it is a good one, I object to the use of post-upload hooks to achieve that purpose :) We're definitely in agreement on this one.

Anyway, I'm just waiting on review for that change; it should resolve this problem.

Comment 8 by mcasas@chromium.org, Jul 11 2017

I noticed the same issue as #5 for CLs in which optional_gpu_tests_rel were not 
added as a CQ_INCLUDE_TRYBOTS footer.  dpranke@ had an opinion on those here: 
https://bugs.chromium.org/p/chromium/issues/detail?id=688765#c2, but for the
time being I'm afraid we rely on them in a few places.
Project Member

Comment 9 by bugdroid1@chromium.org, Jul 12 2017

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

commit b08ba6575e8ec7dd024533e03415cdccd76ed983
Author: Aaron Gable <agable@chromium.org>
Date: Wed Jul 12 23:19:15 2017

git_footer: be more resilient to malformed footers

Since split_footers became more resilient to malformed
footers and started returning the entire last paragraph,
instead of just the last paragraph iff it was entirely
well-formed, other functions like remove_footer need to
make sure they handle the case where not every line of
the footer paragraph can be parsed.

R=iannucci@chromium.org

Bug:  740601 
Change-Id: I75c6c626d96942181f453abeee896ee92d14b20b
Reviewed-on: https://chromium-review.googlesource.com/565779
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>

[modify] https://crrev.com/b08ba6575e8ec7dd024533e03415cdccd76ed983/git_footers.py

Status: Fixed (was: Started)
This should be fixed now.

Comment 11 by jwo...@igalia.com, Aug 3 2017

It works for me now. Thanks, Aaron!

Sign in to add a comment