Skip to content

Commit

Permalink
fix for updating version numbers for deprecation messages (opensearch…
Browse files Browse the repository at this point in the history
…-project#4719)

Signed-off-by: Amit Chakraborti <amit.chakraborti09@gmail.com>
(cherry picked from commit 16797d6)
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
  • Loading branch information
amitchakraborti9 authored and reta committed Mar 29, 2023
1 parent 3e6ec57 commit 6403c90
Showing 15 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -346,7 +346,7 @@ public UserAgentProcessor create(
deprecationLogger.deprecate(
"ecs_false_non_common_schema",
"setting [ecs] to false for non-common schema "
+ "format is deprecated and will be removed in 8.0, set to true or remove to use the non-deprecated format"
+ "format is deprecated and will be removed in 3.0, set to true or remove to use the non-deprecated format"
);
}

Original file line number Diff line number Diff line change
@@ -87,7 +87,7 @@

- do:
allowed_warnings:
- "setting [ecs] to false for non-common schema format is deprecated and will be removed in 8.0, set to true or remove to use the non-deprecated format"
- "setting [ecs] to false for non-common schema format is deprecated and will be removed in 3.0, set to true or remove to use the non-deprecated format"
- "the [os_major] property is deprecated for the user-agent processor"
ingest.put_pipeline:
id: "my_pipeline"
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@ protected void writeFieldValue(XContentBuilder builder) throws IOException {

@Override
protected void assertParseMaximalWarnings() {
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 8.0");
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 3.0");
}

@Override
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@
index.number_of_replicas: 0
index.merge.scheduler.max_thread_count: 2
allowed_warnings:
- "parameter [copy_settings] is deprecated and will be removed in 8.0.0"
- "parameter [copy_settings] is deprecated and will be removed in 3.0.0"

- do:
cluster.health:
Original file line number Diff line number Diff line change
@@ -51,8 +51,7 @@
index.number_of_shards: 2
index.merge.scheduler.max_thread_count: 2
allowed_warnings:
- "parameter [copy_settings] is deprecated and will be removed in 8.0.0"

- "parameter [copy_settings] is deprecated and will be removed in 3.0.0"

- do:
cluster.health:
Original file line number Diff line number Diff line change
@@ -694,7 +694,7 @@ public final void parse(String name, ParserContext parserContext, Map<String, Ob
if (Objects.equals("boost", propName)) {
deprecationLogger.deprecate(
"boost_" + name,
"Parameter [boost] on field [{}] is deprecated and will be removed in 8.0",
"Parameter [boost] on field [{}] is deprecated and will be removed in 3.0",
name
);
}
Original file line number Diff line number Diff line change
@@ -150,7 +150,7 @@ public static void parseField(
builder.boost(nodeFloatValue(propNode));
deprecationLogger.deprecate(
"boost_" + name,
"Parameter [boost] on field [{}] is deprecated and will be removed in 8.0",
"Parameter [boost] on field [{}] is deprecated and will be removed in 3.0",
name
);
iterator.remove();
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ public final RestChannelConsumer prepareRequest(final RestRequest request, final
}
deprecationLogger.deprecate(
"resize_deprecated_parameter",
"parameter [copy_settings] is deprecated and will be removed in 8.0.0"
"parameter [copy_settings] is deprecated and will be removed in 3.0.0"
);
}
resizeRequest.setCopySettings(copySettings);
Original file line number Diff line number Diff line change
@@ -62,7 +62,7 @@ protected void minimalMapping(XContentBuilder b) throws IOException {

@Override
protected void assertParseMaximalWarnings() {
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 8.0");
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 3.0");
}

protected void registerParameters(ParameterChecker checker) throws IOException {
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ public void testExistsQueryDocValuesDisabled() throws IOException {

@Override
protected void assertParseMaximalWarnings() {
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 8.0");
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 3.0");
}

public void testDefaults() throws Exception {
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@ protected void minimalMapping(XContentBuilder b) throws IOException {

@Override
protected void assertParseMaximalWarnings() {
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 8.0");
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 3.0");
}

protected void registerParameters(ParameterChecker checker) throws IOException {
@@ -309,7 +309,7 @@ public void testIndexOptions() throws IOException {
public void testBoost() throws IOException {
MapperService mapperService = createMapperService(fieldMapping(b -> b.field("type", "keyword").field("boost", 2f)));
assertThat(mapperService.fieldType("field").boost(), equalTo(2f));
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 8.0");
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 3.0");
}

public void testEnableNorms() throws IOException {
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ public void testExistsQueryDocValuesDisabled() throws IOException {

@Override
protected void assertParseMaximalWarnings() {
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 8.0");
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 3.0");
}

protected void registerParameters(ParameterChecker checker) throws IOException {
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ protected void writeFieldValue(XContentBuilder builder) throws IOException {

@Override
protected void assertParseMaximalWarnings() {
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 8.0");
assertWarnings("Parameter [boost] on field [field] is deprecated and will be removed in 3.0");
}

public final void testExistsQueryIndexDisabled() throws IOException {
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ private void runTestResizeCopySettingsDeprecated(
);
assertThat(e, hasToString(containsString("parameter [copy_settings] can not be explicitly set to [false]")));
} else {
String expectedWarning = "parameter [copy_settings] is deprecated and will be removed in 8.0.0";
String expectedWarning = "parameter [copy_settings] is deprecated and will be removed in 3.0.0";
handler.prepareRequest(request, mock(NodeClient.class));
if (("".equals(copySettings) || "true".equals(copySettings)) && !assertedWarnings.contains(expectedWarning)) {
assertWarnings(expectedWarning);
Original file line number Diff line number Diff line change
@@ -274,7 +274,7 @@ public void testDeprecatedBoost() throws IOException {
}));
String type = typeName();
String[] warnings = new String[] {
"Parameter [boost] on field [field] is deprecated and will be removed in 8.0",
"Parameter [boost] on field [field] is deprecated and will be removed in 3.0",
"Parameter [boost] has no effect on type [" + type + "] and will be removed in future" };
allowedWarnings(warnings);
}

0 comments on commit 6403c90

Please sign in to comment.