Commit Graph

129 Commits (main)

Author SHA1 Message Date
Gavin Mak 9f715f8017 Revert "Add AffectedFile.Extension() in presubmit_support"
This reverts commit d447f41294.

Reason for revert: "AttributeError: 'str' object has no attribute 'Extension'"

Original change's description:
> Add AffectedFile.Extension() in presubmit_support
>
> Add convenience method AffectedFile.Extension() for extracting file
> extension in a standard way. Add a test for this new functionality.
> Add a similar test for AffectedFile.UnixLocalPath().
>
> Bug: None
> Change-Id: If591e751fb2e4fb5355ad0b6f93f310667849d68
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6273341
> Commit-Queue: Anton Bershanskyi <bershanskyi@gmail.com>
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Reviewed-by: Gavin Mak <gavinmak@google.com>

Bug: None
Change-Id: Ic51b0942e3a3267194fb73af5e92c902b2098c4c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6279837
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
1 week ago
Anton Bershanskyi d447f41294 Add AffectedFile.Extension() in presubmit_support
Add convenience method AffectedFile.Extension() for extracting file
extension in a standard way. Add a test for this new functionality.
Add a similar test for AffectedFile.UnixLocalPath().

Bug: None
Change-Id: If591e751fb2e4fb5355ad0b6f93f310667849d68
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6273341
Commit-Queue: Anton Bershanskyi <bershanskyi@gmail.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 week ago
Philipp Wollermann b832657a0c presubmit: Check freeze on commit only
Blocking developers from uploading (even WIP) CLs to Gerrit during a
production freeze seems unnecessary and too strict. By turning
CheckFreeze into an "on commit" presubmit check, developers will be able
to upload CLs for review, but not submit them during a freeze.

Change-Id: I199c6c3edcbe1e2d69e4caf74f2d4c9060e98e54
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5932363
Auto-Submit: Philipp Wollermann <philwo@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
4 months ago
Josip Sokcevic ed89aaf597 Update freeze dates for 2024, internal conference
Change-Id: If5d90a728ce765a7c6ad451a58698c59ec563b44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5913187
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Erik Staab <estaab@chromium.org>
5 months ago
Josip Sokcevic cb8b22fa77 [PRESUBMIT] Increase unit test timeout
Windows is frequently hitting the timeout.

R=gavinmak@google.com

Fixed: 1517377
Change-Id: I86f18767ef11ed8c88f7a3b91b621fc0ea8ef3ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5187116
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 year ago
Gavin Mak edba22d4eb Fix multiline comment formatting
Many incorrectly formatted comments exist from the switch to
4 space indent: https://crrev.com/c/4836379

Bug: 1514505
Change-Id: I6366f9da812919bd35b999f18fa8a49b7a66c09b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5153633
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Mike Frysinger 124bb8e53c switch to 4 space indent
Leave the recipes/ code at 2 space to match the rest of the recipes
project in other repos.

Reformatted using:
files=( $(
	git ls-tree -r --name-only HEAD | \
		grep -Ev -e '^(third_party|recipes)/' | \
		grep '\.py$';
	git grep -l '#!/usr/bin/env.*python' | grep -v '\.py$'
) )
parallel ./yapf -i -- "${files[@]}"
~/chromiumos/chromite/contrib/reflow_overlong_comments "${files[@]}"

The files that still had strings that were too long were manually
reformatted because they were easy and only a few issues.
autoninja.py
clang_format.py
download_from_google_storage.py
fix_encoding.py
gclient_utils.py
git_cache.py
git_common.py
git_map_branches.py
git_reparent_branch.py
gn.py
my_activity.py
owners_finder.py
presubmit_canned_checks.py
reclient_helper.py
reclientreport.py
roll_dep.py
rustfmt.py
siso.py
split_cl.py
subcommand.py
subprocess2.py
swift_format.py
upload_to_google_storage.py

These files still had lines (strings) that were too long, so the pylint
warnings were suppressed with a TODO.
auth.py
gclient.py
gclient_eval.py
gclient_paths.py
gclient_scm.py
gerrit_util.py
git_cl.py
presubmit_canned_checks.py
presubmit_support.py
scm.py

Change-Id: Ia6535c4f2c48d46b589ec1e791dde6c6b2ea858f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4836379
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Takuto Ikuta 90a9eaf042 PRESUBMIT.py: remove `USE_PYTHON3 = True`
presubmit now uses python3 only.

