Merge "Add @FormatMethod to StalenessCheckResult#stale"
diff --git a/Documentation/dev-crafting-changes.txt b/Documentation/dev-crafting-changes.txt
index bf4453c..eb9dee4 100644
--- a/Documentation/dev-crafting-changes.txt
+++ b/Documentation/dev-crafting-changes.txt
@@ -230,6 +230,13 @@
* Tests for new code will greatly help your change get approved.
+[[javadoc]]
+== Javadoc
+
+ * Javadocs for new code (especially public classes and
+ public/protected methods) will greatly help your change get
+ approved.
+
[[change-size]]
== Change Size/Number of Files Touched
diff --git a/java/com/google/gerrit/acceptance/GerritServer.java b/java/com/google/gerrit/acceptance/GerritServer.java
index af8af90..f90df67 100644
--- a/java/com/google/gerrit/acceptance/GerritServer.java
+++ b/java/com/google/gerrit/acceptance/GerritServer.java
@@ -269,7 +269,7 @@
private static final ImmutableMap<String, Level> LOG_LEVELS =
ImmutableMap.<String, Level>builder()
- .put("com.google.gerrit", Level.INFO)
+ .put("com.google.gerrit", getGerritLogLevel())
// Silence non-critical messages from MINA SSHD.
.put("org.apache.mina", Level.WARN)
@@ -307,6 +307,14 @@
.put("org.eclipse.jgit.util.FS", Level.WARN)
.build();
+ private static Level getGerritLogLevel() {
+ String value = Strings.nullToEmpty(System.getenv("GERRIT_LOG_LEVEL"));
+ if (value.isEmpty()) {
+ value = Strings.nullToEmpty(System.getProperty("gerrit.logLevel"));
+ }
+ return Level.toLevel(value, Level.INFO);
+ }
+
private static boolean forceLocalDisk() {
String value = Strings.nullToEmpty(System.getenv("GERRIT_FORCE_LOCAL_DISK"));
if (value.isEmpty()) {
diff --git a/java/com/google/gerrit/pgm/init/AccountsOnInit.java b/java/com/google/gerrit/pgm/init/AccountsOnInit.java
index 4ffe942..536ddcd 100644
--- a/java/com/google/gerrit/pgm/init/AccountsOnInit.java
+++ b/java/com/google/gerrit/pgm/init/AccountsOnInit.java
@@ -14,9 +14,8 @@
package com.google.gerrit.pgm.init;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkState;
import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.Objects.requireNonNull;
import com.google.gerrit.entities.Account;
import com.google.gerrit.entities.RefNames;
@@ -129,9 +128,10 @@
private File getPath() {
Path basePath = site.resolve(flags.cfg.getString("gerrit", null, "basePath"));
- checkArgument(basePath != null, "gerrit.basePath must be configured");
- File file = FileKey.resolve(basePath.resolve(allUsers).toFile(), FS.DETECTED);
- checkState(file != null, "%s does not exist", file.getAbsolutePath());
- return file;
+ requireNonNull(basePath, "gerrit.basePath must be configured");
+ File file = basePath.resolve(allUsers).toFile();
+ File resolvedFile = FileKey.resolve(file, FS.DETECTED);
+ requireNonNull(resolvedFile, () -> String.format("%s does not exist", file.getAbsolutePath()));
+ return resolvedFile;
}
}
diff --git a/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java b/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java
index 25420ee..8887e06 100644
--- a/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java
+++ b/java/com/google/gerrit/server/account/externalids/ExternalIdCacheLoader.java
@@ -71,6 +71,7 @@
private final Counter1<Boolean> reloadCounter;
private final Timer0 reloadDifferential;
private final boolean enablePartialReloads;
+ private final boolean isPersistentCache;
@Inject
ExternalIdCacheLoader(
@@ -101,6 +102,8 @@
.setUnit(Units.MILLISECONDS));
this.enablePartialReloads =
config.getBoolean("cache", ExternalIdCacheImpl.CACHE_NAME, "enablePartialReloads", true);
+ this.isPersistentCache =
+ config.getInt("cache", ExternalIdCacheImpl.CACHE_NAME, "diskLimit", 0) > 0;
}
@Override
@@ -156,8 +159,11 @@
}
}
if (oldExternalIds == null) {
- logger.atWarning().log(
- "Unable to find an old ExternalId cache state, falling back to full reload");
+ if (isPersistentCache) {
+ // If there is no persistence, this is normal. Don't upset admins reading the logs.
+ logger.atWarning().log(
+ "Unable to find an old ExternalId cache state, falling back to full reload");
+ }
return reloadAllExternalIds(notesRev);
}
diff --git a/java/com/google/gerrit/server/logging/Metadata.java b/java/com/google/gerrit/server/logging/Metadata.java
index 64d156f..d312530 100644
--- a/java/com/google/gerrit/server/logging/Metadata.java
+++ b/java/com/google/gerrit/server/logging/Metadata.java
@@ -95,9 +95,6 @@
// The version of a secondary index.
public abstract Optional<Integer> indexVersion();
- // The number of inputs to an operation, eg. Reachable.fromRefs.
- public abstract Optional<Integer> inputSize();
-
// The name of the implementation method.
public abstract Optional<String> methodName();
@@ -303,8 +300,6 @@
public abstract Builder indexVersion(int indexVersion);
- public abstract Builder inputSize(int size);
-
public abstract Builder methodName(@Nullable String methodName);
public abstract Builder multiple(boolean multiple);
diff --git a/java/com/google/gerrit/server/project/Reachable.java b/java/com/google/gerrit/server/project/Reachable.java
index c30378b..6d28646a 100644
--- a/java/com/google/gerrit/server/project/Reachable.java
+++ b/java/com/google/gerrit/server/project/Reachable.java
@@ -67,7 +67,7 @@
try (TraceTimer timer =
TraceContext.newTimer(
"IncludedInResolver.includedInAny",
- Metadata.builder().projectName(project.get()).inputSize(refs.size()).build())) {
+ Metadata.builder().projectName(project.get()).resourceCount(refs.size()).build())) {
return IncludedInResolver.includedInAny(repo, rw, commit, filtered.values());
}
} catch (IOException | PermissionBackendException e) {
diff --git a/java/com/google/gerrit/server/restapi/change/RevertSubmission.java b/java/com/google/gerrit/server/restapi/change/RevertSubmission.java
index 94c379b..b44bb29 100644
--- a/java/com/google/gerrit/server/restapi/change/RevertSubmission.java
+++ b/java/com/google/gerrit/server/restapi/change/RevertSubmission.java
@@ -95,11 +95,12 @@
String.format("change is %s.", ChangeUtil.status(changeResource.getChange())));
}
- String submissionId =
- requireNonNull(
- changeResource.getChange().getSubmissionId(),
- String.format("merged change %s has no submission ID", changeResource.getId()));
-
+ String submissionId = changeResource.getChange().getSubmissionId();
+ if (submissionId == null) {
+ throw new ResourceConflictException(
+ "This change is merged but doesn't have a submission id,"
+ + " meaning it was not submitted through Gerrit.");
+ }
List<ChangeData> changeDatas = queryProvider.get().bySubmissionId(submissionId);
for (ChangeData changeData : changeDatas) {
diff --git a/plugins/replication b/plugins/replication
index 4689b41..d7c09fb 160000
--- a/plugins/replication
+++ b/plugins/replication
@@ -1 +1 @@
-Subproject commit 4689b419eab61ea204daf2dfca47296667ac317c
+Subproject commit d7c09fbb4c18b1743d6060d361171c2a5237f22b
diff --git a/polygerrit-ui/app/BUILD b/polygerrit-ui/app/BUILD
index 5ff820b..3a70ac53 100644
--- a/polygerrit-ui/app/BUILD
+++ b/polygerrit-ui/app/BUILD
@@ -55,7 +55,6 @@
exclude = [
"bower_components/**",
"**/*_test.html",
- "embed/test.html",
"test/**",
"samples/**",
],
@@ -166,33 +165,6 @@
],
) for directory in DIRECTORIES]
-# Embed bundle
-polygerrit_bundle(
- name = "polygerrit_embed_ui",
- srcs = glob(
- [
- "**/*.html",
- "**/*.js",
- ],
- exclude = [
- "bower_components/**",
- "test/**",
- "**/*_test.html",
- ],
- ),
- outs = ["polygerrit_embed_ui.zip"],
- app = "embed/embed.html",
-)
-
-filegroup(
- name = "embed_test_files",
- srcs = glob(
- [
- "embed/**/*_test.html",
- ],
- ),
-)
-
filegroup(
name = "template_test_srcs",
srcs = [
@@ -200,21 +172,3 @@
"template_test_srcs/template_test.js",
],
)
-
-sh_test(
- name = "embed_test",
- size = "small",
- srcs = ["embed_test.sh"],
- data = [
- "embed/test.html",
- "test/common-test-setup.html",
- ":embed_test_files",
- ":pg_code.zip",
- ":test_components.zip",
- ],
- # Should not run sandboxed.
- tags = [
- "local",
- "manual",
- ],
-)
diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.html b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.html
index 0817762..6703651 100644
--- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.html
+++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.html
@@ -269,6 +269,25 @@
Do you really want to delete the edit?
</div>
</gr-dialog>
+ <gr-dialog
+ id="showRevertSubmissionChangesDialog"
+ class="confirmDialog"
+ confirm-label="Close"
+ cancel-label=''
+ on-confirm="_handleShowRevertSubmissionChangesConfirm">
+ <div class="header" slot="header">
+ Reverted Changes
+ </div>
+ <div class="main" slot="main">
+ <template is="dom-repeat" items="[[_revertChanges]]">
+ <div>
+ <a href$="[[item.link]]" target="_blank">
+ Change [[item._number]]
+ </a>
+ </div>
+ </template>
+ </div>
+ </gr-dialog>
</gr-overlay>
<gr-js-api-interface id="jsAPI"></gr-js-api-interface>
<gr-rest-api-interface id="restAPI"></gr-rest-api-interface>
diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js
index 2ce0d7d..8ad2a06 100644
--- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js
+++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions.js
@@ -420,6 +420,10 @@
type: Boolean,
value: true,
},
+ _revertChanges: {
+ type: Array,
+ value: [],
+ },
};
}
@@ -1258,6 +1262,7 @@
_handleResponse(action, response) {
if (!response) { return; }
return this.$.restAPI.getResponseObject(response).then(obj => {
+ let revertChanges = [];
switch (action.__key) {
case ChangeActions.REVERT:
this._waitForChangeReachable(obj._number)
@@ -1282,6 +1287,29 @@
case ChangeActions.REBASE_EDIT:
Gerrit.Nav.navigateToChange(this.change);
break;
+ case ChangeActions.REVERT_SUBMISSION:
+ revertChanges = obj.revert_changes || [];
+ revertChanges = revertChanges.map(change => {
+ change.link = '/q/' + encodeURIComponent(change.change_id);
+ return change;
+ });
+ // list of reverted changes can never be 0
+ if (revertChanges.length === 1) {
+ // redirect to the change if only 1 change is reverted
+ const change = revertChanges[0];
+ this._waitForChangeReachable(change._number).then(success => {
+ if (success) {
+ Gerrit.Nav.navigateToChange(change);
+ } else {
+ console.error('Change ' + change._number + ' not reachable');
+ }
+ });
+ } else {
+ // show multiple reverted changes in a dialog
+ this._revertChanges = revertChanges;
+ this._showActionDialog(this.$.showRevertSubmissionChangesDialog);
+ }
+ break;
default:
this.dispatchEvent(new CustomEvent('reload-change',
{detail: {action: action.__key}, bubbles: false}));
@@ -1290,6 +1318,10 @@
});
}
+ _handleShowRevertSubmissionChangesConfirm() {
+ this._hideAllDialogs();
+ }
+
_handleResponseError(action, response, body) {
if (action && action.__key === RevisionActions.CHERRYPICK) {
if (response && response.status === 409 &&
diff --git a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html
index a10f028..532c573 100644
--- a/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html
+++ b/polygerrit-ui/app/elements/change/gr-change-actions/gr-change-actions_test.html
@@ -1422,6 +1422,7 @@
let payload;
let onShowError;
let onShowAlert;
+ let getResponseObjectStub;
setup(() => {
cleanup = sinon.stub();
@@ -1437,12 +1438,18 @@
suite('happy path', () => {
let sendStub;
-
+ let waitForChangeReachableStub;
setup(() => {
sandbox.stub(element, 'fetchChangeUpdates')
.returns(Promise.resolve({isLatest: true}));
sendStub = sandbox.stub(element.$.restAPI, 'executeChangeAction')
.returns(Promise.resolve({}));
+ getResponseObjectStub = sandbox.stub(element.$.restAPI,
+ 'getResponseObject');
+ waitForChangeReachableStub = sandbox.stub(element,
+ '_waitForChangeReachable').returns(Promise.resolve(true));
+ sandbox.stub(Gerrit.Nav,
+ 'navigateToChange').returns(Promise.resolve(true));
});
test('change action', () => {
@@ -1455,6 +1462,49 @@
});
});
+ suite('single changes revert', () => {
+ setup(() => {
+ getResponseObjectStub
+ .returns(Promise.resolve({revert_changes: [
+ {change_id: 12345},
+ ]}));
+ showActionDialogStub = sandbox.stub(element, '_showActionDialog');
+ });
+
+ test('revert submission single change', done => {
+ element._send('POST', {message: 'Revert submission'},
+ '/revert_submission', false, cleanup).then(res => {
+ element._handleResponse({__key: 'revert_submission'}, {}).
+ then(() => {
+ assert.isTrue(waitForChangeReachableStub.called);
+ done();
+ });
+ });
+ });
+ });
+
+ suite('multiple changes revert', () => {
+ let showActionDialogStub;
+ setup(() => {
+ getResponseObjectStub
+ .returns(Promise.resolve({revert_changes: [
+ {change_id: 12345}, {change_id: 23456},
+ ]}));
+ showActionDialogStub = sandbox.stub(element, '_showActionDialog');
+ });
+
+ test('revert submission multiple change', done => {
+ element._send('POST', {message: 'Revert submission'},
+ '/revert_submission', false, cleanup).then(res => {
+ element._handleResponse({__key: 'revert_submission'}, {}).then(
+ () => {
+ assert.isTrue(showActionDialogStub.called);
+ done();
+ });
+ });
+ });
+ });
+
test('revision action', () => {
return element._send('DELETE', payload, '/endpoint', true, cleanup)
.then(() => {
diff --git a/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header.html b/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header.html
index fe8384e..d29858e 100644
--- a/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header.html
+++ b/polygerrit-ui/app/elements/core/gr-main-header/gr-main-header.html
@@ -90,7 +90,7 @@
}
gr-smart-search {
flex-grow: 1;
- margin-left: var(--spacing-m);
+ margin: 0 var(--spacing-m);
max-width: 500px;
}
gr-dropdown,
diff --git a/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.html b/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.html
index d7510ec..89b28d5 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.html
+++ b/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.html
@@ -58,6 +58,9 @@
#container.unresolved {
background-color: var(--unresolved-comment-background-color);
}
+ #container.robotComment {
+ background-color: var(--robot-comment-background-color);
+ }
#commentInfoContainer {
border-top: 1px dotted var(--border-color);
display: flex;
@@ -82,7 +85,7 @@
<span class="descriptionText">Patchset [[patchNum]]</span>
</div>
</template>
- <div id="container" class$="[[_computeHostClass(unresolved)]]">
+ <div id="container" class$="[[_computeHostClass(unresolved, isRobotComment)]]">
<template id="commentList" is="dom-repeat" items="[[_orderedComments]]"
as="comment">
<gr-comment
diff --git a/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.js b/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.js
index 72fc45d..8687e77 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.js
+++ b/polygerrit-ui/app/elements/shared/gr-comment-thread/gr-comment-thread.js
@@ -137,6 +137,11 @@
_lastComment: Object,
_orderedComments: Array,
_projectConfig: Object,
+ isRobotComment: {
+ type: Boolean,
+ value: false,
+ reflectToAttribute: true,
+ },
};
}
@@ -221,6 +226,7 @@
this._lastComment = this._getLastComment();
this.unresolved = this._lastComment.unresolved;
this.hasDraft = this._lastComment.__draft;
+ this.isRobotComment = !!(this._lastComment.robot_id);
}
}
@@ -498,6 +504,9 @@
}
_computeHostClass(unresolved) {
+ if (this.isRobotComment) {
+ return 'robotComment';
+ }
return unresolved ? 'unresolved' : '';
}
diff --git a/polygerrit-ui/app/embed/embed.html b/polygerrit-ui/app/embed/embed.html
deleted file mode 100644
index 64e0137..0000000
--- a/polygerrit-ui/app/embed/embed.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!--
-@license
-Copyright (C) 2017 The Android Open Source Project
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<script>
- window.Gerrit = window.Gerrit || {};
-</script>
-<link rel="import" href="/bower_components/polymer/polymer.html">
-<link rel="import" href="../elements/change/gr-change-view/gr-change-view.html">
-<link rel="import" href="../elements/core/gr-search-bar/gr-search-bar.html">
-<link rel="import" href="../elements/diff/gr-diff-view/gr-diff-view.html">
-<link rel="import" href="../elements/change-list/gr-change-list-view/gr-change-list-view.html">
-<link rel="import" href="../elements/change-list/gr-dashboard-view/gr-dashboard-view.html">
-<link rel="import" href="../elements/change-list/gr-embed-dashboard/gr-embed-dashboard.html">
-<link rel="import" href="../styles/themes/app-theme.html">
diff --git a/polygerrit-ui/app/embed/embed_test.html b/polygerrit-ui/app/embed/embed_test.html
deleted file mode 100644
index 5d81b7e..0000000
--- a/polygerrit-ui/app/embed/embed_test.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html>
-<!--
-@license
-Copyright (C) 2017 The Android Open Source Project
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-
-<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
-<title>embed_test</title>
-
-<script src="/bower_components/webcomponentsjs/custom-elements-es5-adapter.js"></script>
-
-<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
-<script src="/bower_components/web-component-tester/browser.js"></script>
-<link rel="import" href="embed.html"/>
-
-<script>void(0);</script>
-
-<test-fixture id="change-view">
- <template>
- <gr-change-view></gr-change-view>
- </template>
-</test-fixture>
-
-<test-fixture id="diff-view">
- <template>
- <gr-diff-view></gr-diff-view>
- </template>
-</test-fixture>
-
-<test-fixture id="dashboard-view">
- <template>
- <gr-dashboard-view></gr-dashboard-view>
- </template>
-</test-fixture>
-
-<test-fixture id="change-list-view">
- <template>
- <gr-change-list-view></gr-change-list-view>
- </template>
-</test-fixture>
-
-<test-fixture id="change-list">
- <template>
- <gr-change-list></gr-change-list>
- </template>
-</test-fixture>
-
-<test-fixture id="search-bar">
- <template>
- <gr-search-bar></gr-search-bar>
- </template>
-</test-fixture>
-
-<script>
- suite('embed test', () => {
- test('gr-change-view is embedded', () => {
- const element = fixture('change-view');
- assert.equal(element.tagName.toLowerCase(), 'gr-change-view');
- });
-
- test('diff-view is embedded', () => {
- const element = fixture('diff-view');
- assert.equal(element.tagName.toLowerCase(), 'gr-diff-view');
- });
-
- test('dashboard-view is embedded', () => {
- const element = fixture('dashboard-view');
- assert.equal(element.tagName.toLowerCase(), 'gr-dashboard-view');
- });
-
- test('change-list-view is embedded', () => {
- const element = fixture('change-list-view');
- assert.equal(element.tagName.toLowerCase(), 'gr-change-list-view');
- });
-
- test('change-list is embedded', () => {
- const element = fixture('change-list');
- assert.equal(element.tagName.toLowerCase(), 'gr-change-list');
- });
-
- test('search-bar is embedded', () => {
- const element = fixture('search-bar');
- assert.equal(element.tagName.toLowerCase(), 'gr-search-bar');
- });
- });
-</script>
diff --git a/polygerrit-ui/app/embed/test.html b/polygerrit-ui/app/embed/test.html
deleted file mode 100644
index 955eaee..0000000
--- a/polygerrit-ui/app/embed/test.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE html>
-<!--
-@license
-Copyright (C) 2017 The Android Open Source Project
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-
-<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
-<title>Embed Test Runner</title>
-<meta charset="utf-8">
-<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
-<script src="/bower_components/web-component-tester/browser.js"></script>
-<script>
- WCT.loadSuites(['../embed/embed_test.html']);
-</script>
diff --git a/polygerrit-ui/app/embed_test.sh b/polygerrit-ui/app/embed_test.sh
deleted file mode 100755
index 0d8f58f..0000000
--- a/polygerrit-ui/app/embed_test.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-set -ex
-
-t=$(mktemp -d || mktemp -d -t wct-XXXXXXXXXX)
-components=$TEST_SRCDIR/gerrit/polygerrit-ui/app/test_components.zip
-code=$TEST_SRCDIR/gerrit/polygerrit-ui/app/pg_code.zip
-
-echo $t
-unzip -qd $t $components
-unzip -qd $t $code
-# Purge test/ directory contents coming from pg_code.zip.
-rm -rf $t/test
-mkdir -p $t/test
-cp $TEST_SRCDIR/gerrit/polygerrit-ui/app/embed/test.html $t/test/
-
-if [ "${WCT_HEADLESS_MODE:-0}" != "0" ]; then
- CHROME_OPTIONS=[\'start-maximized\',\'headless\',\'disable-gpu\',\'no-sandbox\']
- FIREFOX_OPTIONS=[\'-headless\']
-else
- CHROME_OPTIONS=[\'start-maximized\']
- FIREFOX_OPTIONS=[\'\']
-fi
-
-# For some reason wct tries to install selenium into its node_modules
-# directory on first run. If you've installed into /usr/local and
-# aren't running wct as root, you're screwed. Turning this option off
-# through skipSeleniumInstall seems to still work, so there's that.
-
-# Sauce tests are disabled by default in order to run local tests
-# only. Run it with (saucelabs.com account required; free for open
-# source): WCT_ARGS='--plugin sauce' ./polygerrit-ui/app/embed_test.sh
-
-cat <<EOF > $t/wct.conf.js
-module.exports = {
- 'suites': ['test'],
- 'webserver': {
- 'pathMappings': [
- {'/components/bower_components': 'bower_components'}
- ]
- },
- 'plugins': {
- 'local': {
- 'skipSeleniumInstall': true,
- 'browserOptions': {
- 'chrome': ${CHROME_OPTIONS},
- 'firefox': ${FIREFOX_OPTIONS}
- }
- },
- 'sauce': {
- 'disabled': true,
- 'browsers': [
- 'OS X 10.12/chrome',
- 'Windows 10/chrome',
- 'Linux/firefox',
- 'OS X 10.12/safari',
- 'Windows 10/microsoftedge'
- ]
- }
- }
- };
-EOF
-
-export PATH="$(dirname $NPM):$PATH"
-
-cd $t
-test -n "${WCT}"
-
-${WCT} ${WCT_ARGS}
diff --git a/polygerrit-ui/app/run_test.sh b/polygerrit-ui/app/run_test.sh
index e9be18d..76a4fa1 100755
--- a/polygerrit-ui/app/run_test.sh
+++ b/polygerrit-ui/app/run_test.sh
@@ -48,5 +48,4 @@
--test_env="DISPLAY=${DISPLAY}" \
--test_env="WCT_HEADLESS_MODE=${WCT_HEADLESS_MODE}" \
"$@" \
- //polygerrit-ui/app:embed_test \
//polygerrit-ui/app:wct_test
diff --git a/polygerrit-ui/app/styles/themes/app-theme.html b/polygerrit-ui/app/styles/themes/app-theme.html
index 0ccb5c5..3a620d2 100644
--- a/polygerrit-ui/app/styles/themes/app-theme.html
+++ b/polygerrit-ui/app/styles/themes/app-theme.html
@@ -45,6 +45,7 @@
--assignee-highlight-color: #fcfad6;
--chip-background-color: #eee;
--comment-background-color: #fcfad6;
+ --robot-comment-background-color: #e8f0fe;
--default-button-background-color: white;
--dialog-background-color: white;
--dropdown-background-color: white;
diff --git a/polygerrit-ui/app/styles/themes/dark-theme.html b/polygerrit-ui/app/styles/themes/dark-theme.html
index 513f28a..4a91774 100644
--- a/polygerrit-ui/app/styles/themes/dark-theme.html
+++ b/polygerrit-ui/app/styles/themes/dark-theme.html
@@ -45,6 +45,7 @@
--assignee-highlight-color: #3a361c;
--chip-background-color: #131416;
--comment-background-color: #0b162b;
+ --robot-comment-background-color: #e8f0fe;
--default-button-background-color: #3c4043;
--dialog-background-color: #131416;
--dropdown-background-color: #131416;