Hack in HTTP URL to always be available on changes
The {android-review,gerrit-review}.googlesource.com servers have a
weird failure condition where draft changes do not make available
the PULL, CHECKOUT, or CHERRY_PICK options on a patch set because
the change is not yet visible to anonymous users. This leaves the
change owner with only a "repo download" link, which is useless
for Gerrit development itself.
The root cause is these servers don't really have user names for
end users... for reasons I won't get into in this commit message.
Work around the problem by detecting a condition that only exists on
the {android-review,gerrit-review} environment and showing the HTTP
URL no matter what. The condition is gerrit.gitHttpUrl exists, and
AuthType is CUSTOM_EXTENSION. These servers are the only known uses
of CUSTOM_EXTENSION, as implementing such a backend is extremely
non-trivial.
While we are providing this hack, also hide the username field in
the contexts that it shows up empty. Showing an empty box the user
cannot edit doesn't help anyone on these sites.
Eventually this hack can be backed out when we get moved over to
authentication backends being fully supported through the new plugin
system. But we aren't there yet, and won't be for several months
(due to the amount of refactoring and schema changes involved to
make that possible). So hack the UI for now.
Change-Id: I1b30c4dec4cdf9f6726d7b966f7608b26b59a069
4 files changed