_UpdateMirrorIfNotContains populates the mirror if a given rev
isn't found in the mirror, but if this rev is invalid, it's never
fetched at all. Check that we've actually fetched it after
populating the mirror.
Bug: 407864212
Change-Id: Id66695636e749c4f7372aa522ab03ec4ec8feb52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6441962
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
cpplint is removed from Tricium in CL:6219798. Remove the reference to
it to avoid confusion.
Bug: 393394190
Change-Id: Id816bfef3af18a6d95b655b8e1155632595b1835
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6446043
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Tommy Chiang <ototot@google.com>
The config dumps a lot of text, so pause here. Probably improves UX a
bit.
Change-Id: I9890f9286abe28ecc3e6f05b6d0dde94c5bc9710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6442237
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
The UX of cd'ing to a non-Gerrit repo to setup common repo auth is not
good. Also people don't read.
Bug: 408501013
Change-Id: Ia31914cf8672d0b5a6033de11c928140fd34a95c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6442235
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
People assume the tool has failed and keep trying to re-run it when it
says to run git credential-luci login.
Bug: 408501013
Change-Id: Id1f671bacfdc19d4614ff03cfa69bfd484ad741b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6441970
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Dissuade users from removing their .gitcookies manually.
Just to create a single UX path and prevent possible issues.
Bug: 408225524
Change-Id: Ief48806dccf759ead8d145424c854561e09d43ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6440131
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Third time's the charm. The issue is still the "multi-valued boolean"
logic. I introduce a new "switched on" concept to clarify things.
If new auth is "switched off", then all new auth related things are
off. Simple enough.
There are two ways for new auth to be "switched on". Either it is
explicitly enabled in the user's config, or we rolled out the default
to on.
When it is "switched on", we still rely on the presence of .gitcookies
to determine whether we enable new auth for depot_tools. HOWEVER, we
must use the new git cl creds-check, because that is the intended way
for users to remove their .gitcookies file.
| auth logic | creds-check |
switched off | old | old |
switched on +cookies | old | new |
switched on -cookies | new | new |
Change-Id: I311089960d78d8be2cdffd00e4515bfebf0f8f58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6439385
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
I got greedy with the first fix, with the assumption that the flag
enablement would not get rolled back. As it would be easier to not
worry about this logic flip-flopping based on the default flag
flip-flopping.
Spoilers: it did get rolled back, so we end up with the new
creds-check with the newauth flag defaulting to off. And this causes
a UX problem because new users would get prompted to run creds-check
to set up a gitcookies file, but the new creds-check logic doesn't do
that.
Based on our newfound experience, this should just follow the default
value. There'll still be some friction whenever we flip-flop the default
value, but that's kind of unavoidable.
Change-Id: I0d81ed4123a8a9bced2fc4300214376cd3f1c9d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6434738
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
This causes more trouble than it's worth (it's breaking dawn builds).
That does mean for a fresh depot_tools install, users will need to
explicitly run git cl creds-check once, which means tracking down all
of the docs that need to say that.
In the meantime, it's probably better to delete this now.
Bug: 408427309
Change-Id: I5595756441500c43c543b47d97ff6b1bd9ddab30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6434734
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Clarify why SSO is needed for the check, even if the account may not
need SSO.
Bug: 408243787
Change-Id: If855eec2dbc414a112db3469b5cc73b3f5846651
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6431248
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
The `git cl cherry-pick` command previously created chained CLs by
first cherry-picking a change onto the destination branch tip and then
rebasing the result onto the parent CL created in the previous step.
This approach failed when a sequence of cherry-picks resulted in an
intermediate state having an identical tree compared to its intended
base (e.g., commit 1 changes X->Y, commit 2 changes Y->X). Gerrit
would reject the second cherry-pick with an "identical tree" error
because the rebase is done after the cherry pick.
This change modifies the process to use the `base` parameter of the
Gerrit `cherrypick` REST API endpoint.
Changes:
- Modify `gerrit_util.CherryPick` to accept and pass an optional `base`
commit hash in the API request body.
- Update `git_cl.CMDcherry_pick`:
- Before each cherry-pick operation in the loop, fetch the commit hash
of the latest patchset from the previously processed parent CL.
- Pass this commit hash as the `base` parameter to `gerrit_util.CherryPick`.
- Remove the subsequent, now redundant, call to `gerrit_util.RebaseChange`.
This ensures the correct parent commit is specified during the
cherry-pick operation itself, allowing Gerrit to handle the chaining
correctly and avoid failures caused by identical tree states in
intermediate steps.
Bug: 408388488
Change-Id: I84066d65bd6bb127b253bee6564dd0622148a0e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6433112
Commit-Queue: Gennady Tsitovich <gtsitovich@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
This reverts commit 2e9d2d7ebe.
Reason for revert: this is the possible culprit for b/408427309
Original change's description:
> [newauth] Enable by default
>
> Bug: 404613530
> Change-Id: If0a214fe074d7e7591b5d37417ca447525c983b6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6418563
> Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
> Commit-Queue: Allen Li <ayatane@chromium.org>
Bug: 404613530, 408427309
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Ib919b2f3d852709c0e80622b4ad97327ac2ea5bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6434729
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
non-Eng users don't have access to src-internal, so
need to use rbe-chromium-untrusted even on corp machine.
Bug: 408114984
Change-Id: I8956926a8723fbee70b2defb2f6f49bccc37e22e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6433491
Reviewed-by: Philipp Wollermann <philwo@google.com>
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
This includes a new version of ResultSink that supports structured
test ID uploads. It also includes various background changes
made in the last few months.
BUG=b:398112066
Change-Id: I792a2e70db30c00493c76d6e242ed6092a0d2a7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6427703
Reviewed-by: Chenlin Fan <fancl@chromium.org>
Reviewed-by: Beining Chen <beining@google.com>
Commit-Queue: Patrick Meiring <meiring@google.com>
The three-way logic here (explicitly on, default (which is now on),
explicitly off) was slightly off.
Bug: 408243787
Change-Id: Idc0b55e63627708fe257ea7ca5a7f5f5dd5e1c08
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6431386
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
These tests get broken by If0a214fe074d7e7591b5d37417ca447525c983b6 so
delete them.
Now, you might raise your eyebrows at that, but hear me out.
These tests are so heavily mocked that I argue that they aren't
providing any value. What's the point of tests? To save time by
catching regressions early.
Being dumped a large list of expected mocked calls like:
@10: (['os.path.isfile', 'TEMP_DIR/trace-packet'],)
@11: (['FileRead', 'TEMP_DIR/trace-packet'],)
@12: (['FileWrite', 'TEMP_DIR/trace-packet', 'git-hash: 012345\ngit-hash: abcdea\n'],)
@13: (['make_archive', 'TRACES_DIR/20170316T200041.000000-traces', 'zip', 'TEMP_DIR'],)
@14: (['FileWrite', 'TEMP_DIR/git-config', <ANY>],)
provides little value. Like, what the heck is this even supposed to
be testing?
I argue that:
the cost of potentially having a regression in the future, fixing it,
and adding a new, sane test for that case
is LESS than:
the cost of someone looking at one of these tests failures and
trying to figure out what exactly broke, whether it is an actual
breakage or do they just need to wade into the mess of expected mocked
calls and figure out how to update the mocked calls to reflect a
perfectly fine change that they are trying to make
Bug: 404613530
Change-Id: Id8e2f5ebb9ad55ee32291c2f70b2d26fb479b195
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6428049
Reviewed-by: Gregory Nisbet <gregorynisbet@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
The previous logging output didn't show which commits were actually
being cherry-picked. Here's what it used to look like:
Will cherrypick 'refs/remotes/origin/main' .. <hash> on top of <hash>.
Where it's unclear what commit `main` refers to. This changes logging
to 1. show the actual commit hash for `main`, and 2. display a list
of picked commits. The new output:
Will cherrypick <hash> .. <hash> on top of <hash>:
<git log --oneline output>
Bug: 407795715
Change-Id: I45341fed65f692a9e1d7d7b807bd40680bf162b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6424742
Commit-Queue: Tony Seaward <seawardt@google.com>
Auto-Submit: Jakob Linke <jgruber@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Tony Seaward <seawardt@google.com>
In particular, when we enable new auth by default, one of the tests
that uses gclient to clone a local directory fails.
Bug: 404613530
Change-Id: I1bd41da2a3aba6f92cc3d5d9c75ab4d8fc293f22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6426441
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Attempt to update the README.chromium file with the new submodule
revision after rolling it in a DEPS update. This update is flag-guarded
and will only run when explicitly specified.
Currently, only README.chromium files with a single "Revision:" line are
supported. Multiple lines and files with the divider are not handled.
These are left as future TODOs.
Bug: 390067679
Change-Id: Ib776564ae94360cc72dd633fc7ed7b3f84b5b9d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6173767
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Jordan Brown <rop@google.com>
Reviewed-by: Jiewei Qian <qjw@chromium.org>
This will reduce confusion with the tools, gsutil.py will now take into
account supplied boto config outside of authentication (such as proxy
settings).
If the user is not logged in with luci-auth, the users configured .boto
config (including auth if configured) will still be taken into account
by the regular gsutil (not gsutil.py!) command.
Bug:b/342261857
Change-Id: I369489db60c46c13cbe9fd93d15c9597a525feb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6414748
Commit-Queue: Dan Le Febvre <dlf@google.com>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Some builders use env:DEPOT_TOOLS_WIN_TOOLCHAIN_ROOT to
specify shared builder cache on bot, which is out side
of builder's workspace, so we needed to set RBE_exec_root
to common ancestor dir above for reclient.
This CL sets up a directory junction in win_toolchain
(default location) to toolchain dir if specified by
`--toolchain-dir` or env:DEPOT_TOOLS_WIN_TOOLCHAIN_ROOT,
download win toolchain in the toolchain dir,
and use default location path for win toolchain,
so win toolchain can be available under normal exec root.
Bug: 397786479, 313567009
Change-Id: Ia39ce9e40f477f71e70036ed47c4b61c29626718
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6288233
Reviewed-by: Junji Watanabe <jwata@google.com>
Commit-Queue: Fumitoshi Ukai <ukai@google.com>
Reviewed-by: Andy Perelson <ajp@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Philipp Wollermann <philwo@google.com>
I think the latest Git version changed this behavior.
Change-Id: Id10c3ec41daf4e6700fc8168373cae9482502231
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6422996
Commit-Queue: Allen Li <ayatane@chromium.org>
Feels: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>