Adds --no-python2-post-upload-hooks to git_cl.py. This causes any
post upload hooks to only run under Python 3. Without this, uploading
CLs from builders that omit Python 2 causes the CL the step to fail
after the CL is uploaded.
Bug: 1340617
Change-Id: I5fb45922fb05b28ad570091f9e285dd533d92336
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3996467
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Previously, git thaw would read the whole output of git rev-list HEAD
via readlines(). This was unnecessary, because we almost always only
need to look a few of the most recent commits. Most of the runtime of git-thaw was spend on this.
After this commit, we only read the lines we actually need. This makes git thaw run much faster.
Bug: 1378479
Change-Id: I6f6c06e1df55b4943a94642aa414fc11aeea5718
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3981233
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Martin Bidlingmaier <mbid@google.com>
This reverts commit f52f44b287.
Reason for revert: Breaks various internal Nest builds
Original change's description:
> Update autoninja to check for enable_rbe_bootstrap on builds that use
> it.
>
> Autoninja at this point still assumes that build directories are two
> levels up from the chromium/src directory. This will be addressed in a
> follow-on cl.
>
> Bug: b/169983312,b/253452972
> Change-Id: I13eb1e5d8ebfb83d565ea84b6a89c7784eb7fde3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3975409
> Commit-Queue: Michael Savigny <msavigny@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Bug: b/169983312,b/253452972
Change-Id: Idad4caf46f12860fb4804251f62d0fb498add27d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3982826
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
it.
Autoninja at this point still assumes that build directories are two
levels up from the chromium/src directory. This will be addressed in a
follow-on cl.
Bug: b/169983312,b/253452972
Change-Id: I13eb1e5d8ebfb83d565ea84b6a89c7784eb7fde3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3975409
Commit-Queue: Michael Savigny <msavigny@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Makes it easier to run on linux/mac.
Change-Id: I0ebf512cd576a5c8aafbddc7c6b6f8e2bd6919d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3971922
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
Makes the git_cl recipe module use vpython3 instead of vpython, as
the latter breaks when running on builders with the omit_python2
experiment.
Bug: 1366965
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: infra
Change-Id: I2306e97dbc7b75201024b5dcf1892787185d5f77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3968801
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Change crrev.com/c/3967210 compared a regex result (str) to current_year
(int), which will never match. This fixes the comparison by converting
current_year to str. Unit tests to validate the behavior will be added
in a follow-up.
Bug: 1098010
Change-Id: I79d0adc6d6566df71425bfb448091445f57ad2c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3968797
Auto-Submit: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
In crrev.com/c/3955701 the license checks were made stricter on new
files. Unfortunately moved and new files are indistinguishable in the
presubmit system, and moved files are not supposed to update their
copyright year.
So, CheckLicense() now emits three different types of presubmit results:
1) If a file is new/moved and the license is malformed then an error
is reported.
2) If a file is new/moved and the year is not current then a warning
is issued, with advice to ignore the warning if the file was moved.
3) If a file is not new/moved and it has a bad license then a warning
is issued.
This will ensure that new files do not have bad licenses, and will
usually get the year correct.
The new output looks like this (for one moved file with an old date,
one file with a bad license, and one new file with a bad license):
** Presubmit Warnings: 2 **
License doesn't list the current year. If this is a new file, use the current year. If this is a moved file then ignore this warning.
base\win\moved.cc
License must match:
.*? Copyright (\(c\) )?(2022|2021|2020|2019|2018|2017|2016|2015|2014|2013|2012|2011|2010|2009|2008|2007|2006|2006-2008|2006-2009|2006-2010) The Chromium Authors(\. All rights reserved\.)?\n.*? Use of this source code is governed by a BSD-style license that can be\n.*? found in the LICENSE file\.(?: \*/)?\n
Found a bad license header in these files:
base\win\bad_license.cc
** Presubmit ERRORS: 1 **
License on new files must match:
.*? Copyright (2022|2021|2020|2019|2018|2017|2016|2015|2014|2013|2012|2011|2010|2009|2008|2007|2006|2006-2008|2006-2009|2006-2010) The Chromium Authors\n.*? Use of this source code is governed by a BSD-style license that can be\n.*? found in the LICENSE file\.\n
Found a bad license header in these new files:
base\win\new_file.cc
Bug: 1098010
Change-Id: Ia62b0591ee416c55566427bba9fdd91d74a26349
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3967210
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Mike Dougherty <michaeldo@chromium.org>
For reasons unknown, the presubmit seems to make multiple passes
sometimes; this sometimes results in an email address being inserted
into the list of additional CCs multiple times. While this is de-duped
by Gerrit, it still generates a fairly spammy message on the client
side.
Change-Id: I38688462d02ff17f3765c91af326161107027351
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3957428
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Including this change:
https://chromium-review.googlesource.com/c/infra/luci/luci-go/+/3777409
This was tried before, but didn't stick because legacy CQ doesn't
handle location_filters; now almost all projects are migrated to CV.
Bug: 1171945
Change-Id: I6a5734922973dd8b506dc018d8838a6f2dacd271
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3965089
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Auto-Submit: Quinten Yearsley <qyearsley@chromium.org>
The Chromium license check is quite forgiving because it has to handle
variations that have accumulated over the years. But, there is no need
for it to be forgiving on new files. This change requires that new files
have a license that _exactly_ matches what we want, including having the
current year. This will catch lots of errors that would otherwise
require an observant reviewer.
This does mean that if an old file is copied that it might require some
updates.
This was tested with presubmit --all where it gave identical results to
the old check. It was also tested with new files with bad licenses to
make sure that the new check behaved as designed.
This change also switches from f.OldContents() to f.Action() == 'A'.
f.OldContents() is very expensive (about _40_ minutes if invoked on all
files during presubmit --all) and f.Action() == 'A'dded better indicates
what we are actually checking.
This change also switches from checking for the presence of key_line
before doing the regex search to just doing the regex search on the
start of the file. Both techniques avoid the extreme cost of a regex
search on large files with no license, but the new technique is simpler.
Bug: 1098010
Change-Id: I028d72cd31f5d0f787a522c54683de32f2a98867
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3955701
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
The change updates git_cl to check for "banned words" too in the stdout to add helpful feedback when the upload fails due to banned words.
Bug: 1375130
Change-Id: Ic29faae9d9601face8455ffbb7314955261ffd57
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3961632
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
The initial version of detecting Python 2 usage in presubmit child
scripts used a text file in depot_tools to record Python 2 usage. This
caused problems in chromeos so this change moves to the file to the temp
directory, which is where it should have been in the first place.
Bug: 1366661
Change-Id: I003b813d7bd5f70956dd3418f86e8ed6edf88220
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3954470
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Changes in this release:
55ee5cd215996e99b807bd19060f8c6845423985 Switch to a buffered channel.
c18f898c8628f7063328a553de31b5a13ebbd47a Fix comment typos.
c55184b5835c789d073ce8ba10745cc7efedcd65 Fix typo
50e0d6a61bf2706e8096a4c3785331f2fa1f2bad Fix some warnings that are causing presubmit errors for the 2.7 fork.
39ca9cb80c0c7f5a18bcdcc6ce65bfdb1cc64879 Update vpython deployment doc
c93fd3c5ebdc3999eea86a7623dbd1ed4b40bc78 Roll chromiumos/config manually to fix the broken roller
149a1934123a29ca32c85f73597e7ffbfa7dbf4a Add initial PRESUBMIT support for linting python3
Change-Id: I1155342ace04e2944a9abe531e0f8b5d0206a0eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3951269
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Auto-Submit: Brian Ryner <bryner@google.com>
os.remove can't be used to remove non empty directory. Use rmtree from
gclient_utils.
R=jojwang@google.com
Bug: 1372658
Change-Id: I5c08bad9778396cb9b1ec0bebe6287a0f3823fab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3950469
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Auto-Submit: Josip Sokcevic <sokcevic@google.com>