Commit Graph

194 Commits (ba1ed450433675b55e6c5ce72784e71b59737fb9)

Author SHA1 Message Date
Aaron Gable b584c4f0d1 Make CQ_INCLUDE_TRYBOTS support review-specific
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>
8 years ago
Kenneth Russell df6e7348b9 Fix addition of CQ_INCLUDE_TRYBOTS on Gerrit.
BUG=710547

Change-Id: I6558ba08683b8e010ac5051dabfd82d9a5b9c551
Reviewed-on: https://chromium-review.googlesource.com/486083
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
8 years ago
Aaron Gable 6f5a8d9987 Flip gerrit_util to raise exceptions on 404 by default
This makes the library behave more like what we'd expect,
while still allowing certain function to specify that
returning 204 or 404 is expected/acceptable behavior.

Change-Id: If3ce5598d1603819ee97aaeab0072a9e786ed96d
Reviewed-on: https://chromium-review.googlesource.com/481043
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable 19ee16c860 Reland "Refactor ReadHttpResponse to be error-friendlier"
Gerrit sometimes returns a full response json object at
the same time as returning a non-200 status code. This
refactor makes it easier for calling code to request
access to that object and handle error cases on its own.

The original version of this commit had a bug where
ReadHttpResponse properly set the default value for
accept_statuses, but all calls which came through
ReadHttpJsonResponse were setting None instead.

Bug: 710028
Change-Id: I8cee435d8acd487fb777b3fd69b5e48e19d2e5a3
Reviewed-on: https://chromium-review.googlesource.com/481060
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable 382674be12 Revert "Refactor ReadHttpResponse to be error-friendlier"
This reverts commit 6d7ab1bfe5.

Reason for revert: Stacktrace:
 File "/s/depot_tools/gerrit_util.py", line 816, in GetAccountDetails
   return ReadHttpJsonResponse(conn)
 File "/s/depot_tools/gerrit_util.py", line 376, in ReadHttpJsonResponse
   fh = ReadHttpResponse(conn, accept_statuses)
 File "/s/depot_tools/gerrit_util.py", line 365, in ReadHttpResponse
   if response.status not in accept_statuses:
TypeError: argument of type 'NoneType' is not iterable

Original change's description:
> Refactor ReadHttpResponse to be error-friendlier
> 
> Gerrit sometimes returns a full response json object at
> the same time as returning a non-200 status code. This
> refactor makes it easier for calling code to request
> access to that object and handle error cases on its own.
> 
> Bug: 710028
> Change-Id: Id1017d580d2fb843d5ca6287efcfed8775c52cd6
> Reviewed-on: https://chromium-review.googlesource.com/479450
> Commit-Queue: Aaron Gable <agable@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> 

TBR=agable@chromium.org,tandrii@chromium.org,chromium-reviews@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ia9d9ce835e207a32e7cc8ee35c0cf40c823c7b78
Reviewed-on: https://chromium-review.googlesource.com/481059
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
Aaron Gable 6d7ab1bfe5 Refactor ReadHttpResponse to be error-friendlier
Gerrit sometimes returns a full response json object at
the same time as returning a non-200 status code. This
refactor makes it easier for calling code to request
access to that object and handle error cases on its own.

Bug: 710028
Change-Id: Id1017d580d2fb843d5ca6287efcfed8775c52cd6
Reviewed-on: https://chromium-review.googlesource.com/479450
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Jochen Eisinger d0573ec067 Use OldContents() for OWNERS files to do checks
BUG=141253
R=dpranke@chromium.org

Change-Id: Iacbc2f0571e725e4f2ccf5ea7878f101972289bb
Reviewed-on: https://chromium-review.googlesource.com/476610
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
8 years ago
Jochen Eisinger 76f5fc6cd9 Also print comments found in files during presubmit owners suggestion
R=dpranke@chromium.org
BUG=694222

Change-Id: I5676db2283dd43378293bc9bb32f71e0a1225806
Reviewed-on: https://chromium-review.googlesource.com/471609
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
8 years ago
Lei Zhang 9611c4cee5 Remove cruft of presubmit_support.py:
- TODO regarding --trybot-json
- TODO regarding SVN
- Remove else before return

BUG=583578

Change-Id: I486d4a48ecca729ec2ecfb78f41d4be28665f37d
Reviewed-on: https://chromium-review.googlesource.com/467266
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Jochen Eisinger eb7447605b Configure path to OWNERS.status file via toplevel OWNERS
BUG=694222
R=dpranke@chromium.org

