Commit Graph

45 Commits (488ad9dd221f3345b2afb29c0ce3c7fe27c1ef7c)

Author SHA1 Message Date
Joey Scarr 57dfc366b7 Revert "[git_auth] Configure common -review hosts also"
This reverts commit 39e269dabf.

Reason for revert: Breaks git cl upload via SSO

Bug: 421831933
Original change's description:
> [git_auth] Configure common -review hosts also
>
> Seems like ChromeOS workflows with repo force these URLs.  While the
> repo instructions technically tell users to set this up separately,
> config them here too so I don't get bug reports.
>
> Bug: 421831933
> Change-Id: Ie33c678de3a6d2dadd6663ad6e0e97e9086d6129
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6614517
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Allen Li <ayatane@chromium.org>

Bug: 421831933
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I76a981ff50bc1b9e18c82223e23d891b89917924
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6615841
Auto-Submit: Joey Scarr <jsca@google.com>
Owners-Override: Joey Scarr <jsca@google.com>
Commit-Queue: Joey Scarr <jsca@google.com>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
4 weeks ago
Allen Li 39e269dabf [git_auth] Configure common -review hosts also
Seems like ChromeOS workflows with repo force these URLs.  While the
repo instructions technically tell users to set this up separately,
config them here too so I don't get bug reports.

Bug: 421831933
Change-Id: Ie33c678de3a6d2dadd6663ad6e0e97e9086d6129
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6614517
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
4 weeks ago
Mike Frysinger 2b62f95de3 git_auth: fix ~/ handling in http.cookiefile
Change-Id: Ifa9505477fa1e1e717e1a499f5200f8840d7be50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6597961
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
4 weeks ago
Allen Li f55de362c1 [git_auth] Check and fix auth on GCE
Bug: 410713357
Change-Id: I6d39641451d78c192321b77477a5e0f741715f85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6485110
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
2 months ago
Allen Li 1fb0e39429 [git_auth] Add short blurb with manual setup instructions
Might be useful for some folks, try adding this.

Bug: 410825515
Change-Id: I367298b8276758c25167aa520556fb63a175127f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6459926
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
2 months ago
Allen Li 5d5475cdee [git_auth] Minor wording consistency fix
Make it consistent with the other line that uses "yet"

Change-Id: I6cae354b61ac673bb4d93a878daf01cebbf67a0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6459922
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
2 months ago
Allen Li d28539d200 [git_auth] Move gitcookies to free backup name
Bug: 410576093
Change-Id: Ib2d9db97f4e4e1e8cfe1914ba7ffb881f9e16bbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6453918
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
2 months ago
Allen Li 9d75b76ca5 [git_auth] Clarify which email to use
Change-Id: Ic17568c3b6fd35772b3c7d5c9db8e62e207fb7fc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6456193
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
2 months ago
Allen Li c92c5fbe99 [git_auth] Always configure chrome-internal
Most users who access this have SSO, but there are some people with,
e.g., read access without SSO.

So we may as well configure this always I guess, even if it's
nonfunctional for many people since they have no permission to any
repos on chrome-internal.

Change-Id: Ia560a64e7771f1438fb1527389a310bbbe951477
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6456192
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
2 months ago
Allen Li 0aa5b44d94 [git_auth] Hint users to run with --global
Some users just run creds-check which doesn't fix submodules.

Bug: 408501013
Change-Id: Iddb19e922aff8cb265638588595403ac193ead52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6449740
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
2 months ago
Allen Li 0a7f853f9d [git_auth] Split repo configuring into standalone method
Refactoring to enable running this logic recursively on submodules.

Change-Id: I3515d1659e1b619d262a62be91f0fe835f6df0d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6448584
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
2 months ago
Allen Li f3a8e0a209 [git_auth] Add _run_gerrit_host_configuration helper
Refactoring to improve readability

Change-Id: I159565840f7c869d47a70beb22000d01c6279a1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6448580
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
2 months ago
Allen Li 3b66d05bd8 [git_auth] Inject Changelist dependency into ConfigWizard
Otherwise it creates a dependency cycle.  This is needed if we want to
recurse into submodules.  Maybe this should be refactored more, but
this should be an improvement for now.