Bug: 1207012
Change-Id: If8b701db42b22529faa91553061f1db52b83d4f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4570182
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Robert Iannucci 716022354a Stop running presubmit unittests with python2.
R=ajp@google.com, aravindvasudev@google.com, bryner

Bug: 1441784, 1359438
Change-Id: I8ea7b1aee2df016d15d9bf9d630728b76d1e77cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4521757
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
2 years ago
Bruce Dawson 424814829a Specify encoding when opening text files
When opening a text file it is important to specify encoding='utf-8'
since otherwise the behavior will depend on your system locale. This
change fixes various encoding omissions in PRESUBMIT.py files, found
when presubmits were run when uploading crrev.com/c/4290775.

Bug: 1418846
Change-Id: Ief5f6d6bb749de95bc4071055492e6c9c6b6c56d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4292516
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
2 years ago
Josip Sokcevic 95c7da10c5 Only run selected tests on py2
depot_tools codebase uses py3 and there's limited py2 usage, namely for
presubmits. This CL drops running most of py2 unit tests since there are
no longer useful.

Bug: 1357152
Change-Id: I49a3df503026bc6918362a9b5600f5714eb5c87a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3872425
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
3 years ago
Garrett Beaty f41670fdad Add a presubmit check to enforce that code is formatted.
Change-Id: I75be1231fd695459abfdc88af3ccc0ec5cdfde1e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3862407
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
3 years ago
Takuto Ikuta 381db68adc autoninja: add simple test
This is to prevent revert like https://crrev.com/c/3607513

Bug: 1317620
Change-Id: I6ab7aba5f92719bd573d22d90358f58e48aeb10c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3607514
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
3 years ago
Aravind Vasudevan c5f0cbb865 Use pylint 2.7 for depot_tools
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.

Bug:1262286
Change-Id: I4b8f8fc521386419a3121bbb07edc8ac83170a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413679
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Josip Sokcevic 42c5bbbc96 Revert "Use pylint 2.7 for depot_tools"
This reverts commit 22bf605bb6.

Reason for revert: breaks gclient sync

Original change's description:
> Use pylint 2.7 for depot_tools
>
> This includes a few fixes for specific errors, and disables several new
> warnings introduced in this version, in order to allow for an incremental migration.
>
> Bug:1262286
> Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>

Bug: 1262286
Change-Id: Ieb946073c7886c7bf056ce843a5a48e82becf7a5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413672
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Aravind Vasudevan 22bf605bb6 Use pylint 2.7 for depot_tools
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.

Bug:1262286
Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
3 years ago
Takuto Ikuta a657331e90 ninjalog_uploader: use goma_auth to detect googler
Bug: 1288639
Change-Id: I447e2f66603ffb8d68599dcf22023fd7857dc4fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400398
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
3 years ago
Josip Sokcevic a29f589a15 Make fix_encoding_test py3 compatible
And run it in presubmit checks

R=gavinmak@google.com

Change-Id: If2a8848f6ce85c466f45d9bf0f4fca6b4d75312f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3296677
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Josip Sokcevic b6c1ed40d5 Make presubmit_unittest py3 compatible
And run it in presubmit checks

R=apolito@google.com

Change-Id: I1521fe4dd9fd5fe391459a00a91f03399b15b36a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3292211
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
3 years ago
Josip Sokcevic 11c32b5f69 Run py3 compatible unit tests with py3
R=apolito@google.com

Change-Id: Id5e4f99ccb9d284ac09c2c4dd0fa57e59cb54f49
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3291894
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
3 years ago
Josip Sokcevic 57c928cd95 Update PRESUBMIT to v2.0.0
Run unit tests only on commit since it's way too slow for upload. User
can still run tests on local machine via `git cl presubmit` or directly.

This CL reduces time it takes to upload from 2+ minutes to ~10s.

R=apolito@google.com

Fixed: 1263688
Change-Id: Id96c049296eea7c0a4d1e484dce6ae4296aa8041
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3249192
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Anthony Polito <apolito@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
3 years ago
Josip Sokcevic 4940cc4b8f Require certifi package and python3 in my_activity
my_activity.py talks to third party (e.g. review.coreboot.org). Without
certifi package, making https connection may result in
CERTIFICATE_VERIFY_FAILED.

