32449 Commits

Author SHA1 Message Date
Janet Davies
0c1a621540 Copy edits to dev-readme.txt, install.txt, and linux-quickstart.txt
Change-Id: Ifdd4cee178a70f216bfae5106d1ef92fad7d32d1
2018-05-31 19:49:48 +00:00
Wyatt Allen
49b63e0313 Merge "Use --primary-text-color in account dropdown" 2018-05-17 16:45:49 +00:00
Edwin Kempin
f58d87f08d ldap.Helper: Use local logger and make logger in LdapRealm private
Loggers should not be shared between classes.

Change-Id: I043df22de41b00afa93e1c1596b19576d2a3c3dc
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-17 08:18:13 +02:00
Edwin Kempin
a08ef9acbe Remove ValidationError#createLoggerSink to avoid passing around loggers
Passing loggers between classes is bad and we should avoid this if
possible.

ValidationError#createLoggerSink required to pass in a logger just to
return it back to the caller wrapped in a lambda. Remove this method and
instead create the lambda directly in the caller. This brings us minimal
code duplication for formatting the message, but it's better than
passing the logger around.

Change-Id: I6b475de50fb2a1745c16ac424e0a95d358aaaf7d
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-17 08:09:09 +02:00
Edwin Kempin
84b82dadcf LdapLoginServlet: Improve exception handling
* Handle AuthenticationFailedException separately:
  This exception is a subclass of AccountException that is thrown if the
  user provides wrong credentials. For this exception we want to return
  "Invalid username or password." as message to the client.
* Return a more general message for other AccountExceptions:
  Likely they are not caused by invalid username or password since this
  would cause a AuthenticationFailedException which we handle before.
* Increase log level to warning:
  This is the log level that we use for these exceptions in other places
  (e.g. ProjectBasicAuthFilter). Make it consistent.
* Log the stacktrace for AccountExceptions:
  We do this everywhere else (e.g. ProjectBasicAuthFilter,
  HttpLoginServlet). Make it consistent.

Change-Id: Ie34687d087b5a6cd102bf8cebd0f9830f54c9c1c
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-17 08:05:39 +02:00
Edwin Kempin
55ece33377 OperatingSystemMXBeanProvider: Log exception for ReflectiveOperationException
Having the stacktrace when debugging this seems to be useful.

Change-Id: Ifa298ffb74eabdf0c6522c9831c533dd2ebd02eb
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-17 08:01:07 +02:00
David Pursehouse
e4d8b24178 Merge "VersionedAccountDestinations: Remove unused createSink(String) method" 2018-05-17 01:28:40 +00:00
David Pursehouse
cbf5f573b0 Merge "ProjectBasicAuthFilter: Add comment why cause is not logged" 2018-05-17 01:27:52 +00:00
David Pursehouse
f12685793d Merge "BazelBuild: Fix exception message when command was interrupted" 2018-05-17 01:25:11 +00:00
David Pursehouse
dbf0f812bd Merge changes I038a0d8b,I52302be3
* changes:
  GitwebServlet: Write only one log entry for CGI errors
  GitwebServlet: Log unexpected errors on error level
2018-05-17 01:24:15 +00:00
David Pursehouse
5a59b3d45c Merge changes I98f0da6b,I82c210fe
* changes:
  PostGpgKeys: Remove unneeded use of Joiner
  Remove some logs for errors that are rethrown
2018-05-17 01:23:01 +00:00
David Pursehouse
2263777f59 Merge changes I1530106d,Ic67a9df6
* changes:
  Truth: Move export to runtime_deps
  Move Truth rules to a subdirectory of lib
2018-05-17 01:19:23 +00:00
Kasper Nilsson
d55164c437 Merge "Fix inline diff expansion and reviewed state" 2018-05-16 23:46:44 +00:00
Kasper Nilsson
c22828a0e2 Fix inline diff expansion and reviewed state
Previously, expanding an inline diff toggled the reviewed state for that
file. This is wrong -- expanding the diff should just mark the file as
reviewed, not unreviewed.

Change-Id: I5533a3f286fbd2db2b9437f4cbf4fa546d347304
2018-05-16 16:05:22 -07:00
Wyatt Allen
a087a008a5 Merge changes from topic "issue8324"
* changes:
  Update _fetchSharedCacheURL to accept Defs.FetchJSONRequest
  Refactor optional _getChangeURLAndFetch arguments to objects
  Refactor optional JSON fetch arguments to objects
  Make _fetchJSON method private
2018-05-16 23:02:16 +00:00
Wyatt Allen
cc3181af94 Update _fetchSharedCacheURL to accept Defs.FetchJSONRequest
The _fetchSharedCacheURL is updated to accept Defs.FetchJSONRequest
parameters just like its underlying fetch utility methods.

Feature: Issue 8324
Change-Id: Ia087ee6daadf3ae5d20f4ddad80131895d17191c
2018-05-16 15:26:35 -07:00
Wyatt Allen
366cd4fe7a Refactor optional _getChangeURLAndFetch arguments to objects
The _getChangeURLAndFetch method took many optional arguments, making
call sites difficult to read and making the method difficult to make
changes to.