Change-Id: I4641e9ce1952bba81f717acbeefd59dd687d87ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6448579
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
2 months ago
Allen Li 68e296445e [git_auth] Pause before configuring common hosts
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>
3 months ago
Allen Li f5b53c0e98 [git_cl] Add --global to creds-check
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>
3 months ago
Allen Li 07d24776f2 [git_auth] Emphasize success
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>
3 months ago
Allen Li c65a345b10 [git_auth] Improve login instruction wording
Quick minor improvement based on user feedback.

Bug: 408225524
Change-Id: I51029dd97cb64a4b35ccd385d2af95ba1200bd25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6440070
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
3 months ago
Allen Li 3f00993a55 [git_cl] Explain SSO check
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>
3 months ago
Allen Li 321b0e6b99 [git_auth] Add guard against bad URLs
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>
3 months ago
Allen Li e32bcc7be0 [git_auth] Print empty line after all read input
Small UX improvement

Bug: 404613530
Change-Id: Ie1cb79279a41cd80f1992e2e18107d4a15e16edb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6418884
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
3 months ago
Allen Li a2c6f107c3 [git_auth] Move config wizard to creds-check
Bug: b/404613530
Change-Id: Ie0b8fd675b66739a129d5eeeda895473a8a49eeb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6368999
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
3 months ago
Allen Li 428ceb6428 [git_auth] Add extra info about OAuth setup
Change-Id: I145d18dbddee27b8655005c789191b3c524f0710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6367722
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
3 months ago
Allen Li a0d13c9549 [git_auth] Use pathless URL for cred helper
The credential helper rules should not have a path, while the URL
rewrite rules should.

Reland of I79b52ab4af62367363617b2a9afa03a67f5ea0b9

Bug: b/401338175
Bug: b/403635929
Change-Id: Ib89d9e855ca5eba29cc67f8846bb7ca0cb3622ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6363080
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
3 months ago
Allen Li 8fecc592a2 Add auth config wizard
Make this available for testing first.

This should be functionally roughly analogous with the current auto
configuration logic, and it prints all actions it performs so it
should be pretty safe to play with, even if it hypothetically
misbehaves.

Bug: b/401338175
Change-Id: I803c7e167e355ec8cca1f5959099138c2fee305e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6334614
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
3 months ago
Josip Sokcevic 948edc4382 Revert "[git_auth] Use pathless URL for cred helper"
This reverts commit ce47e785fa.

Reason for revert: fatal: --local can only be used inside a git
repository.

Original change's description:
> [git_auth] Use pathless URL for cred helper
>
> The credential helper rules should not have a path, while the URL
> rewrite rules should.
>
> Bug: b/401338175
> Change-Id: I79b52ab4af62367363617b2a9afa03a67f5ea0b9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6345631
> Commit-Queue: Allen Li <ayatane@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>

Bug: b/401338175
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Ifa887eeb7a7049665570e865431b41ac18649b90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6357165
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
3 months ago
Allen Li ce47e785fa [git_auth] Use pathless URL for cred helper
The credential helper rules should not have a path, while the URL
rewrite rules should.

Bug: b/401338175
Change-Id: I79b52ab4af62367363617b2a9afa03a67f5ea0b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6345631
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
3 months ago
Allen Li 0445e00a08 [git_auth] Add _url_shortname helper
Breaking out independent chunks from a larger CL

Bug: b/401338175
Change-Id: I0b439596fb613355cb33b4b1d2a0481489d7c0c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6345630
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
4 months ago
Josip Sokcevic f61e11c19f roll_dep_test: fix tests
This partially reverts commit 1221440015.

Change-Id: Ib2e9d41b3871004376a952e643e13a7e67eb750e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6340427
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Allen Li <ayatane@chromium.org>
4 months ago
Allen Li 877b1e3cbd [auth] Hide global SSO rewrite in local repo
If the user uses SSO (and thus has SSO rewrite rules) for their global
config, a repo which locally uses an email that doesn't use SSO needs
an override.

