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
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
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
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
* 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
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
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
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
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
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
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
This should help debugging should presubmit failures on a CQ.
BUG=
Review URL: https://codereview.chromium.org/250383006
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@266063 0039d316-1c4b-4281-b951-d872f2087c98
Must change current working directory to the presubmit file's directory
to follow the contract of the presubmit scripts.
BUG=348691
Review URL: https://codereview.chromium.org/181063021
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@254618 0039d316-1c4b-4281-b951-d872f2087c98
Write a small HowTo to help confused people by confusing checks.
R=iannucci@chromium.org
BUG=
Review URL: https://codereview.chromium.org/137653003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@244717 0039d316-1c4b-4281-b951-d872f2087c98
This is useful to diagnose slow tests. Make this multiprocessing aware. Stop
printing when the commands are added but use the proper message system instead.
R=iannucci@chromium.org
BUG=
Review URL: https://codereview.chromium.org/99453003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@238388 0039d316-1c4b-4281-b951-d872f2087c98
This is needed for a further CL to unify TS and CQ using PRESUBMIT.py.
BUG=278554
Review URL: https://codereview.chromium.org/54373011
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@232813 0039d316-1c4b-4281-b951-d872f2087c98
scons hasn't been used in a long time.
Also remove support for using make on Mac, it's no longer supported. All bots
that were using make on mac are using ninja these days.
BUG=305702
Review URL: https://codereview.chromium.org/26672003
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@227778 0039d316-1c4b-4281-b951-d872f2087c98
src/base/hash_tables.h has moved to src/base/containers/hash_tables.h in r205241.
R=maruel@chromium.org
Review URL: https://chromiumcodereview.appspot.com/16787005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@205662 0039d316-1c4b-4281-b951-d872f2087c98
Greatly improves presubmit performance on Blink where there may be rule violations (my test case went from 50s to 5s).
BUG=236206
TEST=new test in presubmit_unittest.py; manual performance test on Mac and Windows after touching hundreds of files in webkit; testing included add/move/edit/delete on both binary and text files.
Review URL: https://chromiumcodereview.appspot.com/15898005
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@205275 0039d316-1c4b-4281-b951-d872f2087c98
Regular map is preferred when parallization does
not speed presubmit tests. It makes stacktraces more
understandable and facilitates debugging. Only use
parallel pool when tests > 1.
R=maruel@chromium.org
Review URL: https://chromiumcodereview.appspot.com/15385002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@200940 0039d316-1c4b-4281-b951-d872f2087c98
Some PRESUBMIT files dynamically generate test list
and so may pass an empty list to RunTests. There
appears to be a bug in multiprocessing.Pool that
causes a stall in map_async with an empty list.
TBR=maruel
Review URL: https://chromiumcodereview.appspot.com/14962011
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@200613 0039d316-1c4b-4281-b951-d872f2087c98
Make it more consistent across the tool. Using \s also includes \n, which
confuses the tool.
Add more tests.
R=iannucci@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/14265007
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@195214 0039d316-1c4b-4281-b951-d872f2087c98
This will let clients that don't use the heavily filtered canned cpplint
check and want to behave more strictly (aka cc/) reuse any common
settings applied to the cpplint module.
R=maruel@chromium.org
BUG=none
Review URL: https://codereview.chromium.org/13866044
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@194264 0039d316-1c4b-4281-b951-d872f2087c98
PresubmitPromptOrNotify prints the message and prompts the user only
if the presubmit is on upload, not commit.
This is useful to provide upload-time sanity checks without blocking
the CL from being landed via the commit-queue.
Review URL: https://chromiumcodereview.appspot.com/12676031
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@190711 0039d316-1c4b-4281-b951-d872f2087c98
This will replace the hack in commit-queue/verification/presubmit_shim, and will
be used on the presubmit trybot.
R=maruel@chromium.org
BUG=
Review URL: https://codereview.chromium.org/12481002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@186922 0039d316-1c4b-4281-b951-d872f2087c98
Multiple presubmit checks may call the same function multiple times, so it's
worth caching the results to speed up the presubmit check run.
Convert presubmit_support, git-cl and gcl to use it.
R=dpranke@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/11280143
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@169726 0039d316-1c4b-4281-b951-d872f2087c98