Refactor the optional arguments into an object with optional properties.
The new Defs.ChangeFetchRequest ensures that the objects are well-typed
and call sites are updated as well as tests.

Feature: Issue 8324
Change-Id: Icc1265613d84008a794670d3730136b1ade047f5
2018-05-16 15:26:22 -07:00
Wyatt Allen
a57c8c53ac Refactor optional JSON fetch arguments to objects
Two utility methods in the REST API interface for fetching JSON (named
_fetchJSON and _fetchRawJSON) took many optional arguments. This made
call sites difficult to read optional parameters would tend to spread
upwards to higher-level methods that use them.

Refactor the argument lists of these two methods into objects with
optional properties. The Defs.FetchJSONRequest typedef ensures that the
objects are well-typed. The utility method call sites and tests are
updated.

Feature: Issue 8324
Change-Id: I7e4cd242d961629b08b046a9d05469c09f6053bf
2018-05-16 15:26:05 -07:00
viktard
68e7939e32 Merge "Report low FPS to analytics" 2018-05-16 21:48:11 +00:00
Dave Borowitz
1f0e48a727 Truth: Move export to runtime_deps
There is no good reason why depending on //lib/truth should free
downstream libraries from needing a direct dep on //lib/guava or
//lib/junit. Exporting the deps was probably just oversight, since the
distinction between exports and runtime_deps in WORKSPACE is not
obvious, and there are probably other bad examples.

Change-Id: I1530106d642167eaa25222cc95c3996478728e15
2018-05-16 14:20:06 -07:00
Dave Borowitz
94fd307693 Move Truth rules to a subdirectory of lib
The list of supported Truth extensions is only going to grow.

Change-Id: Ic67a9df6a7548d964fc10b13c10b6db1c96e514e
2018-05-16 14:20:06 -07:00
Viktar Donich
f0f3b29142 Report low FPS to analytics
Change-Id: I43e90294b16b48f717cfa7eaca18fec7c0bb488d
2018-05-16 11:25:42 -07:00
Wyatt Allen
31c377f420 Merge "Estimate render times for file list rows" 2018-05-16 18:06:58 +00:00
Wyatt Allen
b6b2dde9a7 Make _fetchJSON method private
The _fetchJSON method is an internal utility to the REST API interface
and isn't used outside of it. Rename the method to mark it as private.

Change-Id: Ic9f860f0d9d555f6995b7154525416ee7a1f6bd8
2018-05-16 09:43:36 -07:00
Maxime Guerreiro
b6567d66a6 Merge "Remove unused field from PostReviewers" 2018-05-16 16:04:56 +00:00
Dave Borowitz
18893494a6 Merge "Upgrade guava to 25.0-jre" 2018-05-16 15:06:29 +00:00
Edwin Kempin
06260e30b9 PostGpgKeys: Remove unneeded use of Joiner
We can just rely on the toString formatting of the List. This makes the
code more readable.

Change-Id: I98f0da6b5180198b9fcf0e45271e12e9ab182a52
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-16 16:38:33 +02:00
Maxime Guerreiro
8e3506de88 Remove unused field from PostReviewers
This field is no more used as of I67b72b591e and can safely be removed.

Change-Id: I264efc1ba27f5de0b50f01b64c3b8c2245d4bfe5
2018-05-16 14:34:46 +00:00
Edwin Kempin
3a9e55643a Remove some logs for errors that are rethrown
"log and throw" is considered a poor practice. The logging is uneeded
since the thrown exception will be logged somewhere else.

Change-Id: I82c210fe1e053a4ffd7a58b7fc7de6056f9875a7
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-16 16:34:27 +02:00
Edwin Kempin
f639651d7b ProjectBasicAuthFilter: Add comment why cause is not logged
Change-Id: I5c738557f50034a8ed0bff3af750e698d7c52604
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-16 16:00:59 +02:00
Edwin Kempin
2fb8940847 VersionedAccountDestinations: Remove unused createSink(String) method
Change-Id: I914c263e2f2855c6278887d23a6c582d6ee7b8ef
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-16 15:20:16 +02:00
Edwin Kempin
fd85009805 GitwebServlet: Write only one log entry for CGI errors
If a separate log statement is written for each line then the entries in
the log file can be interleaved with log entries from other threads,
which makes them less readable.

Change-Id: I038a0d8bc906746cc23b8f3bfb31d6c4d98b53c0
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-16 15:07:57 +02:00
Edwin Kempin
588bd2fa37 GitwebServlet: Log unexpected errors on error level
Especially it's seems odd that copyStderrToLog logs the input on error
level but failing to do so results only in a debug log.

Change-Id: I52302be34e8f4a62639015acffe26d0a11a5c8da
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-16 15:07:46 +02:00
Edwin Kempin
722e4b5c6c BazelBuild: Fix exception message when command was interrupted
We used ProcessBuilder#toString() but ProcessBuilder doesn't implement
the toString() method, hence calling toString() would return the
instance identity (e.g. 'java.lang.ProcessBuilder@4488aabb'). Instead
include the command which is more useful.

