This reverts commit 873c28d175.
Reason for revert: Broken on Windows (crbug.com/762389)
Original change's description:
> Capture ctrl-c in presubmit multiprocessing pool
>
> Presubmit spins up lots of multiprocessing processes to run
> each individual test. If you cancel your presubmit run with
> <ctrl>+c, that signal gets passed through to each of those,
> which then raises its own KeyboardInterrupt, and prints its
> own stacktrace.
>
> This change has each member of the multiprocessing pool instead
> exit gracefully (albeit with an error code) so that only the
> parent process prints its stacktrace.
>
> R=michaelpg@chromium.org
>
> Bug: 635196
> Change-Id: If9081910a359889a43bc1b72c91a859ebe37a1d6
> Reviewed-on: https://chromium-review.googlesource.com/651764
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Aaron Gable <agable@chromium.org>
TBR=iannucci@chromium.org,agable@chromium.org,michaelpg@chromium.org
Change-Id: Ib8e5b2f59b0060dfbfbeba348e211db292318b3b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 635196
Reviewed-on: https://chromium-review.googlesource.com/653434
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
Presubmit spins up lots of multiprocessing processes to run
each individual test. If you cancel your presubmit run with
<ctrl>+c, that signal gets passed through to each of those,
which then raises its own KeyboardInterrupt, and prints its
own stacktrace.
This change has each member of the multiprocessing pool instead
exit gracefully (albeit with an error code) so that only the
parent process prints its stacktrace.
R=michaelpg@chromium.org
Bug: 635196
Change-Id: If9081910a359889a43bc1b72c91a859ebe37a1d6
Reviewed-on: https://chromium-review.googlesource.com/651764
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
I added this when we were moving from gcc to clang on OS X many years
ago. Now that gcc has been deprecated on mac for many years, this
is safe to remove (clang errors on this pattern).
This check took 0.6s during `git cl presubmit` on a recent change of
mine, so it should speed presubmit up a bit.
Bug: none
Change-Id: Ia29b046807582e056115519fb5b34ee8a1b9ff91
Reviewed-on: https://chromium-review.googlesource.com/553238
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
This gives PRESUBMIT equal support for all the
gerrit-style footers that we're migrating to.
R=iannucci@chromium.org, tandrii@chromium.org
Bug: 710327,710803
Change-Id: I64b8f39ef923d90ebda7dd191b83d1a7cc87c776
Reviewed-on: https://chromium-review.googlesource.com/506551
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
We want PRESUBMIT to be able to equally support
BUG= tags (old style) and Git-Footer: footers
(new style). This change refactors the way that
the presubmit api gives access to those properties
so that it is easier to add support for equivalent
footers.
It also limits the scope of tags/footers that it
exposes, as code search shows no PRESUBMIT files
that take advantage of any of the more esoteric
ones.
Bug: 710327, 710803
Change-Id: I86f1d6cb2e1f0aff9653ef3fb455e0a6f47acf5d
Reviewed-on: https://chromium-review.googlesource.com/506450
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
This CL wholly revamps the way presubmit_support adds
CQ_INCLUDE_TRYBOTS lines in commit descriptions. In
particular, when the CL is being uploaded to Gerrit,
it uses our pre-existing support for manipulating git
footers to make the whole process much simpler.
R=tandrii@chromium.org
Bug: 710547
Change-Id: I5858282a44c590f131021fa3820f1cb3f70ef620
Reviewed-on: https://chromium-review.googlesource.com/487831
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
This allows for having some global comments such as timezones or
long-term unavailability.
The comments go into build/OWNERS.status (that way, they should be
available in all repos that map in build/ for the gn config files).
The local can be overwritten in codereview.settings.
The format is
email: status
Comments (starting with #) are allowed in that file, but they're ignored.
BUG=694222
R=dpranke@chromium.org
Change-Id: I49f58be87497d1ccaaa74f0a2f3d373403be44e7
Reviewed-on: https://chromium-review.googlesource.com/459542
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Windows paths use backward slash separator, which
escapes regular expressions for white and black lists
in PRESUBMIT.py filters
See https://goo.gl/6c7aku for discussion
Bug:
Change-Id: Ia1d133c5b6cfa6cb364b1500b7b7abe583bce346
Reviewed-on: https://chromium-review.googlesource.com/461141
Commit-Queue: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
This makes them accessible to presubmit scripts' PostUploadHook.
Fixed bugs where caching needed to be bypassed in order for
sequential PostUploadHooks to see each others' results.
BUG=688765
Change-Id: I56c0c6b6419e2474f4b7f701be036fb2a524f8e3
Reviewed-on: https://chromium-review.googlesource.com/439877
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
The PostUploadHooks in the Chromium repository which add
CQ_INCLUDE_TRYBOTS entries to the issue description will be rewritten
in terms of this primitive, which will compose properly if multiple
sub-directories attempt to modify it.
BUG=688765
Change-Id: Icf72edb872f29af1e082038e96bc547504edfd07
Reviewed-on: https://chromium-review.googlesource.com/438925
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
This reverts commit 66c50ea1f1.
Reason for revert:
Breaks some OWNERS checks. See https://crbug.com/684270 for details.
Original change's description:
> Fix OWNERS canned check to avoid duplicate output.
>
> 1. Update PanProjectChecks() to supply source_filter to CheckOwners().
> This prevents files under e.g. third_party/WebKit being checked both
> by the top-level and sub-directory PRESUBMIT rules.
> 2. Fix CheckOwners() to list missing-OWNERS only for the sub-directory
> it is invoked on, rather than the whole CL. This prevents files under
> sub-directories with their own PRESUBMIT rule, within the same repo,
> from causing OWNERS to be checked for files outside that directory.
>
> BUG=
>
> Reviewed-on: https://chromium-review.googlesource.com/426003
TBR=wez@chromium.org,dcheng@chromium.org
BUG=684270
Change-Id: I094818a6fa3e16fbac0d37d2596a40210611ee05
Reviewed-on: https://chromium-review.googlesource.com/431656
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
On larger CLs, this can be used to see whether all needed LGTMs are
there on a dry run.
R=tandrii@chromium.org
Change-Id: I5fe4022feaca73d08ead9aed14ca270192740675
Reviewed-on: https://chromium-review.googlesource.com/426819
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: smut <smut@chromium.org>
1. Update PanProjectChecks() to supply source_filter to CheckOwners().
This prevents files under e.g. third_party/WebKit being checked both
by the top-level and sub-directory PRESUBMIT rules.
2. Fix CheckOwners() to list missing-OWNERS only for the sub-directory
it is invoked on, rather than the whole CL. This prevents files under
sub-directories with their own PRESUBMIT rule, within the same repo,
from causing OWNERS to be checked for files outside that directory.
BUG=
Change-Id: I9bd5677a69efe9c78b4174a917780d6688991a38
Reviewed-on: https://chromium-review.googlesource.com/426003
Commit-Queue: James Weatherall <wez@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
This is a follow-up to https://chromium-review.googlesource.com/c/419148/;
the purpose is to confirm that the behavior is how we want it to be when
there are presubmit errors and warnings.
BUG=671683
Change-Id: I5b295c200d3db1a374e4294bdd78a777ae36c832
Reviewed-on: https://chromium-review.googlesource.com/420975
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
This affects a bunch of files, but only changes comments,
and shouldn't make any difference to behavior.
The purpose is to slightly improve readability of pylint
disable comments.
Change-Id: Ic6cd0f8de792b31d91c6125f6da2616450b30f11
Reviewed-on: https://chromium-review.googlesource.com/420412
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Rationale: The description of the -f flag to git cl upload is "force
yes to questions (don't prompt)", so when git cl upload -f is run,
I would expect it to abort on errors, but still continue on warnings.
When the -f is given, DoPresubmitChecks is called with may_prompt=False;
this CL would change the behavior of DoPresubmitChecks so that when
may_prompt is False and there are warnings but no errors, then that
means we will print warnings but not fail.
BUG=671683
Change-Id: Ie0f1ac1983d875226db8ad741cbce3dc0bc4eb96
Reviewed-on: https://chromium-review.googlesource.com/419148
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Purpose: This is a unit test method refactoring to try to
improve readability; I made this when adding unit tests for
https://chromium-review.googlesource.com/c/419148/.
In this CL:
- Extract ExampleChange helper method
- Explicitly write names of args for DoPresubmitChecks
- Other minor changes to make the style more consistent
Change-Id: I52236e285e50db890245c6c4b69c70ddf258f140
Reviewed-on: https://chromium-review.googlesource.com/419184
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Note: This CL originally just removed a deprecated use of Remove use of DoGetTrySlaves, suggested in http://crrev.com/2442153002, then was expanded to remove DoGetTrySlaves, GetPreferredTrySlaves and GetTrySlavesExecuter since these are all deprecated and unused.
BUG=660453
Review-Url: https://codereview.chromium.org/2453823002
This allows users to specify additional local presubmit tests that
do not need to exist as locally maintained changes to PRESUBMIT.py
files.
BUG=
Review-Url: https://codereview.chromium.org/2232203002
Since different projects can have different configurations for what
the maximum value of the "Code-Review" label is in Gerrit, this teaches
presubmit_support to inspect the maximum configured value and see who
has granted it (the same behavior as the Submit button in Gerrit itself).
R=andybons@chromium.org, martiniss@chromium.org, tandrii@chromium.org
BUG=630738
Review-Url: https://codereview.chromium.org/2178673002
Also make _RietveldOwnerAndReviewers have same semantics as before,
to resolve immediate bug until chromium checkouts of developers are
updated.
BUG=609832
R=machenbach@chromium.org
Review-Url: https://codereview.chromium.org/1955223002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300494 0039d316-1c4b-4281-b951-d872f2087c98
Reason for revert:
now it doesn't work for gerrit. Damn it.
Original issue's description:
> Implement owners check in presubmit for Gerrit.
>
> R=machenbach@chromium.org,phajdan.jr@chromium.org
> BUG=605563
>
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=300350
TBR=machenbach@chromium.org,phajdan.jr@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=605563
Review-Url: https://codereview.chromium.org/1935563002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300352 0039d316-1c4b-4281-b951-d872f2087c98
It's now passed using command line flags.
This depends on https://codereview.chromium.org/1931633002,
which actually uses this command line flag.
R=sergiyb@chromium.org,phajdan.jr@chromium.org
BUG=601128
Review-Url: https://codereview.chromium.org/1929653002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300268 0039d316-1c4b-4281-b951-d872f2087c98
Also, implement skipping of CheckOwners presumbit canned check. To be used by run_presubmit recipe in build repo in
https://codereview.chromium.org/1931633002
R=sergiyb@chromium.org,phajdan.jr@chromium.org,machenbach@chromium.org
BUG=594127
Review-Url: https://codereview.chromium.org/1923623004
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300262 0039d316-1c4b-4281-b951-d872f2087c98
It's basically like C++'s #include but in JS.
Why write 1 language when you can write 2?!
R=maruel@chromium.org
BUG=540977
Review URL: https://codereview.chromium.org/1394563003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297065 0039d316-1c4b-4281-b951-d872f2087c98
* make RunTest's multiprocessing.Pool in the constructor of InputApi
to avoid getting tripped up by chdir manipulation.
* Don't do the split cyclic-import check when the invoker of the
Pylint presubmit checks explicitly sends cyclic import check
parameters via extra_args
* fix pseudobug where ownership of the files variable was unclear,
and pass all arguments on stdin (instead of mix of CLI + stdin).
* fix bug in pylint which caused it to manipulate sys.path before
spawning its subprocesses, which caused multiprocessing to fail
on windows.
* Note: This may carry a slight semantic change. Before, pylint would
add all .py files' directories to sys.path while checking any of
them. Now in parallel mode, pylint will only add the path of the
single file to sys.path. This behavior actually mirrors Python's
own behavior, so the check should be more-correct than before (and
should cut down on pylint import scanning time with very large
sys.path's).
* If someone encounters an issue with this, please note that the
GetPylint check also includes an extra_paths_list which is
expressly for this purpose.
R=dpranke@chromium.org, kbr@chromium.org, maruel@chromium.org
BUG=501012
Review URL: https://codereview.chromium.org/1208743002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295908 0039d316-1c4b-4281-b951-d872f2087c98