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>
Try LUCI Auth before using an existing BOTO config. If a
.BOTO config is used, warn on it and ask the user to try luci-auth
method next time.
http://crrev/c/6397035 also includes the GSUtil section in case anyone
is using it.
Bug:b/342261857
Change-Id: I79669926e956112faff45068b3cd822cf28a2385
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6396595
Reviewed-by: Scott Lee <ddoman@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Dan Le Febvre <dlf@google.com>
- 59b81c84ded4e2312b2b554d22a51dca89825bc3 launcher: change collections.namedtuple to typing.NamedTu... by Mike Frysinger <vapier@google.com>
GitOrigin-RevId: 59b81c84ded4e2312b2b554d22a51dca89825bc3
Change-Id: Iadd0af8c670917eb4cd418b7f7184ee819ea9d2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6410153
Auto-Submit: Copybara Service <copybara-worker-blackhole@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
The existing licence regex assumed each line would start with an unknown
and optional comment delimiter, followed by a required space. However
the standard way to write the licence in XML files uses a multi-line
comment, each individual line simply starts with the licence text, no
delimiter or space. The license check thus needed to be updated to make
the space optional as well.
Bug: 407060754
Change-Id: I4a83dd9408de890593952e441ba6b650f726907c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6409392
Commit-Queue: Sky Malice <skym@chromium.org>
Reviewed-by: Andy Perelson <ajp@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
`python-bin/python3` sets the depot_tool's Python binary dir to PATH.
This allows build steps to use the bundled Python, so that the Python version can be aligned with what the infra uses.
Note that autoninja.bat already uses the bundled Python.
Change-Id: I9350859bcc5bd0ed59f2f00be8e5615d89281daa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6395717
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Junji Watanabe <jwata@google.com>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Auto-Submit: Junji Watanabe <jwata@google.com>
This will print a warning and disable new auth if .gitcookies file
exists.
This ensures we don't break bots once we default new auth on while
pushing human users away from .gitcookies.
Bug: b/404613530
Change-Id: Ia2d05bb7e5d2bf11e5605a26ef492954acbd9833
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6367723
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>