Merge branch 'stable-2.16' into stable-3.0
* stable-2.16: Change bazel-genfiles to bazel-bin as per Bazel 0.25 AccountIT#deletePreferredEmail: Make assertions more explicit Avoid evaluating submit rules twice for open changes Change-Id: I399da0d5f3e3f144b1048a06d4243ec175e9801d
This commit is contained in:
@@ -158,7 +158,7 @@ The output archive that contains Java binaries, Java sources and
|
|||||||
Java docs will be placed in:
|
Java docs will be placed in:
|
||||||
|
|
||||||
----
|
----
|
||||||
bazel-genfiles/api.zip
|
bazel-bin/api.zip
|
||||||
----
|
----
|
||||||
|
|
||||||
Install {extension,plugin,acceptance-framework}-api to the local
|
Install {extension,plugin,acceptance-framework}-api to the local
|
||||||
@@ -183,13 +183,13 @@ Install gerrit.war to the local maven repository:
|
|||||||
The output JAR files for individual plugins will be placed in:
|
The output JAR files for individual plugins will be placed in:
|
||||||
|
|
||||||
----
|
----
|
||||||
bazel-genfiles/plugins/<name>/<name>.jar
|
bazel-bin/plugins/<name>/<name>.jar
|
||||||
----
|
----
|
||||||
|
|
||||||
The JAR files will also be packaged in:
|
The JAR files will also be packaged in:
|
||||||
|
|
||||||
----
|
----
|
||||||
bazel-genfiles/plugins/core.zip
|
bazel-bin/plugins/core.zip
|
||||||
----
|
----
|
||||||
|
|
||||||
To build a specific plugin:
|
To build a specific plugin:
|
||||||
@@ -201,7 +201,7 @@ To build a specific plugin:
|
|||||||
The output JAR file will be be placed in:
|
The output JAR file will be be placed in:
|
||||||
|
|
||||||
----
|
----
|
||||||
bazel-genfiles/plugins/<name>/<name>.jar
|
bazel-bin/plugins/<name>/<name>.jar
|
||||||
----
|
----
|
||||||
|
|
||||||
Note that when building an individual plugin, the `core.zip` package
|
Note that when building an individual plugin, the `core.zip` package
|
||||||
|
@@ -832,7 +832,7 @@ public class ChangeData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<SubmitRecord> submitRecords(SubmitRuleOptions options) {
|
public List<SubmitRecord> submitRecords(SubmitRuleOptions options) {
|
||||||
List<SubmitRecord> records = submitRecords.get(options);
|
List<SubmitRecord> records = getCachedSubmitRecord(options);
|
||||||
if (records == null) {
|
if (records == null) {
|
||||||
if (!lazyLoad) {
|
if (!lazyLoad) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
@@ -845,7 +845,21 @@ public class ChangeData {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public List<SubmitRecord> getSubmitRecords(SubmitRuleOptions options) {
|
public List<SubmitRecord> getSubmitRecords(SubmitRuleOptions options) {
|
||||||
return submitRecords.get(options);
|
return getCachedSubmitRecord(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<SubmitRecord> getCachedSubmitRecord(SubmitRuleOptions options) {
|
||||||
|
List<SubmitRecord> records = submitRecords.get(options);
|
||||||
|
if (records != null) {
|
||||||
|
return records;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.allowClosed() && change != null && change.getStatus().isOpen()) {
|
||||||
|
SubmitRuleOptions openSubmitRuleOptions = options.toBuilder().allowClosed(false).build();
|
||||||
|
return submitRecords.get(openSubmitRuleOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSubmitRecords(SubmitRuleOptions options, List<SubmitRecord> records) {
|
public void setSubmitRecords(SubmitRuleOptions options, List<SubmitRecord> records) {
|
||||||
|
@@ -1074,6 +1074,7 @@ public class AccountIT extends AbstractDaemonTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void deletePreferredEmail() throws Exception {
|
public void deletePreferredEmail() throws Exception {
|
||||||
|
String previous = gApi.accounts().self().get().email;
|
||||||
String email = "foo.bar.baz@example.com";
|
String email = "foo.bar.baz@example.com";
|
||||||
EmailInput input = new EmailInput();
|
EmailInput input = new EmailInput();
|
||||||
input.email = email;
|
input.email = email;
|
||||||
@@ -1085,6 +1086,7 @@ public class AccountIT extends AbstractDaemonTest {
|
|||||||
// and then again on setting the email preferred.
|
// and then again on setting the email preferred.
|
||||||
accountIndexedCounter.assertReindexOf(admin, 2);
|
accountIndexedCounter.assertReindexOf(admin, 2);
|
||||||
|
|
||||||
|
// The new preferred email is set
|
||||||
assertThat(gApi.accounts().self().get().email).isEqualTo(email);
|
assertThat(gApi.accounts().self().get().email).isEqualTo(email);
|
||||||
|
|
||||||
accountIndexedCounter.clear();
|
accountIndexedCounter.clear();
|
||||||
@@ -1092,7 +1094,8 @@ public class AccountIT extends AbstractDaemonTest {
|
|||||||
accountIndexedCounter.assertReindexOf(admin);
|
accountIndexedCounter.assertReindexOf(admin);
|
||||||
|
|
||||||
requestScopeOperations.resetCurrentApiUser();
|
requestScopeOperations.resetCurrentApiUser();
|
||||||
assertThat(getEmails()).doesNotContain(email);
|
assertThat(getEmails()).containsExactly(previous);
|
||||||
|
assertThat(gApi.accounts().self().get().email).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Reference in New Issue
Block a user