Adding certifi package to .vpython (py2) doesn't work, so this change
drops py2 support for my_activity.py.

R=gavinmak@google.com

Fixed: 1255921
Change-Id: I515b14c81d37a52d482d08085d8029c791911ae8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3206906
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Josip Sokcevic 9eee47a8e9 Validate infra configs on presubmit
Try to parse json files on presubmit and add warning it if unable to
parse.

R=apolito@google.com

Bug: 1223923
Change-Id: I67ab4702cb9b995aace6527f4a04f1a1068db7d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3019692
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Anthony Polito <apolito@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
4 years ago
Dirk Pranke 61bf6e8d69 Add support for running PRESUBMIT.py checks under Python2 or 3.
This CL adds support for running PRESUBMIT.py under either Python2
or Python3 as specified in each PRESUBMIT.py file.

To run the checks under Python3, the PRESUBMIT.py file must contain
a line exactly matching "^USE_PYTHON3 = True$". If the file
does not contain this string, the checks will run under Python2.

Different PRESUBMIT.py files in a single CL may thus contain
a mix of 2- and 3-compatible checks, but each individual file will
only be run in one or the other (it doesn't likely make sense to run
them in both by default).

Bug: 1157663
Change-Id: Ic74977941a6519388089328b6e1dfba2e885924b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2832654
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
4 years ago
Edward Lesmes 8404644cfd Ignore TBR and don't enforce OWNERS on commit
Change-Id: Ic18cbdcbef99fcfc563a37df1e1727f1426233b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2685631
Reviewed-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
4 years ago
Josip Sokcevic c6aa151180 Warn only if non-inclusive term is used
This fixes the issue where presubmit_canned_checks issues a warning if
optional arguments in CheckAuthorizedAuthor are not used at all.

This relands commit b09f2bb2f2 with some
additional changes.

R=apolito@google.com

Bug: 1098560
Change-Id: If323d90ab7d6bcca68ed89142ea67edc4be057d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2373216
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Josip Sokcevic b09f2bb2f2 Revert "Warn when non-inclusive parameters are used"
This reverts commit 149a3b7581.

Reason for revert: warnings are issued if no optional parameters
are passed.

Original change's description:
> Warn when non-inclusive parameters are used
> 
> R=​apolito@google.com
> 
> Bug: 1098560
> Change-Id: Iabc2a5d89a6af1418c1228f3c09eacbbd799b5c7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2355112
> Reviewed-by: Anthony Polito <apolito@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>

TBR=apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1098560
Change-Id: Ib0f188de90121c692f5c0d7271938ee312917fd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2376042
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Josip Sokcevic 149a3b7581 Warn when non-inclusive parameters are used
R=apolito@google.com

Bug: 1098560
Change-Id: Iabc2a5d89a6af1418c1228f3c09eacbbd799b5c7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2355112
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
local_bot 9af33fa208 Use inclusive parameters in PRESUBMIT.py
R=dpranke@google.com

Bug: 1098560
Change-Id: I22f7e89cafb6c8ab7e268afc7004c5ed57f12d12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2288510
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Ayu Ishii 81a9074069 CodeInclusion: Rename whitelist/blacklist -> allowlist/blocklist
Bug: 1097674
Change-Id: I42ad9758cc51e37adf9d2941def720ee83954279
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2268405
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Ayu Ishii <ayui@chromium.org>
5 years ago
Josip Sokcevic 6a7e234b58 Fix Windows unit tests for roll-dep and use py3
R=ehmaldonado@chromium.org

Change-Id: I5bf1aa21a5ae9b90dbab4cc0439ca19e73de337f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2125221
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Josip Sokcevic 6cf3d24913 Enable test for git_rebase_update on Windows
R=ehmaldonado@chromium.org

Change-Id: Ie801df1cef3d36fbfe6ba9fbd922bff4cf03a006
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2123867
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Josip Sokcevic d1d4ac90c3 Fix git_number windows unit tests
This fixes python2 unit tests (py3 works fine)

Change-Id: I9b968ba5d5f534166ce6c4fe59c8dfa4beb73021
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2121563
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Edward Lesmes ae3586b538 depot_tools: Use gclient_utils.AskForData instead of raw_input.
gclient_utils.AskForData will use raw_input on Python 2 and input on Python 3.

