Skip to content

Commit 5c8e7c6

Browse files
authored
[ML] Switch message and detail for model snapshot deprecations (#81108)
This is a fix to the fix of #81060. In the original fix where I tried to port the changes from #79387 to master I didn't notice that the text of the message and detail of the deprecation had been largely switched around. My tweaks to the wording in #81060 did not make this major switch. This PR switches the two strings we generate. This is only for 8.0 and 8.1. For 7.16 the discrepancy became obvious in the backport of #81060 to that branch, so it's already correct there.
1 parent 4d19702 commit 5c8e7c6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/MlDeprecationIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void testMlDeprecationChecks() throws Exception {
105105
assertThat(response.getMlSettingsIssues(), hasSize(1));
106106
assertThat(
107107
response.getMlSettingsIssues().get(0).getMessage(),
108-
containsString("Delete model snapshot [1] or update it to 7.0.0 or greater")
108+
containsString("Model snapshot [1] for job [deprecation_check_job] has an obsolete minimum version")
109109
);
110110
assertThat(response.getMlSettingsIssues().get(0).getMeta(), equalTo(Map.of("job_id", jobId, "snapshot_id", "1")));
111111
}

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/MlDeprecationChecker.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,9 @@ static Optional<DeprecationIssue> checkModelSnapshot(ModelSnapshot modelSnapshot
7373
StringBuilder details = new StringBuilder(
7474
String.format(
7575
Locale.ROOT,
76-
// Important: the Kibana upgrade assistant expects this to match the pattern /[Mm]odel snapshot/
77-
// and if it doesn't then the expected "Fix" button won't appear for this deprecation.
78-
"Model snapshot [%s] for job [%s] has an obsolete minimum version [%s].",
76+
"Delete model snapshot [%s] or update it to %s or greater.",
7977
modelSnapshot.getSnapshotId(),
80-
modelSnapshot.getJobId(),
81-
modelSnapshot.getMinVersion()
78+
MIN_REPORTED_SUPPORTED_SNAPSHOT_VERSION
8279
)
8380
);
8481
if (modelSnapshot.getLatestRecordTimeStamp() != null) {
@@ -95,9 +92,12 @@ static Optional<DeprecationIssue> checkModelSnapshot(ModelSnapshot modelSnapshot
9592
DeprecationIssue.Level.CRITICAL,
9693
String.format(
9794
Locale.ROOT,
98-
"Delete model snapshot [%s] or update it to %s or greater.",
95+
// Important: the Kibana upgrade assistant expects this to match the pattern /[Mm]odel snapshot/
96+
// and if it doesn't then the expected "Fix" button won't appear for this deprecation.
97+
"Model snapshot [%s] for job [%s] has an obsolete minimum version [%s].",
9998
modelSnapshot.getSnapshotId(),
100-
MIN_REPORTED_SUPPORTED_SNAPSHOT_VERSION
99+
modelSnapshot.getJobId(),
100+
modelSnapshot.getMinVersion()
101101
),
102102
"https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-upgrade-job-model-snapshot.html",
103103
details.toString(),

0 commit comments

Comments
 (0)