Bug: b/390219533
Change-Id: I639dae4c1a45bbd2c17180855c22260979b0dbc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6177780
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
5 months ago
Allen Li 522f5a4bd1 gerrit_util: Use git-credential-luci instead of luci-auth
git-credential-luci is very similar to luci-auth, except that it is
expressly for git/Gerrit.  Therefore, it hard codes the scopes needed
for git/Gerrit.  It's also a separate binary, which makes it more
convenient for us to configure it for ReAuth later.

Bug: b/382341041
Change-Id: I7de56d3922adac7eb4671849eb6e30be310d4de7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6073043
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
7 months ago
Allen Li 4b94130034 [gerrit_util] Add fallback if missing Gerrit account
Bug: b/366261039
Change-Id: I7d22c4f03ad9bd837190dee7a511af3437a30434
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5869050
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
9 months ago
Allen Li 58e0e19462 [git_auth] Remove old option cleanup
Change-Id: I426199d05613397a74aba87ad8dcbd67a0175ee7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5869051
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Allen Li <ayatane@chromium.org>
9 months ago
Allen Li a603aded9a [gclient_scm] Add new auth stack setup to gclient
Bug: b/356935829
Change-Id: Ie917f142c3fddba398a5351d685a7b131b298a76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5762791
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
11 months ago
Allen Li 2f8e1e499d [git_auth] Improve example comments
Change-Id: If82a044ef9c832d3d10bacc5a6c496d39aee6841
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5762790
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
11 months ago
Allen Li 03a5043a94 [git_auth] Remove unnecessary quotes
Not needed with future import

Change-Id: I14d56465dc42ac710b64b301928057329ac9d038
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5762789
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
11 months ago
Allen Li 7815620b1f [git_auth] Auto configure global config also
Bug: b/351071334
Change-Id: I069443a74cf7e33ce9ebea53ea3d52e272ed3570
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5740605
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
11 months ago
Allen Li be5ff1a6c4 [git_auth] Move auto configure logic
Bug: b/351071334
Change-Id: Ic6574f86208b22e406e36f8cd45a564ea74ec7f9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5742793
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago
Allen Li db74f93ff9 [git_auth] Rename configure functions
Bug: b/351071334
Change-Id: Ic0378590bd678226db2563e9180076f87dafdc66
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5739678
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
11 months ago
Allen Li 1590dceac5 [git_auth] Move auth related functions
Bug: b/351071334
Change-Id: I4f88b06011864d4412b7ff94a99dfb4f6852ba62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5739677
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago
Allen Li 3e86c1254a [git_auth] Fix type checking
Bug: b/351071334
Change-Id: Icc54c7b0b4783cea80dda9fda9ac2c7086bd14fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5742438
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago
Allen Li f58548ab8c [git_auth] Add comment about import cycle
Bug: b/351071334
Change-Id: I14aa44e81d936201c9ddf0ffc52152287ec54cad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5742789
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
11 months ago
Robert Iannucci 4903a45ccc [git_auth] Fix some bugs introduced during refactoring.
R=ayatane, dlf

Change-Id: I11371375b7f02e9ed5b67cde79ee05da6b0ba5c1
Bug: 351071334
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5740607
Commit-Queue: Allen Li <ayatane@chromium.org>
Reviewed-by: Dan Le Febvre <dlf@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
11 months ago
Allen Li 8dde9800ee [git_auth] Rename GitAuthConfigChanger
Bug: b/351071334
Change-Id: Ia12bf72bfaef11768cb60ba0631aafd5ffc9f1fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5739676
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago
Allen Li fed7aa526c [git_auth] Rename GitAuthMode
Bug: b/351071334
Change-Id: I29bfdff79e04d2df3df62019fc0c7dfd87dd302f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5739675
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago
Allen Li a61e517b45 [git_auth] Move Git auth stuff to new file
Needs to be imported by gclient

Bug: b/351071334
Change-Id: Ibcb7c5541ffab6f9302efad863d0c59b8041122d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5739296
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
11 months ago