New issue
Advanced search Search tips

Issue 665164 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

`git cl patch` for Rietveld issue fails for Gerrit-default repos

Project Member Reported by stip@chromium.org, Nov 14 2016

Issue description

I am trying to reapply https://codereview.chromium.org/2486923002/ to my local checkout so I can make changes and reland (it was reverted). However, when I try to do this:

> depot-tools-auth info codereview.chromium.org
Logged in to codereview.chromium.org as stip@chromium.org.

To login with a different email run:
  depot-tools-auth login codereview.chromium.org
To logout and purge the authentication token run:
  depot-tools-auth logout codereview.chromium.org

> git cl patch https://codereview.chromium.org/2486923002
issue 2486923002 at https://codereview.chromium.org does not exist or you have no access to it


I tried marking the issue as open again but that didn't seem to help. My guess is this has something to do with the gerrit transition?
 

Comment 1 by aga...@chromium.org, Nov 14 2016

Yeah, this is pretty straight forward. When you run "git cl patch", if your branch already has branch-specific configuration for Gerrit or Rietveld, it'll use the appropriate system to download the patch.

If you don't (which is the default case for a new branch), then it defaults to the one that it reads out of codereview.settings, which now specified Gerrit.

Unfortunately, Gerrit and Rietveld URLs (without whitelisting specific hosts) look very similar, so it things that codereview.chromium.org is a Gerrit host, tries to use the Gerrit API, and fails.

Not sure whether the best solution is to git "git cl patch" --gerrit/--rietveld flags, or to make both implementations fall back to the other impl, or to hoist them both up to the parent class impl which could then try each in sequence.

Comment 2 by aga...@chromium.org, Nov 14 2016

Summary: `git cl patch` for Rietveld issue fails for Gerrit-default repos (was: `git cl patch` not patching in committed CL)

Comment 3 by aga...@chromium.org, Nov 14 2016

Cc: tandrii@chromium.org
Components: -Infra>Codereview Infra>Codereview>Gerrit Infra>SDK
Labels: -Restrict-View-Google Milestone-Dogfood Proj-Gerrit-Migration OS-All Pri-2 Type-Bug
Status: Available (was: Untriaged)
I'd say use --rietveld very short term OR copy-paste URL with patchset number in it, this is unique enough to Rietveld and it definitely used to work before.

Medium term - maybe have special case for 3 typical urls:
codereview.chromium.org
codereview.webrtc.org
codereview.appspot.com
s.t. they are treated as if they were Rietveld.

and long term Rietveld is no longer supported :)

Comment 5 by aga...@chromium.org, Nov 14 2016

The point is that using the URL doesn't work, because we don't whitelist Rietveld hosts. We *could* (as you suggest), but note that we'd also have to whitelist internal Rietveld hosts.
I don't see a problem in whitelisting internal Rietveld hosts, it's not like the domain names are private anyway :)

Comment 7 by aga...@chromium.org, Nov 22 2016

 Issue 667341  has been merged into this issue.

Comment 8 by aga...@chromium.org, Nov 22 2016

Issue 667927 has been merged into this issue.

Comment 9 by aga...@chromium.org, Nov 29 2016

Cc: dsinclair@chromium.org och...@chromium.org
Owner: tandrii@chromium.org
Status: Fixed (was: Available)
As of https://chromium.googlesource.com/chromium/tools/depot_tools/+/c2786d933bb6517a88ba6ff95e1606f656d89178, "git cl patch --gerrit <url>" works, as does "git cl patch --rietveld <url>".

Since the flag exists, I have no plans to whitelist specific hosts. Just use the flag.

Sign in to add a comment