Skip to content

Commit

Permalink
fix for updating version numbers for deprecation messages (#4719)
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Chakraborti <amit.chakraborti09@gmail.com>
  • Loading branch information
amitchakraborti9 committed Mar 27, 2023
1 parent 7500270 commit 16797d6
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,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 @@ -323,7 +323,7 @@ public void testSyncedFlushTransition() throws Exception {
ResponseException responseException = expectThrows(ResponseException.class, () -> oldNodeClient.performRequest(request));
assertThat(responseException.getResponse().getStatusLine().getStatusCode(), equalTo(RestStatus.CONFLICT.getStatus()));
assertThat(responseException.getResponse().getWarnings(),
contains("Synced flush is deprecated and will be removed in 8.0. Use flush at _/flush or /{index}/_flush instead."));
contains("Synced flush is deprecated and will be removed in 3.0. Use flush at _/flush or /{index}/_flush instead."));
Map<String, Object> result = ObjectPath.createFromResponse(responseException.getResponse()).evaluate("_shards");
assertThat(result.get("total"), equalTo(totalShards));
assertThat(result.get("successful"), equalTo(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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"
- "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,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"
- "Parameter [master_timeout] is deprecated and will be removed in 3.0. To support inclusive language, please use [cluster_manager_timeout] instead."

- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,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 @@ -155,7 +155,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 @@ -94,7 +94,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 @@ -83,7 +83,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 @@ -103,7 +103,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 @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ protected void syncedFlush(String indexName, boolean retryOnConflict) throws Exc
final Builder options = RequestOptions.DEFAULT.toBuilder();
// 8.0 kept in warning message for legacy purposes TODO: changge to 3.0
final List<String> warningMessage = Arrays.asList(
"Synced flush is deprecated and will be removed in 8.0. Use flush at _/flush or /{index}/_flush instead."
"Synced flush is deprecated and will be removed in 3.0. Use flush at _/flush or /{index}/_flush instead."
);
final List<String> expectedWarnings = Arrays.asList(
"Synced flush was removed and a normal flush was performed instead. This transition will be removed in a future version."
Expand Down

0 comments on commit 16797d6

Please sign in to comment.