Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ private void assertDeprecationWarningForTemplate(String templateName) throws IOE
assertThat(response.containsKey("templates"), equalTo(true));
Map<?, ?> issuesByTemplate = (Map<?, ?>) response.get("templates");
assertThat(issuesByTemplate.containsKey(templateName), equalTo(true));
var templateIssues = (List<?>) issuesByTemplate.get(templateName);
assertThat(((Map<?, ?>) templateIssues.getFirst()).get("message"), equalTo(SourceFieldMapper.DEPRECATION_WARNING));
var templateIssue = (Map<?, ?>) ((List<?>) issuesByTemplate.get(templateName)).getFirst();
assertThat(templateIssue.get("message"), equalTo(SourceFieldMapper.DEPRECATION_WARNING_TITLE));
assertThat(templateIssue.get("details"), equalTo(SourceFieldMapper.DEPRECATION_WARNING));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class SourceFieldMapper extends MetadataFieldMapper {

public static final String LOSSY_PARAMETERS_ALLOWED_SETTING_NAME = "index.lossy.source-mapping-parameters";

public static final String DEPRECATION_WARNING_TITLE = "Configuring source mode in mappings is deprecated.";

public static final String DEPRECATION_WARNING = "Configuring source mode in mappings is deprecated and will be removed "
+ "in future versions. Use [index.mapping.source.mode] index setting instead.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ private DeprecationIssue checkSourceModeInComponentTemplates(ComponentTemplate t
if (sourceMap.containsKey("mode")) {
return new DeprecationIssue(
DeprecationIssue.Level.CRITICAL,
SourceFieldMapper.DEPRECATION_WARNING_TITLE,
"https://ela.st/migrate-source-mode",
SourceFieldMapper.DEPRECATION_WARNING,
"https://github.com/elastic/elasticsearch/pull/117172",
null,
false,
null
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public void testCheckSourceModeInComponentTemplates() throws IOException {
Map<String, List<DeprecationIssue>> issuesByComponentTemplate = checker.check(clusterState);
final DeprecationIssue expected = new DeprecationIssue(
DeprecationIssue.Level.CRITICAL,
SourceFieldMapper.DEPRECATION_WARNING_TITLE,
"https://ela.st/migrate-source-mode",
SourceFieldMapper.DEPRECATION_WARNING,
"https://github.com/elastic/elasticsearch/pull/117172",
null,
false,
null
);
Expand Down