Merge branch 'stable-3.0' into stable-3.1

* stable-3.0:
  UrlFormatter: Fix Javadoc of getSettingsUrl()
  Add a separator between blame and the edit icon
  Remove target=_self from commentlinks
  Update .mailmap
  ReceiveCommits: Factor repeated "internal server error" text to a constant
  Update .mailmap
  Documentation: Add site-path arg to reindex command
  Isolate log4j dep
  Update .mailmap
  Cancel deprecation of change identifiers
  FakeGroupAuditService: Make auditEvents final
  ErrorProne: Increase severity of MutableConstantField to ERROR
  ConfigUpdatedEvent: Use immutable type in field declaration
  Add missing slf4j dependencies in BUILD file
  JGitMetricModule: fix WindowCache miss ration which wasn't reported
  Revert "JGitMetricModule: Replace anonymous Supplier instances with method references"
  Suppress generic logging on docker start for ElasticSearch container
  Replace deprecated OptionParser with ArgumentParser
  Documentation: Replace plugins list with home page

Change-Id: Idae7755cb887a8df60028a96fff0a01d5d637f8a
This commit is contained in:
David Pursehouse
2020-03-01 17:21:02 +09:00
34 changed files with 288 additions and 898 deletions

View File

@@ -242,6 +242,7 @@ class ReceiveCommits {
private static final String CANNOT_DELETE_CHANGES = "Cannot delete from '" + REFS_CHANGES + "'";
private static final String CANNOT_DELETE_CONFIG =
"Cannot delete project configuration from '" + RefNames.REFS_CONFIG + "'";
private static final String INTERNAL_SERVER_ERROR = "internal server error";
interface Factory {
ReceiveCommits create(
@@ -582,7 +583,7 @@ class ReceiveCommits {
commands =
commands.stream().map(c -> wrapReceiveCommand(c, commandProgress)).collect(toList());
processCommandsUnsafe(commands, progress);
rejectRemaining(commands, "internal server error");
rejectRemaining(commands, INTERNAL_SERVER_ERROR);
// This sends error messages before the 'done' string of the progress monitor is sent.
// Currently, the test framework relies on this ordering to understand if pushes completed
@@ -710,7 +711,7 @@ class ReceiveCommits {
logger.atFine().log("Added %d additional ref updates", added);
bu.execute();
} catch (UpdateException | RestApiException e) {
rejectRemaining(cmds, "internal server error");
rejectRemaining(cmds, INTERNAL_SERVER_ERROR);
logger.atFine().withCause(e).log("update failed:");
}
@@ -946,7 +947,7 @@ class ReceiveCommits {
} catch (RestApiException | IOException e) {
logger.atSevere().withCause(e).log(
"Can't insert change/patch set for %s", project.getName());
reject(magicBranchCmd, "internal server error: " + e.getMessage());
reject(magicBranchCmd, String.format("%s: %s", INTERNAL_SERVER_ERROR, e.getMessage()));
}
if (magicBranch != null && magicBranch.submit) {
@@ -1886,7 +1887,7 @@ class ReceiveCommits {
} catch (IOException e) {
logger.atWarning().withCause(e).log(
"Project %s cannot read %s", project.getName(), id.name());
reject(cmd, "internal server error");
reject(cmd, INTERNAL_SERVER_ERROR);
return;
}
}
@@ -1912,7 +1913,7 @@ class ReceiveCommits {
} catch (IOException ex) {
logger.atWarning().withCause(ex).log(
"Error walking to %s in project %s", destBranch, project.getName());
reject(cmd, "internal server error");
reject(cmd, INTERNAL_SERVER_ERROR);
return;
}
@@ -2329,7 +2330,7 @@ class ReceiveCommits {
logger.atFine().log("Finished updating groups from GroupCollector");
} catch (StorageException e) {
logger.atSevere().withCause(e).log("Error collecting groups for changes");
reject(magicBranch.cmd, "internal server error");
reject(magicBranch.cmd, INTERNAL_SERVER_ERROR);
}
return newChanges;
}
@@ -2652,11 +2653,11 @@ class ReceiveCommits {
} catch (StorageException err) {
logger.atSevere().withCause(err).log(
"Cannot read database before replacement for project %s", project.getName());
rejectRemainingRequests(replaceByChange.values(), "internal server error");
rejectRemainingRequests(replaceByChange.values(), INTERNAL_SERVER_ERROR);
} catch (IOException | PermissionBackendException err) {
logger.atSevere().withCause(err).log(
"Cannot read repository before replacement for project %s", project.getName());
rejectRemainingRequests(replaceByChange.values(), "internal server error");
rejectRemainingRequests(replaceByChange.values(), INTERNAL_SERVER_ERROR);
}
logger.atFine().log("Read %d changes to replace", replaceByChange.size());