Skip to content

Commit

Permalink
Update setting deprecation messages to remove major release references (
Browse files Browse the repository at this point in the history
#83528)

Updates our setting deprecation messages to avoid references to future major releases.
  • Loading branch information
jrodewig committed Feb 4, 2022
1 parent 175ecad commit fe29908
Show file tree
Hide file tree
Showing 25 changed files with 89 additions and 143 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ PUT _cluster/settings
}
}
----------------------------------
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.]
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release.]

Alternatively, you can enable this setting in {kib}. In the side navigation,
click *Monitoring*. If data collection is disabled, you are prompted to turn it
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/monitoring/configuring-metricbeat.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ PUT _cluster/settings
}
}
----------------------------------
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.]
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release.]

If {es} {security-features} are enabled, you must have `monitor` cluster privileges to
view the cluster settings and `manage` cluster privileges to change them.
Expand Down Expand Up @@ -204,7 +204,7 @@ PUT _cluster/settings
}
}
----------------------------------
// TEST[warning:[xpack.monitoring.elasticsearch.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.]
// TEST[warning:[xpack.monitoring.elasticsearch.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release.]

If {es} {security-features} are enabled, you must have `monitor` cluster
privileges to view the cluster settings and `manage` cluster privileges
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/snapshot-restore/restore-snapshot.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ PUT _cluster/settings
}
}
----
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.]
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release.]

* Watcher
+
Expand Down Expand Up @@ -462,7 +462,7 @@ PUT _cluster/settings
}
}
----
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version.]
// TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release.]
// TEST[s/true/false/]

