This fixes the case where a user tries to fetch new repos but isn't in
a Git directory (probably true for most people if they don't have,
e.g., their home directory as a Git repo).
There are a couple of ways to bikeshed a solution for this, but the
most straightforward/easiest is to skip since we're just caching the
account presence check.
Bug: b/328682976
Change-Id: I87a0b210451e6952839eef73616d012c41ad300f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6154836
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
This reverts commit 4cebc13a4e.
Reason for revert: this breaks Dart's builds
https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/dart2js-unit-linux-x64-release/27481/infra
Original change's description:
> bot_update: remove cleanup_dir
>
> when git cache is removed, gclient sync fails
> and old checkout is moved into cleanup_dir.
>
> It will cause out of disk error during build
> because cleanup_dir keeps full old checkout and build artifacts,
> which is no longer needed when bot_update
> succeeded to checkout.
>
> Remove cleanup_dir after checkout.
>
> Bug: 388307198
> Change-Id: I3858e718622a1ef2012fe5b80a5d9b128d96d1d4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6155955
> Commit-Queue: Jie Sheng <jiesheng@google.com>
> Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
> Auto-Submit: Fumitoshi Ukai <ukai@google.com>
> Owners-Override: Jie Sheng <jiesheng@google.com>
> Reviewed-by: Junji Watanabe <jwata@google.com>
> Reviewed-by: Jie Sheng <jiesheng@google.com>
Bug: 388307198
Change-Id: Ifb68c1aaf28e2203ba2c3b5804c2fd4939bbd921
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6159604
Auto-Submit: Alexander Thomas <athom@google.com>
Reviewed-by: Jie Sheng <jiesheng@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
when git cache is removed, gclient sync fails
and old checkout is moved into cleanup_dir.
It will cause out of disk error during build
because cleanup_dir keeps full old checkout and build artifacts,
which is no longer needed when bot_update
succeeded to checkout.
Remove cleanup_dir after checkout.
Bug: 388307198
Change-Id: I3858e718622a1ef2012fe5b80a5d9b128d96d1d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6155955
Commit-Queue: Jie Sheng <jiesheng@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Owners-Override: Jie Sheng <jiesheng@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
Reviewed-by: Jie Sheng <jiesheng@google.com>
The analyzer is finding these literal strings and putting error
messages into new CLs. Hack the string up to avoid that.
Change-Id: I8335e6f5e29ca4c2257010629f46036bc250ff73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6147794
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
When running pylint tools in depot_tools itself, we default to the
pylintrc file all the time even though we have versioned ones we
want to use instead. This breaks things like `./pylint-2.17 foo.py`.
Rename the existing pylintrc to 2.6 and duplicate it to 2.7 so we
clear out the 'pylintrc' file and the wrappers always default to the
versioned ones.
We've been riding on pylint being a bit compatible across versions,
but it seems to be accelerating in adding/removing diagnostics and
settings, so this is more churn to add new versions, but we don't
have much choice.
Change-Id: I5c20a41ed8aead3e90b6dda8f5f2fc3b87cfb251
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6150453
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
The presubmit code already picks pylintrc-$VER for pylint-$VER files,
but running pylint-$VER directly does not. This is confusing for
people where `git cl presubmit` does one thing, but `./pylint-$VER`
does another.
Change-Id: I074c34db43cbc383ecab4ff3f9a71b8f2b611d15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6150452
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
The os.path.isfile(RC_FILE) check isn't necessary because RC_FILE
always exists -- it's checking for a static file in depot_tools.
os.environ.setdefault('PYLINTRC',...) is the same thing as checking
'PYLINTRC' in os.environ first. Use that to simplify and drop the
if entirely.
Change-Id: Ib1fb8323c9bceebc5b22484988e9794586aa5e9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6150451
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
This function was a shim to ensure consistency between Python 2 and 3.
It's no longer necessary now that recipes don't support Python 2
anymore, and is being deleted in crrev.com/c/6133284.
Also update two tests to be less sensitive to the exact format of the
summary markdown produced when an exception occurs, since some single
quotes are now changed to double quotes.
Change-Id: Ia8a7bd9be5f03302049f6798c51b8e4e8bdc9784
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6142074
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Oliver Newman <olivernewman@google.com>
Commit-Queue: Oliver Newman <olivernewman@google.com>
In common workflows, this step only succeeds ~5% of the time, and
in the other 95% of cases, simply adds ~30 seconds of wasted time
to the execution time of `rebase-update`. Therefore, this CL removes
the automated functionality, and leaves squashing as a manual option
to the user.
Fixed: 40264739
Bug: 40390274
Change-Id: Ib2a3ffe4b0e5d0b74323a2a0d34ab0e1b7fafb08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6104282
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
This reverts commit bfe1a9282d.
Reason for revert: reland with a fix.
- Find the diff between ps#1 and ps#2.
- Tested at https://paste.googleplex.com/4670451708854272
Original change's description:
> Revert "Support formatting metrics xml(s) in the subfolders."
>
> This reverts commit 597ba08be5.
>
> Reason for revert: it broke git_cl.py. Need further patch
>
> Original change's description:
> > Support formatting metrics xml(s) in the subfolders.
> >
> > https://crrev.com/c/6072565 assumed that the XMLs are located under
> > tools/metrics/{actions,ukm,structured,histograms} directly, such as
> > tools/metrics/histograms/enums.xml.
> >
> > However, its subfolders may have XML files, and it should format
> > the files. This CL fixes it.
> >
> > Bug: 384940858
> > Change-Id: I56484144e6f72f41eb5bc37a5ad462a0de1ec0e3
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6111994
> > Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> > Auto-Submit: Scott Lee <ddoman@chromium.org>
> > Commit-Queue: Scott Lee <ddoman@chromium.org>
>
> Bug: 384940858
> Change-Id: I322573ad6d2d758cd3d2de872efdbba4fd9330c2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6111996
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Scott Lee <ddoman@chromium.org>
Bug: 384940858
Change-Id: Ibe20d5e46c519d7fdbd1114565ec3856e5bf928e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6111997
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
This reverts commit 597ba08be5.
Reason for revert: it broke git_cl.py. Need further patch
Original change's description:
> Support formatting metrics xml(s) in the subfolders.
>
> https://crrev.com/c/6072565 assumed that the XMLs are located under
> tools/metrics/{actions,ukm,structured,histograms} directly, such as
> tools/metrics/histograms/enums.xml.
>
> However, its subfolders may have XML files, and it should format
> the files. This CL fixes it.
>
> Bug: 384940858
> Change-Id: I56484144e6f72f41eb5bc37a5ad462a0de1ec0e3
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6111994
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Auto-Submit: Scott Lee <ddoman@chromium.org>
> Commit-Queue: Scott Lee <ddoman@chromium.org>
Bug: 384940858
Change-Id: I322573ad6d2d758cd3d2de872efdbba4fd9330c2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6111996
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
https://crrev.com/c/6072565 assumed that the XMLs are located under
tools/metrics/{actions,ukm,structured,histograms} directly, such as
tools/metrics/histograms/enums.xml.
However, its subfolders may have XML files, and it should format
the files. This CL fixes it.
Bug: 384940858
Change-Id: I56484144e6f72f41eb5bc37a5ad462a0de1ec0e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6111994
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Scott Lee <ddoman@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
These are the licenses that are currently in chromium and are 'unencumbered', 'permissive', or 'notice' licenses
Change-Id: I40281cdb2e8b7e1af7a06e0ff234e2005903d8c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6055002
Reviewed-by: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
.. to show license classifications via comments
Change-Id: Id18ee6a597457ecaaafbd24373d78aca09ba7058
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6055001
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
metrics_xml_format.py has a check to ensure that the given xml
is located in the current checkout using GetPrimarySolutionPath().
The problem is that GetPrimarySolutionPath() adds "src" if the path
doesn't end with "src".
https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:gclient_paths.py;l=78-79
The workspace in Cog doesn't have "src" in the path. Instead, it creates
a workspace at /..../$workspace_name/$repo_name, which doesn't match
GetPrimarySolutionPath() because the workspace root doesn't end with
'src'.
This must be a common problem in other modules, and Cog gets around
this issue by creating a symlink, 'src', to the workspace root.
This CL replaces os.path.abspath() with os.path.realpath() so that
the check is done properly.
Bug: b/369827156
Change-Id: Iaf56de0a9ccbd168004c4c80672c9dd18211bf5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6094779
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
Change the delimiter for license field from allowing complex cases using "and", "or", and "/" to only allowing a single comma separated list of licenses that are in use.
When given a choice of licenses OWNERS should choose the most appropriate and list this one. In nearly all cases this should be 'whichever is the least restrictive'.
Corresponding change in documentation: https://crrev.com/c/6068628
Change-Id: Ic30dfacb9ba586137b9493cec878b636107a55f4
Bug: 311097536
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6055313
Reviewed-by: Jordan Brown <rop@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
git cl format supports formatting certain xml files under tools/metrics.
This CL adds metrics_xml_formatter so that the formatter can be run
with git cl format.
Bug: b/369827156
Change-Id: I5922cd79304aa8e06917aacc9f2d9bd3ed548c2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6072565
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
- Starts the build server when the build starts.
- Writes tty filename to env variable.
- Tells the build server about the current build so it does not exit
until autoninja does, even if idle.
- Cancels pending tasks on Ctrl+c.
Change-Id: I86bb9852bd0975f381b049b9ff21c38eef7cef9d
Bug: 370589852
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5917985
Reviewed-by: Junji Watanabe <jwata@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Auto-Submit: Mohamed Heikal <mheikal@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Logs a warning if reading the config fails. Still logs a warning for
recommended settings, so the user can create their global config.
Annoyingly, the exit code is the same for missing config file as it is
for an existing but invalid file.
Bug: b/382395049
Change-Id: I81113ff248f7a5eed2f9fd0303e0e81ae80d7d3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6086756
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
In git 2.41, both `list` and `unset` are only options, `--list` and `--unset` respectively. See https://git-scm.com/docs/git-config/2.41.0
These modes are deprecated in later versions; it is recommended to
migrate to the newer syntax, but the old syntax is still supported.
Bug: b/382395049
Change-Id: I9150983084b91279e4f4587a80737e6813937cd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6083215
Commit-Queue: Anne Redulla <aredulla@google.com>
Reviewed-by: Peter Boström <pbos@chromium.org>
Owners-Override: Anne Redulla <aredulla@google.com>
The Windows global Git config bootstrapping shows a warning if you have
not agreed to depot_tools automatically managing your global Git config.
To silence this warning, a user must either:
(1) explicitly allow to automatic management; or
(2) explicitly deny automatic management.
This CL adds a third way to prevent the warning:
(3) The existing global Git config already has the desired values.
Consequently, depot-tools.gitPostprocessVersion is redundant
and has been removed.
Bug: b/382395049
Change-Id: I18260962ee9647578e61993b191e9f76e99b342b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6072987
Commit-Queue: Anne Redulla <aredulla@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Use the "official" XML schema validation pattern from published CPE
schema.
Add a error message to tell owners that they need to provide at least
one component (other than part) in CPE URN format.
Bug: 378273455
Change-Id: I5ac957f02a0f899d069161cdce54fff499fb35f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6073136
Commit-Queue: Jiewei Qian <qjw@chromium.org>
Reviewed-by: Anne Redulla <aredulla@google.com>
LINT.ThenChange is followed by path which sometimes may exceed the
length limit
Bug: 382239821
Change-Id: I2142fd3326704593bd46c8937b1bb904bcef4763
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6077446
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>