Merge branch 'stable-3.9' into stable-3.10
* stable-3.9:
Emit value change event even when no items are matched
Fix gr-dropdown-list not updating on items change
Suppress deprecation warning for LabelType.Builder#setFunction(...)
Ensure we don't end up in an infinite loop when updating path.
Release-Notes: skip
Change-Id: Iafb4efc0ab800431c61dcecec278bb62b057961e
diff --git a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
index a31915b..7027eaf 100644
--- a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
+++ b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
@@ -1613,6 +1613,7 @@
configLabel(project, label, func, ImmutableList.of(), value);
}
+ @SuppressWarnings("deprecation")
private void configLabel(
Project.NameKey project,
String label,
diff --git a/java/com/google/gerrit/server/restapi/project/CreateLabel.java b/java/com/google/gerrit/server/restapi/project/CreateLabel.java
index 7b15350..a233834 100644
--- a/java/com/google/gerrit/server/restapi/project/CreateLabel.java
+++ b/java/com/google/gerrit/server/restapi/project/CreateLabel.java
@@ -123,6 +123,7 @@
* @throws BadRequestException if there was invalid data in the input
* @throws ResourceConflictException if the label cannot be created due to a conflict
*/
+ @SuppressWarnings("deprecation")
public LabelType createLabel(ProjectConfig config, String label, LabelDefinitionInput input)
throws BadRequestException, ResourceConflictException {
if (config.getLabelSections().containsKey(label)) {
diff --git a/java/com/google/gerrit/server/restapi/project/SetLabel.java b/java/com/google/gerrit/server/restapi/project/SetLabel.java
index b5c9bba..edd165d 100644
--- a/java/com/google/gerrit/server/restapi/project/SetLabel.java
+++ b/java/com/google/gerrit/server/restapi/project/SetLabel.java
@@ -115,6 +115,7 @@
* @throws BadRequestException if there was invalid data in the input
* @throws ResourceConflictException if the update cannot be applied due to a conflict
*/
+ @SuppressWarnings("deprecation")
public boolean updateLabel(ProjectConfig config, LabelType labelType, LabelDefinitionInput input)
throws BadRequestException, ResourceConflictException {
boolean dirty = false;
diff --git a/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java b/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java
index 5f44f99..2cc2798 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java
@@ -1233,6 +1233,7 @@
.contains("Code-Review+1 by User");
}
+ @SuppressWarnings("deprecation")
@Test
public void sticky_copiedToLatestPatchSetFromSubmitRecords() throws Exception {
updateVerifiedLabel(b -> b.setFunction(LabelFunction.NO_BLOCK));
diff --git a/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java b/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java
index c7d1c5e..42af666 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java
@@ -1597,6 +1597,7 @@
// Clear SRs for the project and update code-review label to be non-blocking.
clearSubmitRequirements(project);
+ @SuppressWarnings("deprecation")
LabelType cr =
TestLabels.codeReview().toBuilder().setFunction(LabelFunction.NO_BLOCK).build();
try (ProjectConfigUpdate u = updateProject(project)) {
@@ -1643,6 +1644,7 @@
// Clear SRs for the project and update code-review label to be non-blocking.
clearSubmitRequirements(project);
+ @SuppressWarnings("deprecation")
LabelType cr =
TestLabels.codeReview().toBuilder().setFunction(LabelFunction.NO_BLOCK).build();
try (ProjectConfigUpdate u = updateProject(project)) {
@@ -2857,6 +2859,7 @@
.setAllowOverrideInChildProjects(true)
.build());
+ @SuppressWarnings("deprecation")
LabelType cr = TestLabels.codeReview().toBuilder().setFunction(LabelFunction.NO_BLOCK).build();
try (ProjectConfigUpdate u = updateProject(project)) {
u.getConfig().upsertLabelType(cr);
diff --git a/javatests/com/google/gerrit/acceptance/api/change/SubmitRuleIT.java b/javatests/com/google/gerrit/acceptance/api/change/SubmitRuleIT.java
index af95e7e..e7efb62 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/SubmitRuleIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/SubmitRuleIT.java
@@ -98,6 +98,7 @@
assertThat(recordLabels).contains(needCustomLabel);
}
+ @SuppressWarnings("deprecation")
private void setupCustomBlockingLabel() throws Exception {
try (ProjectConfigUpdate u = updateProject(project)) {
u.getConfig()
diff --git a/javatests/com/google/gerrit/acceptance/server/project/CustomLabelIT.java b/javatests/com/google/gerrit/acceptance/server/project/CustomLabelIT.java
index 576c7d0..7ffc0a4 100644
--- a/javatests/com/google/gerrit/acceptance/server/project/CustomLabelIT.java
+++ b/javatests/com/google/gerrit/acceptance/server/project/CustomLabelIT.java
@@ -76,6 +76,7 @@
.update();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelNoOp_NegativeVoteNotBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(NO_OP));
@@ -91,6 +92,7 @@
assertThat(q.blocking).isNull();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelNoBlock_NegativeVoteNotBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(NO_BLOCK));
@@ -106,6 +108,7 @@
assertThat(q.blocking).isNull();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelMaxNoBlock_NegativeVoteNotBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(MAX_NO_BLOCK));
@@ -121,6 +124,7 @@
assertThat(q.blocking).isNull();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelMaxNoBlock_MaxVoteSubmittable() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(MAX_NO_BLOCK), P.toBuilder().setFunction(NO_OP));
@@ -139,6 +143,7 @@
assertThat(q.blocking).isNull();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelAnyWithBlock_NegativeVoteBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(ANY_WITH_BLOCK));
@@ -163,6 +168,7 @@
}
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelAnyWithBlock_Addreviewer_ZeroVote() throws Exception {
TestListener testListener = new TestListener();
@@ -190,6 +196,7 @@
}
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelMaxWithBlock_NegativeVoteBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(MAX_WITH_BLOCK));
@@ -205,6 +212,7 @@
assertThat(q.blocking).isTrue();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelMaxWithBlock_DeletedVoteDoesNotTriggerNegativeBlock() throws Exception {
saveLabelConfig(P.toBuilder().setFunction(MAX_WITH_BLOCK));
@@ -227,6 +235,7 @@
assertThat(labelInfo.blocking).isNull(); // label is not blocking the change submission
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelMaxWithBlock_MaxVoteSubmittable() throws Exception {
saveLabelConfig(
@@ -246,6 +255,7 @@
assertThat(q.blocking).isNull();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelMaxWithBlock_MaxVoteNegativeVoteBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(MAX_WITH_BLOCK));
@@ -262,6 +272,7 @@
assertThat(q.blocking).isTrue();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabel_DisallowPostSubmit() throws Exception {
saveLabelConfig(
diff --git a/javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java b/javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java
index 08aa670..0f4bd2e 100644
--- a/javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java
+++ b/javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java
@@ -40,6 +40,7 @@
@Before
public void setup() {
+ @SuppressWarnings("deprecation")
LabelType codeReview =
LabelType.builder(
"Code-Review",
@@ -50,6 +51,7 @@
.setFunction(LabelFunction.MAX_WITH_BLOCK)
.build();
+ @SuppressWarnings("deprecation")
LabelType verified =
LabelType.builder(
"Verified",
@@ -60,6 +62,7 @@
.setFunction(LabelFunction.MAX_NO_BLOCK)
.build();
+ @SuppressWarnings("deprecation")
LabelType codeStyle =
LabelType.builder(
"Code-Style",
@@ -70,6 +73,7 @@
.setFunction(LabelFunction.ANY_WITH_BLOCK)
.build();
+ @SuppressWarnings("deprecation")
LabelType ignoreSelfApprovalLabel =
LabelType.builder(
"ISA-Label",