summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Milanesio <luca.milanesio@gmail.com>2024-04-10 15:46:31 -0700
committerLuca Milanesio <luca.milanesio@gmail.com>2024-04-10 15:46:31 -0700
commit9761c02675de0e027f75649698701773a4c17558 (patch)
tree4841e5a735e33689c4d8f81b31cfd7b3f4cfb365
parent1fb5014923288d681c0a64ff7c043f70d0a63abc (diff)
parent0ca10457d3a8668c7a04d2acf4ac039a373114ae (diff)
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
-rw-r--r--java/com/google/gerrit/acceptance/AbstractDaemonTest.java1
-rw-r--r--java/com/google/gerrit/server/restapi/project/CreateLabel.java1
-rw-r--r--java/com/google/gerrit/server/restapi/project/SetLabel.java1
-rw-r--r--javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java1
-rw-r--r--javatests/com/google/gerrit/acceptance/api/change/SubmitRequirementIT.java3
-rw-r--r--javatests/com/google/gerrit/acceptance/api/change/SubmitRuleIT.java1
-rw-r--r--javatests/com/google/gerrit/acceptance/server/project/CustomLabelIT.java11
-rw-r--r--javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java4
8 files changed, 23 insertions, 0 deletions
diff --git a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
index a31915b05a..7027eafeab 100644
--- a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
+++ b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
@@ -1613,6 +1613,7 @@ public abstract class AbstractDaemonTest {
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 7b15350041..a233834f88 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 @@ public class CreateLabel
* @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 b5c9bba2e8..edd165dcc0 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 @@ public class SetLabel implements RestModifyView<LabelResource, LabelDefinitionIn
* @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 5f44f9920e..2cc27984b6 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 @@ public class StickyApprovalsIT extends AbstractDaemonTest {
.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 c7d1c5ef20..42af666a77 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 @@ public class SubmitRequirementIT extends AbstractDaemonTest {
// 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 @@ public class SubmitRequirementIT extends AbstractDaemonTest {
// 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 @@ public class SubmitRequirementIT extends AbstractDaemonTest {
.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 af95e7eaec..e7efb625cb 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 @@ public class SubmitRuleIT extends AbstractDaemonTest {
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 576c7d08ce..7ffc0a4ee5 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 @@ public class CustomLabelIT extends AbstractDaemonTest {
.update();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelNoOp_NegativeVoteNotBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(NO_OP));
@@ -91,6 +92,7 @@ public class CustomLabelIT extends AbstractDaemonTest {
assertThat(q.blocking).isNull();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelNoBlock_NegativeVoteNotBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(NO_BLOCK));
@@ -106,6 +108,7 @@ public class CustomLabelIT extends AbstractDaemonTest {
assertThat(q.blocking).isNull();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelMaxNoBlock_NegativeVoteNotBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(MAX_NO_BLOCK));
@@ -121,6 +124,7 @@ public class CustomLabelIT extends AbstractDaemonTest {
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 @@ public class CustomLabelIT extends AbstractDaemonTest {
assertThat(q.blocking).isNull();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelAnyWithBlock_NegativeVoteBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(ANY_WITH_BLOCK));
@@ -163,6 +168,7 @@ public class CustomLabelIT extends AbstractDaemonTest {
}
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelAnyWithBlock_Addreviewer_ZeroVote() throws Exception {
TestListener testListener = new TestListener();
@@ -190,6 +196,7 @@ public class CustomLabelIT extends AbstractDaemonTest {
}
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelMaxWithBlock_NegativeVoteBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(MAX_WITH_BLOCK));
@@ -205,6 +212,7 @@ public class CustomLabelIT extends AbstractDaemonTest {
assertThat(q.blocking).isTrue();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelMaxWithBlock_DeletedVoteDoesNotTriggerNegativeBlock() throws Exception {
saveLabelConfig(P.toBuilder().setFunction(MAX_WITH_BLOCK));
@@ -227,6 +235,7 @@ public class CustomLabelIT extends AbstractDaemonTest {
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 @@ public class CustomLabelIT extends AbstractDaemonTest {
assertThat(q.blocking).isNull();
}
+ @SuppressWarnings("deprecation")
@Test
public void customLabelMaxWithBlock_MaxVoteNegativeVoteBlock() throws Exception {
saveLabelConfig(LABEL.toBuilder().setFunction(MAX_WITH_BLOCK));
@@ -262,6 +272,7 @@ public class CustomLabelIT extends AbstractDaemonTest {
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 08aa670284..0f4bd2e2f6 100644
--- a/javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java
+++ b/javatests/com/google/gerrit/server/project/SubmitRequirementsAdapterTest.java
@@ -40,6 +40,7 @@ public class SubmitRequirementsAdapterTest {
@Before
public void setup() {
+ @SuppressWarnings("deprecation")
LabelType codeReview =
LabelType.builder(
"Code-Review",
@@ -50,6 +51,7 @@ public class SubmitRequirementsAdapterTest {
.setFunction(LabelFunction.MAX_WITH_BLOCK)
.build();
+ @SuppressWarnings("deprecation")
LabelType verified =
LabelType.builder(
"Verified",
@@ -60,6 +62,7 @@ public class SubmitRequirementsAdapterTest {
.setFunction(LabelFunction.MAX_NO_BLOCK)
.build();
+ @SuppressWarnings("deprecation")
LabelType codeStyle =
LabelType.builder(
"Code-Style",
@@ -70,6 +73,7 @@ public class SubmitRequirementsAdapterTest {
.setFunction(LabelFunction.ANY_WITH_BLOCK)
.build();
+ @SuppressWarnings("deprecation")
LabelType ignoreSelfApprovalLabel =
LabelType.builder(
"ISA-Label",