Bug: 1063976
Change-Id: I93c059c4e4454d01787716b5a0a2641ad5253f53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2116370
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Josip Sokcevic 2ce099416c Add win support for subprocess2 unit tests
Change-Id: Idea502dc67d8cf0b7387c1b68eb0c62837af971b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2111430
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Josip Sokcevic 464e9ff4f3 Add support for git_cl_tests on Windows platform
Change-Id: I9d3d084e7f48ab991db3db16873f030890ad72d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2108981
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
5 years ago
Edward Lemur 595eb19165 PRESUBMIT.py: Add timeout to tests.
Interrupt tests after 3 min, so that failures can be
surfaced before the presubmit step gets interrupted
on the bot.

Change-Id: Ia0efebaac5a0c5072b974a4fbbcb14fe672017ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2098942
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur d52eddaad2 scm: Fix bug when checking for valid revision and add tests.
When running `git rev-parse REV^{commit}` in Windows, `^` must be
escaped.
However, it was escaped more times than necessary.

Split IsValidRevision to call ResolveCommit, add tests to ResolveCommit,
and run scm.py tests on Windows.

Change-Id: I761a820394c8b5410d68b6ccd6c352c41c30c88c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2092904
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur b800fde565 git-map: Refactor and add simple tests
Change-Id: I8fd0034f6a6d7623792620f92208b25961fa174e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1990142
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lesmes 05934953bf gclient: Make smoketests run on Windows.
Bug: 1024683
Change-Id: I1c30473699c1bd6b198188b53b632e3617fed335
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1929653
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Robert Iannucci ee67b97daa Roll python to actually correct packages.
For bonus points, this also fixes PRESUBMIT so that it actually checks
the manifests.

TBR=bpastene@chromium.org, tandrii@chromium.org

Bug: 1032743
Change-Id: I4dac5a520e333e3c429597684a44ece83d21c5fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1960950
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
5 years ago
Edward Lesmes 94d6f48ba1 gsutil: Decode output from subprocess.
Bug: 1007872, 1009819
Change-Id: Icb24badc0429012dc66912d7d35e03a456512787
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1894354
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lesmes e79107e01b gclient_scm: Fix tests on windows
Change-Id: I649bee199e52ecbd66467cfaf850a7a57e2eedf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1874506
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lesmes a51a06699f presubmit: Run tests on Windows.
Change-Id: Ia6844cd6da6a9c68ed3d83144bd032933ab69fcf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1875110
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
5 years ago
Edward Lesmes ab51754cc7 depot_tools: Run git_cache_test and git_footers_test on windows.
Bug: Some
Change-Id: I74eef44bfe3d940c773e548e6d1035dee4cd45ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1842638
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lesmes 451e8babe2 depot_tools: Fix gclient_test on Windows.
Bug: 1007580
Change-Id: I8265b3f4e64b95d7f107b50eb8c68983d6002468
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1828080
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
5 years ago
Edward Lemur bbd70fd7b9 depot_tools: Enable more tests for windows.
Bug: 1007580
Change-Id: Ic407566149f78a8de5f173ae4c8726fc25834b8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1750146
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur a877ee62b1 depot_tools: Run some tests on Python 3 on the bots.
Bug: 984182
Change-Id: I0b7f1e3e056548a27a416c9b4078e54c9e5d60d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1769400
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@google.com>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
6 years ago
Aaron Gable 1318a30f19 Call new CheckJsonParses in PRESUBMIT
I have verified that all JSON files currently in depot_tools
pass this check.

Change-Id: I8247653a8161adf69b20d0a837b9f7723936ade2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1620308
Reviewed-by: Sean McCullough <seanmccullough@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
6 years ago
Vadim Shtayura f9b4845975 [cipd] Bump CIPD client version to 2.2.8, add presubmit check for *.digests.
The new version uses SHA256 for uploads by default. It also fully supports
$ResolvedVersions and 'selfupdate-roll'.

The roll was generated by:
$ ./cipd selfupdate-roll \
  -version-file cipd_client_version \
  -version git_revision:fb963f0f43e265a65fb7f1f202e17ea23e947063

BUG=821194, 870166
R=nodir@chromium.org, iannucci@chromium.org

Change-Id: If7c23c43ff2c1bf50c9c50f4e9e17a23e84859b9
Reviewed-on: https://chromium-review.googlesource.com/1227431
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Nodir Turakulov <nodir@chromium.org>
7 years ago