summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Milanesio <luca.milanesio@gmail.com>2024-04-10 15:43:04 -0700
committerLuca Milanesio <luca.milanesio@gmail.com>2024-04-10 22:44:14 +0000
commit3e6ed81a073b08b609fcfbad105a70737f73d5bf (patch)
tree7f2376b15ff453ee600d713b7b95386f254518c0
parent163ae73f3abbadf74f5c881c13398bd90f408f6a (diff)
parentcd93e0b77245e9dbc99200375f6649ec8ec130e2 (diff)
Merge branch 'stable-3.7' into stable-3.8
* stable-3.7: Suppress deprecation warning for LabelType.Builder#setFunction(...) Release-Notes: skip Change-Id: I3bde59d5f6300dc48f38754b713e2650a25c1d1d
-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 f4e7ccea52..2f445315f5 100644
--- a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
+++ b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java
@@ -1685,6 +1685,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 ad32f4f738..ad79a14fc0 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 10589cc9b3..6c4976d76f 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 2668d1f6c8..6ba1498a68 100644
--- a/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java
@@ -1232,6 +1232,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 ab2f358bb2..c8f361e6f7 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 b05f3c7170..180dd9285c 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",