Change-Id: Ie841332129dd6fa8555d2e940c919b812fc9408d
Reviewed-on: https://chromium-review.googlesource.com/467250
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
8 years ago
Jochen Eisinger 72606f8c24 Add support for a global status files for OWNERS
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>
8 years ago
Daniel Cheng 2da34fea29 Fix typo in pydoc for OldContents().
BUG=702851

Change-Id: I56ae20bdc096aaa92ccb5e6e250349ccf4c01a32
Reviewed-on: https://chromium-review.googlesource.com/457913
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
8 years ago
Daniel Cheng 7a1f04d377 Implement presubmit API to get the old contents of an affected file.
BUG=702851

Change-Id: I6f005d19524cbb8b361d3fcb0b91912885c46e00
Reviewed-on: https://chromium-review.googlesource.com/456755
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
8 years ago
Kenneth Russell 61e2ed43fb Moved EnsureCQIncludeTrybotsAreAdded to OutputApi.
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>
8 years ago
Kenneth Russell 1678a364a5 Add presubmit_support.EnsureCQIncludeTrybotsAreAdded.
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>
8 years ago
Andrii Shyshkalov 9c3a464bf7 For Gerrit: use CURRENT_COMMIT option to get description, not gitiles.
R=sergiyb@chromium.org
BUG=681704

Change-Id: I48804955d8e5e579eae6e60fccac304aaaa9230e
Reviewed-on: https://chromium-review.googlesource.com/430625
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
8 years ago
Quinten Yearsley b2cc4a94da depot_tools: Replace pylint error numbers with symbolic names.
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>
8 years ago
Quinten Yearsley 516fe7f881 Presubmit: if there are warnings and may_prompt is false, don't fail.
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>
8 years ago
Aaron Gable f5644a927c Fix keyerror in presubmit_support
BUG=669153

Change-Id: I1e078bfc83ccfa4fd3785fd7388560c4ba43b735
Reviewed-on: https://chromium-review.googlesource.com/416389
Reviewed-by: Mike Stipicevic <stip@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
8 years ago
agable 0b65e732b4 Remove SVN support from PRESUBMIT
R=maruel@chromium.org
BUG=475320

Review-Url: https://codereview.chromium.org/2394043002
8 years ago
Andrii Shyshkalov c6c8b4c99b presubmit_support for Gerrit: don't ignore 404.
Before, presubmit_support would fail with not very useful stacktrace if
Gerrit returns 404, which is usually due to missing/invalid credentials.

This CL fixes that and improves the exception message, and also improves
logic in git_cl.

R=agable@chromium.org
BUG=

Change-Id: Iae8f0c24422c46af70929c7d5d71993164887511
Reviewed-on: https://chromium-review.googlesource.com/409650
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
8 years ago
qyearsley 136b49ff7e depot_tools: Remove DoGetTrySlaves, GetTrySlavesExecuter, GetPreferredTrySlaves
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
8 years ago
thakis adcd4b78d5 presubmit_support: Remove a noisy logging.debug()
On a CL with a single file, presubmit writes all this noise:

Running /b/build/slave/linux/build/src/PRESUBMIT.py
DEBUG:root:Running CheckChangeOnCommit in /b/build/slave/linux/build/src/PRESUBMIT.py
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.(cc|cpp|cxx|mm)$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:git diff -p --no-color --no-prefix --no-ext-diff 691e0c7d46341465de7a605b5f2aee941ccfedc0...HEAD --no-renames;  cwd=/b/build/slave/linux/build/src
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:/usr/bin/python /b/build/slave/linux/build/src/tools/checkperms/checkperms.py --root /b/build/slave/linux/build/src --file content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:^(android_webview|base|content|net)[\\\/].* matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.(cc|cpp|cxx|mm)$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:LocalPaths: ['content/browser/gpu/gpu_data_manager_impl_private.cc']
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.(cc|cpp|cxx|mm)$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:.+\.cc$ matched content/browser/gpu/gpu_data_manager_impl_private.cc
DEBUG:root:Running CheckChangeOnCommit done.

The "a matched b" lines are boring and numerous, so remove this log line.
If we ever need it to debug something, we can add it back then (temporarily).