This issue was detected by ErrorProne.

Change-Id: I780f21bbfeae8e7c1b3f4467d789bcf148293324
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-16 14:43:38 +02:00
Maxime Guerreiro
f63da8a34e Merge changes I0e7d06be,I9b7bd67c
* changes:
  Return PrivateInternals_DynamicMapImpl from DynamicMap#emptyMap
  Cleanup Dynamic{Map,Set}-related classes
2018-05-16 11:45:04 +00:00
xchangcheng
bf63b21a61 Merge changes I67b72b59,I9ef30fb3
* changes:
  PostReviewers: call #absentUser when the user is absent
  Add #absentUser() to ForProject, ForRef and ForChange
2018-05-16 11:00:41 +00:00
Changcheng Xiao
6030942ce8 PostReviewers: call #absentUser when the user is absent
Change-Id: I67b72b591e01a3aa5fbb9cee773a6bdbcbb73de7
2018-05-16 09:55:30 +00:00
Changcheng Xiao
2b2a99e538 Add #absentUser() to ForProject, ForRef and ForChange
We used to think adding this method to the top level is enough
and could avoid misuses. But it turns out we still need them in
other permission backend classes so that we only need to rescope
a user when necessary, which could provide better performance.
See I67b72b59 as an example.

Change-Id: I9ef30fb38315250fa63fb8b3d27e19e19d5e3e22
2018-05-16 10:50:19 +02:00
Edwin Kempin
207e738cc9 ExternalId: Document that scheme and id must not contain any colon
A colon is used as separator between the scheme and id. The logic in
ExternalId.Key#parse(String) that parses an external ID string looks for
the first occurrance of a colon to split the string. This means the
scheme must not contain any colon. Since a scheme is optional also the
id must not contain any colon.

We can't enforce this since internally at Google we violate this
assumption, but we also have our own parse logic and don't rely on the
parse logic in ExternalId.Key#parse(String).

Change-Id: I9a20776c6546eb09562f3da8f8e41506a74ba1e1
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-16 10:00:08 +02:00
Edwin Kempin
0f15807a71 ExternalId: Mark plainPassword as Nullable
Change-Id: I1de32d42efa497c0e6401f04c81d16d88407e97a
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-05-16 09:54:02 +02:00
Dave Borowitz
43d5d849d4 Merge "Upgrade JUnit to 4.12" 2018-05-16 05:33:09 +00:00
David Pursehouse
2282009878 Upgrade guava to 25.0-jre
Change-Id: I1c3f1049b19db76177d7d3e5d12da9ee06e33a86
2018-05-16 12:57:10 +09:00
David Pursehouse
4805d07d8b Merge "SerializedClassSubject: Work around Eclipse compiler bug" 2018-05-16 02:15:47 +00:00
David Pursehouse
9fb396adc6 Merge "Merge branch 'stable-2.15'" 2018-05-16 02:11:37 +00:00
Dave Borowitz
ce5b9e67db SerializedClassSubject: Work around Eclipse compiler bug
Change-Id: I72434df1e827b4fb3d22b82624851897b1937364
2018-05-15 18:12:31 -07:00
Dave Borowitz
02a9d408a1 Merge "Update Truth to 0.40" 2018-05-16 01:11:53 +00:00
David Pursehouse
556ee027ef Merge branch 'stable-2.15'
* stable-2.15:
  Update Eclipse compiler settings with Oxygen.3a Release (4.7.3a)
  Introduce mechanism to overload Gerrit core modules
  Move default memory cache implementation out of H2 package
  Introduce CacheImpl annotation
  Untangle persistent/memory cache implementations from each other
  H2CacheFactory: update internal caches list synchronously

Change-Id: I4331a1b9e2f4fe4a2a1d9e6c4bac6bdc2d09dcab
2018-05-16 10:11:35 +09:00
Wyatt Allen
5e62033393 Estimate render times for file list rows
Detect file list row template instantiation via a binding to find the
time that the last file in the list is shown. This allows for
approximation of the overall render time for the list.

Change-Id: I9090ed4e65f1b8751696d1d9cffcd815f2686359
2018-05-15 17:40:54 -07:00
Dave Borowitz
12df29f20d Fix field name of OAuthTokenProto.provider_id
This is a trivial proto change which doesn't even affect the generated
code.

Change-Id: I823054400ce068102443a1f6bc3d9ea175642b72
2018-05-15 16:38:04 -07:00
David Pursehouse
6ae012e010 Merge branch 'stable-2.14' into stable-2.15
* stable-2.14:
  Update Eclipse compiler settings with Oxygen.3a Release (4.7.3a)
  Introduce mechanism to overload Gerrit core modules
  Move default memory cache implementation out of H2 package
  Introduce CacheImpl annotation
  Untangle persistent/memory cache implementations from each other
  H2CacheFactory: update internal caches list synchronously

Change-Id: I6c0952771b4e630a6628355f8cb2972ab7d12419
2018-05-16 08:15:29 +09:00