Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -86,6 +86,7 @@ private void assertDeprecationWarningForTemplate(String templateName) throws IOE
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));
assertThat(((Map<?, ?>) templateIssues.getFirst()).get("message"), equalTo(SourceFieldMapper.DEPRECATION_WARNING_TITLE));
assertThat(((Map<?, ?>) templateIssues.getFirst()).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",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This for now points at #117172 but now we can update it when we have the guide, without having as much time pressure. Let me know if you do not agree with this approach.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Mary! We need to regenerate changelogs, because the change now shows up as deprecation instead of a breaking change: https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-9.0.html#deprecations_90_mapping

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