(From https://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/260304/steps/presubmit/logs/stdio)

BUG=none

Review-Url: https://codereview.chromium.org/2341103002
9 years ago
scottmg 86099d7ce5 Shutdown multiprocess pool after running tests to avoid _finalizer spew on Windows
Can't just let the GC collect the pool on Windows.

R=tandrii@chromium.org
BUG=618726

Review-Url: https://codereview.chromium.org/2296723006
9 years ago
agable 92bec4f56f Delete gcl, drover, and trychange
These tools are relatively standalone, and only ever worked for SVN.
Removing these is a good start to removing other SVN support code.

R=maruel@chromium.org
BUG=475321

Review-Url: https://codereview.chromium.org/2269413002
9 years ago
tobiasjs ff061c0d1d Do not assume that all presubmit directories still exist.
In the case where a CL deletes the last file in the directory,
it is listed in the presubmit files list, but the directory to
which it refers will not exist, leading to os.listdir failing.

BUG=638343

Review-Url: https://codereview.chromium.org/2250353003
9 years ago
tobiasjs 2836bcf810 Support additional user presubmit scripts named PRESUBMIT*.py.
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
9 years ago
agable 565adb55a6 Have presubmit accept various Code-Review label configurations
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
9 years ago
dtu 944b60530e Fix per-file owners check for deleted files.
Previously if you deleted a file that you had per-file owners on, it would fail
the owners check. This fixes that.

Originally, owners.Database used glob to enumerate the directory and added all
the matching files in the directory to some dicts holding the owners
information. If a CL deleted a file, it'd no longer be on the filesystem, so it
wouldn't be in these dicts. There'd be no per-file owners information for it.

With this patch, the Database no longer enumerates individual files. It instead
keeps track of the glob patterns and checks the CL's files against the patterns
at lookup time.

BUG=622381
TEST=tests/owners_unittest.py && tests/owners_finder_test.py  # Unit test included.

Review-Url: https://codereview.chromium.org/2148153002
9 years ago
sergiyb f8a3b38c36 Report keyboard interrupt as abnormal (infra) failure
R=tandrii@chromium.org
BUG=579589

Review-Url: https://codereview.chromium.org/2125713002
9 years ago
dcheng 091b7db64c Expose fnmatch in presubmit's input_api.
BUG=611905

Review-Url: https://codereview.chromium.org/2070493002
9 years ago
dbeam@chromium.org 78d65556a8 Remove unused PresubmitAddReviewers
R=dpranke@chromium.org
BUG=none

Review-Url: https://codereview.chromium.org/1960763002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300488 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 37b07a78ee Reland Implement owners check in presubmit for Gerrit.
R=machenbach@chromium.org,phajdan.jr@chromium.org
BUG=605563

Review-Url: https://codereview.chromium.org/1927773002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300353 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 83b1b238c6 Revert of Implement owners check in presubmit for Gerrit. (patchset #5 id:80001 of https://codereview.chromium.org/1927773002/ )
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
9 years ago
tandrii@chromium.org b4cd1960d5 Implement owners check in presubmit for Gerrit.
R=machenbach@chromium.org,phajdan.jr@chromium.org
BUG=605563

Review-Url: https://codereview.chromium.org/1927773002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300350 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
machenbach@chromium.org 6996a10666 Revert of Implement owners check in presubmit for Gerrit. (patchset #3 id:40001 of https://codereview.chromium.org/1927773002/ )
Reason for revert:
Breaks presubmit:
https://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/175120/steps/presubmit/logs/stdio

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=300320

TBR=phajdan.jr@chromium.org,tandrii@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/1928343002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300326 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org f48a375153 Implement owners check in presubmit for Gerrit.
R=machenbach@chromium.org,phajdan.jr@chromium.org
BUG=605563

Review-Url: https://codereview.chromium.org/1927773002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300320 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
tandrii@chromium.org 57bafac9aa Add --dry_run to presubmit_support.
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
9 years ago
tandrii@chromium.org 015ebae720 Add basic Gerrit support for presubmit_support.
R=andybons@chromium.org,scottmg@chromium.org
BUG=605563

Review URL: https://codereview.chromium.org/1915153003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@300164 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
phajdan.jr@chromium.org 2ff301874b depot_tools: remove code for --trybot-json
It was added in https://codereview.chromium.org/112503005
for https://bugs.chromium.org/p/chromium/issues/detail?id=278558 ,
but we ended up implementing the functionality in different way.

BUG=583578

Review URL: https://codereview.chromium.org/1825063003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299433 0039d316-1c4b-4281-b951-d872f2087c98
9 years ago
primiano@chromium.org b9658c343c presubmit: unblacklist third_party/WebKit
The current DEFAULT_BLACKLIST in presubmit_support blacklists by
default third_party/.* in every repo. This requires an adjustement
after the blink merge, as it causing all the blink presubmits to
become noops.

BUG=539768

Review URL: https://codereview.chromium.org/1382993004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297030 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
iannucci@chromium.org d61a4950b2 Changes to improve multiprocessing PRESUBMIT support in Windows
* 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
10 years ago
iannucci@chromium.org 0af3bb37eb Parallelize pylint PRESUBMIT checks.
R=maruel@chromium.org
BUG=479837,499650

Review URL: https://codereview.chromium.org/1181103002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295664 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
vadimsh@chromium.org cf6a5d2026 Extract authentication options handling into a separate function.
It is done in preparation for switching to OAuth2 as default (and only)
authentication method. Having all auth options handled by the same code makes it
easier to gradually add OAuth2 support.

As part of this, some options that would no longer work with OAuth2 (and that
are not being used from anywhere now, as far as I can tell) are removed:
  * Passing account password for authentication via command line.
  * Overriding 'Host' header when making requests to Rietveld (won't work with
    SSL anyway).
  * --account_type option (seems to be ClientLogin specific).

R=maruel@chromium.org
BUG=356813

Review URL: https://codereview.chromium.org/1075723002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294746 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
sbc@chromium.org 013731e832 Handle KeyboardInterrupt consistently in python scripts
Handle KeyboardInterrupt gracefully rather the printing a
backtrace. Most users of these tools don't expect a
backtrace when then hit Ctrl-C.

Also, fix a few other inconsistencies found in the python
startup code of these different scripts:
- always call main function 'main' (rather than 'Main')
- always return 0 from main function
- if main takes args never include argv[0]

Review URL: https://codereview.chromium.org/955993006

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294250 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
rmistry@google.com 5626a92eec Add ability to specify and run post upload hooks.
Motivation: There are a few things we want to do in Skia infrastructure that is not possible to do without this functionality.
Eg1: If there is a change made to Skia's markdown then automatically include a 'DOCS_PREVIEW_URL=https://skia.org?cl=1234' in the CL's description.
Eg2: Automatically add 'NOTRY=true' for changes impacting things that do not need trybot runs.
Eg3: Include CL specific links to skia's perf (https://perf.skia.org/) and correctness (https://gold.skia.org/) servers.

BUG=chromium:462208

Review URL: https://codereview.chromium.org/949273002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294242 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
thakis@chromium.org c6ef53a877 Revert of Added orphaned compiled Python file checks. (patchset #2 id:20001 of https://codereview.chromium.org/621533002/)
Reason for revert:
Makes `git cl upload` very slow in chrome checkouts.

Original issue's description:
> Added orphaned compiled Python file checks.
> 
> There have been a handful of cases where orphaned compiled Python files (.pyc
> files without an accompanying .py file) have been loaded preferentially by
> the presubmit scripts, causing weird problems. This adds a check and a mode for
> such files, either warning the user or deleting them.
> 
> BUG=None
> TEST=local
>   - Tested against local repository.
> 
> R=iannucci@chromium.org, szager@chromium.org
> 
> Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=292703

TBR=iannucci@chromium.org,szager@chromium.org,dnj@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=None

Review URL: https://codereview.chromium.org/701683002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292818 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
dnj@chromium.org e917ddc33d Added orphaned compiled Python file checks.
There have been a handful of cases where orphaned compiled Python files (.pyc
files without an accompanying .py file) have been loaded preferentially by
the presubmit scripts, causing weird problems. This adds a check and a mode for
such files, either warning the user or deleting them.

BUG=None
TEST=local
  - Tested against local repository.

R=iannucci@chromium.org, szager@chromium.org

Review URL: https://codereview.chromium.org/621533002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292703 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
pgervais@chromium.org bd0cace8c1 Added os to input_api
BUG=
R=maruel@chromium.org

Review URL: https://codereview.chromium.org/614413003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@292291 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
agable@chromium.org 40a3d0b62b Recursively find all tests in a git repo.
This method is necessary to allow good code organization (i.e., unittests live
adjacent to the source files they test) in the new infra.git repository.

R=maruel@chromium.org

Review URL: https://codereview.chromium.org/281013002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@270564 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago