Skip to content

Commit

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

(cherry picked from commit 16797d6)

Signed-off-by: Amit Chakraborti <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: Amit Chakraborti <[email protected]>
  • Loading branch information
reta and amitchakraborti9 authored Mar 29, 2023
1 parent 3e6ec57 commit 7ee9ca1
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7ee9ca1

Please sign in to comment.