* Watcher
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ public void testDeprecatedSettings() throws IOException, UserException {
deprecationEvents.get(0),
DeprecationLogger.CRITICAL,
"org.elasticsearch.common.logging.DeprecationLogger.lambda\\$doPrivilegedLog\\$0",
"\\[deprecated.foo\\] setting was deprecated in Elasticsearch and will be removed in a future release! "
+ "See the breaking changes documentation for the next major version."
"\\[deprecated.foo\\] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,7 @@ void checkDeprecation(Settings settings) {
final String key = getKey();
List<String> skipTheseDeprecations = settings.getAsList("deprecation.skip_deprecated_settings");
if (Regex.simpleMatch(skipTheseDeprecations, key) == false) {
String message = "[{}] setting was deprecated in Elasticsearch and will be removed in a future release! "
+ "See the breaking changes documentation for the next major version.";
String message = "[{}] setting was deprecated in Elasticsearch and will be removed in a future release.";
if (this.isDeprecatedWarningOnly()) {
Settings.DeprecationLoggerHolder.deprecationLogger.warn(DeprecationCategory.SETTINGS, key, message, key);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,7 @@ protected boolean addMockHttpTransport() {
protected List<String> filteredWarnings() {
return Stream.concat(
super.filteredWarnings().stream(),
List.of(
"[index.data_path] setting was deprecated in Elasticsearch and will be removed in a future release! "
+ "See the breaking changes documentation for the next major version."
).stream()
List.of("[index.data_path] setting was deprecated in Elasticsearch and will be removed in a future release.").stream()
).collect(Collectors.toList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,7 @@ protected final void assertSettingDeprecationsAndWarnings(final Setting<?>[] set
assertWarnings(true, Stream.concat(Arrays.stream(settings).map(setting -> {
String warningMessage = String.format(
Locale.ROOT,
"[%s] setting was deprecated in Elasticsearch and will be "
+ "removed in a future release! See the breaking changes documentation for the next major version.",
"[%s] setting was deprecated in Elasticsearch and will be removed in a future release.",
setting.getKey()
);
return new DeprecationWarning(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public void testDoCollect() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.ccr.stats.timeout] setting was deprecated in Elasticsearch and will be removed in "
+ "a future release! See the breaking changes documentation for the next major version."
+ "a future release."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,7 @@ public void testDeprecatedSettingsReturnWarnings() throws Exception {
TestDeprecationHeaderRestAction.TEST_DEPRECATED_SETTING_TRUE2
)) {
headerMatchers.add(
equalTo(
"["
+ setting.getKey()
+ "] setting was deprecated in Elasticsearch and will be removed in a future release! "
+ "See the breaking changes documentation for the next major version."
)
equalTo("[" + setting.getKey() + "] setting was deprecated in Elasticsearch and will be removed in a future release.")
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,8 @@ public void testScriptContextCompilationsRateLimitSetting() {

assertWarnings(
"[script.context.field.max_compilations_rate] setting was deprecated in Elasticsearch and will be"
+ " removed in a future release! See the breaking changes documentation for the next major version.",
"[script.context.score.max_compilations_rate] setting was deprecated in Elasticsearch and will be removed in a future"
+ " release! See the breaking changes documentation for the next major version."
+ " removed in a future release.",
"[script.context.score.max_compilations_rate] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand Down Expand Up @@ -527,9 +526,8 @@ public void testImplicitScriptContextCacheSetting() {

assertWarnings(
"[script.context.update.max_compilations_rate] setting was deprecated in Elasticsearch and will be"
+ " removed in a future release! See the breaking changes documentation for the next major version.",
"[script.context.filter.cache_max_size] setting was deprecated in Elasticsearch and will be removed in a future"
+ " release! See the breaking changes documentation for the next major version."
+ " removed in a future release.",
"[script.context.filter.cache_max_size] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand Down Expand Up @@ -562,10 +560,8 @@ public void testScriptContextCacheSizeSetting() {
);

assertWarnings(
"[script.context.update.cache_max_size] setting was deprecated in Elasticsearch and will be"
+ " removed in a future release! See the breaking changes documentation for the next major version.",
"[script.context.filter.cache_max_size] setting was deprecated in Elasticsearch and will be removed in a future"
+ " release! See the breaking changes documentation for the next major version."
"[script.context.update.cache_max_size] setting was deprecated in Elasticsearch and will be removed in a future release.",
"[script.context.filter.cache_max_size] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand Down Expand Up @@ -598,10 +594,8 @@ public void testScriptContextCacheExpirationSetting() {
);

assertWarnings(
"[script.context.interval.cache_expire] setting was deprecated in Elasticsearch and will be"
+ " removed in a future release! See the breaking changes documentation for the next major version.",
"[script.context.moving-function.cache_expire] setting was deprecated in Elasticsearch and will be removed in a future"
+ " release! See the breaking changes documentation for the next major version."
"[script.context.interval.cache_expire] setting was deprecated in Elasticsearch and will be removed in a future release.",
"[script.context.moving-function.cache_expire] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand Down Expand Up @@ -655,8 +649,7 @@ public void testLifecyleStepMasterTimeoutSetting() {
true,
new DeprecationWarning(
Level.WARN,
"[indices.lifecycle.step.master_timeout] setting was deprecated in Elasticsearch and will be removed in a future release!"
+ " See the breaking changes documentation for the next major version."
"[indices.lifecycle.step.master_timeout] setting was deprecated in Elasticsearch and will be removed in a future release."
)
);
}
Expand All @@ -678,8 +671,7 @@ public void testEqlEnabledSetting() {
true,
new DeprecationWarning(
Level.WARN,
"[xpack.eql.enabled] setting was deprecated in Elasticsearch and will be removed in a future release!"
+ " See the breaking changes documentation for the next major version."
"[xpack.eql.enabled] setting was deprecated in Elasticsearch and will be removed in a future release."
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void testDoCollect() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.enrich.stats.timeout] setting was deprecated in Elasticsearch and will be removed "
+ "in a future release! See the breaking changes documentation for the next major version."
+ "in a future release."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public void testHistoryDurationDefaults7Days() {
// Note: this verifies the semantics because this is taken for granted that it never returns null!
assertEquals(sevenDays, MonitoringField.HISTORY_DURATION.get(buildSettings(MonitoringField.HISTORY_DURATION.getKey(), null)));
assertWarnings(
"[xpack.monitoring.history.duration] setting was deprecated in Elasticsearch and will be removed in a future "
+ "release! See the breaking changes documentation for the next major version."
"[xpack.monitoring.history.duration] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand All @@ -33,8 +32,7 @@ public void testHistoryDurationMinimum24Hours() {
MonitoringField.HISTORY_DURATION.get(buildSettings(MonitoringField.HISTORY_DURATION.getKey(), "24h"))
);
assertWarnings(
"[xpack.monitoring.history.duration] setting was deprecated in Elasticsearch and will be removed in a future "
+ "release! See the breaking changes documentation for the next major version."
"[xpack.monitoring.history.duration] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand All @@ -46,8 +44,7 @@ public void testHistoryDurationMinimum24HoursBlocksLower() {
() -> MonitoringField.HISTORY_DURATION.get(buildSettings(MonitoringField.HISTORY_DURATION.getKey(), oneSecondEarly))
);
assertWarnings(
"[xpack.monitoring.history.duration] setting was deprecated in Elasticsearch and will be removed in a future "
+ "release! See the breaking changes documentation for the next major version."
"[xpack.monitoring.history.duration] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ public void testInterval() throws Exception {
// take down threads
monitoringService.setMonitoringActive(false);
assertWarnings(
"[xpack.monitoring.collection.interval] setting was deprecated in Elasticsearch and will be removed in "
+ "a future release! See the breaking changes documentation for the next major version."
"[xpack.monitoring.collection.interval] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand All @@ -140,10 +139,8 @@ public void testSkipExecution() throws Exception {

assertThat(exporter.getExportsCount(), equalTo(1));
assertWarnings(
"[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in "
+ "a future release! See the breaking changes documentation for the next major version.",
"[xpack.monitoring.collection.interval] setting was deprecated in Elasticsearch and will be removed in "
+ "a future release! See the breaking changes documentation for the next major version."
"[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release.",
"[xpack.monitoring.collection.interval] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public void testConstructorWithInvalidRetention() {
new CleanerService(settings, clusterSettings, threadPool, licenseState);
} finally {
assertWarnings(
"[xpack.monitoring.history.duration] setting was deprecated in Elasticsearch and will be removed in "
+ "a future release! See the breaking changes documentation for the next major version."
"[xpack.monitoring.history.duration] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}
}
Expand All @@ -73,8 +72,7 @@ public void testGetRetention() {
assertEquals(expected, new CleanerService(settings, clusterSettings, threadPool, licenseState).getRetention());

assertWarnings(
"[xpack.monitoring.history.duration] setting was deprecated in Elasticsearch and will be removed in "
+ "a future release! See the breaking changes documentation for the next major version."
"[xpack.monitoring.history.duration] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public void testDoCollect() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.cluster.stats.timeout] setting was deprecated in Elasticsearch and will be removed "
+ "in a future release! See the breaking changes documentation for the next major version."
+ "in a future release."
);
}

Expand Down Expand Up @@ -367,7 +367,7 @@ public void testDoCollectNoLicense() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.cluster.stats.timeout] setting was deprecated in Elasticsearch and will be removed "
+ "in a future release! See the breaking changes documentation for the next major version."
+ "in a future release."
);
}

Expand Down Expand Up @@ -432,7 +432,7 @@ public void testDoCollectThrowsTimeoutException() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.cluster.stats.timeout] setting was deprecated in Elasticsearch and will be removed "
+ "in a future release! See the breaking changes documentation for the next major version."
+ "in a future release."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,10 @@ public void testDoCollect() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.index.recovery.timeout] setting was deprecated in Elasticsearch and will be "
+ "removed in a future release! See the breaking changes documentation for the next major version.",
+ "removed in a future release.",
"[xpack.monitoring.collection.index.recovery.active_only] setting was deprecated in Elasticsearch and will be removed "
+ "in a future release! See the breaking changes documentation for the next major version.",
"[xpack.monitoring.collection.indices] setting was deprecated in Elasticsearch and will be removed in a future release! "
+ "See the breaking changes documentation for the next major version."
+ "in a future release.",
"[xpack.monitoring.collection.indices] setting was deprecated in Elasticsearch and will be removed in a future release."
);
}

Expand Down Expand Up @@ -233,7 +232,7 @@ public void testDoCollectThrowsTimeoutException() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.index.recovery.timeout] setting was deprecated in Elasticsearch and will be "
+ "removed in a future release! See the breaking changes documentation for the next major version."
+ "removed in a future release."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void testDoCollect() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.index.stats.timeout] setting was deprecated in Elasticsearch and will be removed "
+ "in a future release! See the breaking changes documentation for the next major version."
+ "in a future release."
);
}

Expand Down Expand Up @@ -217,7 +217,7 @@ public void testDoCollectThrowsTimeoutException() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.index.stats.timeout] setting was deprecated in Elasticsearch and will be removed "
+ "in a future release! See the breaking changes documentation for the next major version."
+ "in a future release."
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public void testDoCollect() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.ml.job.stats.timeout] setting was deprecated in Elasticsearch and will be removed "
+ "in a future release! See the breaking changes documentation for the next major version."
+ "in a future release."
);
}

Expand Down Expand Up @@ -181,7 +181,7 @@ public void testDoCollectThrowsTimeoutException() throws Exception {

assertWarnings(
"[xpack.monitoring.collection.ml.job.stats.timeout] setting was deprecated in Elasticsearch and will be removed "
+ "in a future release! See the breaking changes documentation for the next major version."
+ "in a future release."
);
}

Expand Down

0 comments on commit fe29908

Please sign in to comment.