Skip to content

Commit f83612f

Browse files
Bamiehelasticmachinekibanamachine
authored
[Core][UA] Forward-port 8.18 changes into main (#214996)
## Summary We've done a lot of UA changes against 8.18 and 8.x but we did not port them to `main`. The reason we did not do the active development against `main` is because UA is disabled on main and we need those features in 8.last not on `9.0` initially. This port is to keep the codebase consistent and to be able to use these new UA features in the future post `9.0`. Any issues that that are caused from this port we should wrap them in a config and disabled them on main and enable this new flag on `8.x`. What is being ported? - [x] Upgrade assistant plugin (`x-pack/platform/plugins/private/upgrade_assistant`) - [x] Integration test changes (`x-pack/test/upgrade_assistant_integration`) - [x] new UA doc links (`src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts`) - [x] localization files sync (`x-pack/platform/plugins/private/translations/translations/*.json`) - [x] Unfreeze is no longer supported after `8.x`. So removed it from data streams readonly migration step and throw an error for regular indices migration. Closes #210490 --------- Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: kibanamachine <[email protected]>
1 parent 11a512e commit f83612f

File tree

132 files changed

+6270
-1826
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+6270
-1826
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ x-pack/platform/plugins/private/snapshot_restore @elastic/kibana-management
883883
x-pack/platform/plugins/private/telemetry_collection_xpack @elastic/kibana-core
884884
x-pack/platform/plugins/private/transform @elastic/ml-ui
885885
x-pack/platform/plugins/private/translations @elastic/kibana-localization
886-
x-pack/platform/plugins/private/upgrade_assistant @elastic/kibana-core
886+
x-pack/platform/plugins/private/upgrade_assistant @elastic/kibana-management
887887
x-pack/platform/plugins/private/watcher @elastic/kibana-management
888888
x-pack/platform/plugins/shared/actions @elastic/response-ops
889889
x-pack/platform/plugins/shared/ai_infra/llm_tasks @elastic/appex-ai-infra

src/platform/packages/shared/kbn-doc-links/src/get_doc_links.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
200200
trainedModels: `${MACHINE_LEARNING_DOCS}ml-trained-models.html`,
201201
textEmbedding: `${MACHINE_LEARNING_DOCS}ml-nlp-model-ref.html#ml-nlp-model-ref-text-embedding`,
202202
troubleshootSetup: `${ENTERPRISE_SEARCH_DOCS}troubleshoot-setup.html`,
203+
upgrade9x: `${ENTERPRISE_SEARCH_DOCS}upgrading-to-9-x.html`,
203204
usersAccess: `${ENTERPRISE_SEARCH_DOCS}users-access.html`,
204205
},
205206
metricbeat: {
@@ -301,6 +302,7 @@ export const getDocLinks = ({ kibanaBranch, buildFlavor }: GetDocLinkOptions): D
301302
upgradeAssistant: {
302303
overview: `${KIBANA_DOCS}upgrade-assistant.html`,
303304
batchReindex: `${KIBANA_DOCS}batch-start-resume-reindex.html`,
305+
indexBlocks: `${ELASTICSEARCH_DOCS}index-modules-blocks.html#index-block-settings`,
304306
remoteReindex: `${ELASTICSEARCH_DOCS}docs-reindex.html#reindex-from-remote`,
305307
unfreezeApi: `${ELASTICSEARCH_DOCS}unfreeze-index-api.html`,
306308
reindexWithPipeline: `${ELASTICSEARCH_DOCS}docs-reindex.html#reindex-with-an-ingest-pipeline`,

src/platform/packages/shared/kbn-doc-links/src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ export interface DocLinks {
169169
readonly textEmbedding: string;
170170
readonly troubleshootSetup: string;
171171
readonly usersAccess: string;
172+
readonly upgrade9x: string;
172173
};
173174
readonly heartbeat: {
174175
readonly base: string;
@@ -261,6 +262,7 @@ export interface DocLinks {
261262
readonly upgradeAssistant: {
262263
readonly overview: string;
263264
readonly batchReindex: string;
265+
readonly indexBlocks: string;
264266
readonly remoteReindex: string;
265267
readonly unfreezeApi: string;
266268
readonly reindexWithPipeline: string;

x-pack/platform/plugins/private/translations/translations/fr-FR.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47450,9 +47450,6 @@
4745047450
"xpack.upgradeAssistant.esDeprecations.clusterSettings.deletingButtonLabel": "Retrait des paramètres en cours…",
4745147451
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionText": "Retirer les paramètres",
4745247452
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionTooltipLabel": "Corrigez ce problème en retirant les paramètres de ce cluster. La correction peut s'effectuer automatiquement.",
47453-
"xpack.upgradeAssistant.esDeprecations.dataStream.reindexLoadingStatusText": "Chargement du statut…",
47454-
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionLabel": "Marquer en lecture seule ou réindexer",
47455-
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionTooltipLabel": "Ce problème peut être résolu en réindexant ce flux de données ou en marquant ses index en lecture seule. La correction peut s'effectuer automatiquement.",
4745647453
"xpack.upgradeAssistant.esDeprecations.dataStreamsTypeLabel": "Flux de données",
4745747454
"xpack.upgradeAssistant.esDeprecations.defaultDeprecation.manualCellLabel": "Manuel",
4745847455
"xpack.upgradeAssistant.esDeprecations.deprecationDetailsFlyout.closeButtonLabel": "Fermer",

x-pack/platform/plugins/private/translations/translations/ja-JP.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47415,9 +47415,6 @@
4741547415
"xpack.upgradeAssistant.esDeprecations.clusterSettings.deletingButtonLabel": "設定を削除中…",
4741647416
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionText": "設定の削除",
4741747417
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionTooltipLabel": "このクラスターから設定を削除して、この問題を解決します。この問題は自動的に解決できます。",
47418-
"xpack.upgradeAssistant.esDeprecations.dataStream.reindexLoadingStatusText": "ステータスを読み込んでいます...",
47419-
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionLabel": "読み取り専用に設定または再インデックス",
47420-
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionTooltipLabel": "この問題を解決するには、このデータストリームを再インデックス化するか、そのインデックスを読み取り専用に設定します。この問題は自動的に解決できます。",
4742147418
"xpack.upgradeAssistant.esDeprecations.dataStreamsTypeLabel": "データストリーム",
4742247419
"xpack.upgradeAssistant.esDeprecations.defaultDeprecation.manualCellLabel": "手動",
4742347420
"xpack.upgradeAssistant.esDeprecations.deprecationDetailsFlyout.closeButtonLabel": "閉じる",

x-pack/platform/plugins/private/translations/translations/zh-CN.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47489,9 +47489,6 @@
4748947489
"xpack.upgradeAssistant.esDeprecations.clusterSettings.deletingButtonLabel": "设置移除进行中……",
4749047490
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionText": "移除设置",
4749147491
"xpack.upgradeAssistant.esDeprecations.clusterSettings.resolutionTooltipLabel": "通过从此集群中移除设置来解决该问题。此问题会自动解决。",
47492-
"xpack.upgradeAssistant.esDeprecations.dataStream.reindexLoadingStatusText": "正在加载状态……",
47493-
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionLabel": "标记为只读,或重新索引",
47494-
"xpack.upgradeAssistant.esDeprecations.dataStream.resolutionTooltipLabel": "请通过重新索引该数据流或将其索引标记为只读来解决此问题。此问题会自动解决。",
4749547492
"xpack.upgradeAssistant.esDeprecations.dataStreamsTypeLabel": "数据流",
4749647493
"xpack.upgradeAssistant.esDeprecations.defaultDeprecation.manualCellLabel": "手动",
4749747494
"xpack.upgradeAssistant.esDeprecations.deprecationDetailsFlyout.closeButtonLabel": "关闭",

x-pack/platform/plugins/private/upgrade_assistant/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ These surface runtime deprecations, e.g. a Painless script that uses a deprecate
2929
request to a deprecated API. These are also generally surfaced as deprecation headers within the
3030
response. Even if the cluster state is good, app maintainers need to watch the logs in case
3131
deprecations are discovered as data is migrated. Starting in 7.x, deprecation logs can be written to a file or a data stream ([#58924](https://github.com/elastic/elasticsearch/pull/58924)). When the data stream exists, the Upgrade Assistant provides a way to analyze the logs through Observability or Discover ([#106521](https://github.com/elastic/kibana/pull/106521)).
32-
* [**Kibana deprecations API.**](https://github.com/elastic/kibana/blob/main/src/core/server/docs/kib_core_deprecations_service.mdx) This is information about deprecated features and configs in Kibana. These deprecations are only communicated to the user if the deployment is using these features. Kibana engineers are responsible for adding deprecations to the deprecations API for their respective team.
32+
* [**Kibana deprecations API.**](https://github.com/elastic/kibana/blob/main/src/core/server/deprecations/README.mdx) This is information about deprecated features and configs in Kibana. These deprecations are only communicated to the user if the deployment is using these features. Kibana engineers are responsible for adding deprecations to the deprecations API for their respective team.
3333

3434
### Fixing problems
3535

x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/es_deprecations/mocked_responses.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export const MOCK_REINDEX_DEPRECATION: EnrichedDeprecationInfo = {
3535
index: 'reindex_index',
3636
correctiveAction: {
3737
type: 'reindex',
38+
metadata: {
39+
isClosedIndex: false,
40+
isFrozenIndex: false,
41+
isInDataStream: false,
42+
},
3843
},
3944
};
4045

x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/es_deprecations/reindex_deprecation_flyout.test.ts

Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ const defaultReindexStatusMeta: ReindexStatusResponse['meta'] = {
2121
indexName: 'foo',
2222
reindexName: 'reindexed-foo',
2323
aliases: [],
24+
isFrozen: false,
25+
isReadonly: false,
26+
isInDataStream: false,
2427
};
2528

2629
describe('Reindex deprecation flyout', () => {
@@ -75,28 +78,22 @@ describe('Reindex deprecation flyout', () => {
7578

7679
expect(exists('reindexDetails')).toBe(true);
7780
expect(find('reindexDetails.flyoutTitle').text()).toContain(
78-
`Reindex ${reindexDeprecation.index}`
81+
`Update ${reindexDeprecation.index}`
7982
);
8083
});
8184

8285
it('renders error callout when reindex fails', async () => {
83-
await act(async () => {
84-
testBed = await setupElasticsearchPage(httpSetup);
85-
});
86-
87-
testBed.component.update();
88-
89-
const { actions, exists } = testBed;
90-
91-
await actions.table.clickDeprecationRowAt('reindex', 0);
92-
9386
httpRequestsMockHelpers.setStartReindexingResponse(MOCK_REINDEX_DEPRECATION.index!, undefined, {
9487
statusCode: 404,
9588
message: 'no such index [test]',
9689
});
9790

98-
await actions.reindexDeprecationFlyout.clickReindexButton();
91+
const { actions, exists } = testBed;
9992

93+
await actions.table.clickDeprecationRowAt('reindex', 0);
94+
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
95+
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step
96+
expect(exists('reindexDetails')).toBe(true);
10097
expect(exists('reindexDetails.reindexingFailedCallout')).toBe(true);
10198
});
10299

@@ -106,28 +103,16 @@ describe('Reindex deprecation flyout', () => {
106103
message: 'no such index [test]',
107104
});
108105

109-
await act(async () => {
110-
testBed = await setupElasticsearchPage(httpSetup);
111-
});
112-
113-
testBed.component.update();
114-
115106
const { actions, exists } = testBed;
116107

117108
await actions.table.clickDeprecationRowAt('reindex', 0);
109+
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
110+
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step
118111

119112
expect(exists('reindexDetails.fetchFailedCallout')).toBe(true);
120113
});
121114

122115
describe('reindexing progress', () => {
123-
it('has not started yet', async () => {
124-
const { actions, find, exists } = testBed;
125-
126-
await actions.table.clickDeprecationRowAt('reindex', 0);
127-
expect(find('reindexChecklistTitle').text()).toEqual('Reindexing process');
128-
expect(exists('cancelReindexingDocumentsButton')).toBe(false);
129-
});
130-
131116
it('has started but not yet reindexing documents', async () => {
132117
httpRequestsMockHelpers.setReindexStatusResponse(MOCK_REINDEX_DEPRECATION.index!, {
133118
reindexOp: {
@@ -140,14 +125,11 @@ describe('Reindex deprecation flyout', () => {
140125
meta: defaultReindexStatusMeta,
141126
});
142127

143-
await act(async () => {
144-
testBed = await setupElasticsearchPage(httpSetup);
145-
});
146-
147-
testBed.component.update();
148128
const { actions, find, exists } = testBed;
149129

150130
await actions.table.clickDeprecationRowAt('reindex', 0);
131+
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
132+
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step
151133

152134
expect(find('reindexChecklistTitle').text()).toEqual('Reindexing in progress… 5%');
153135
expect(exists('cancelReindexingDocumentsButton')).toBe(false);
@@ -165,14 +147,11 @@ describe('Reindex deprecation flyout', () => {
165147
meta: defaultReindexStatusMeta,
166148
});
167149

168-
await act(async () => {
169-
testBed = await setupElasticsearchPage(httpSetup);
170-
});
171-
172-
testBed.component.update();
173150
const { actions, find, exists } = testBed;
174151

175152
await actions.table.clickDeprecationRowAt('reindex', 0);
153+
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
154+
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step
176155

177156
expect(find('reindexChecklistTitle').text()).toEqual('Reindexing in progress… 30%');
178157
expect(exists('cancelReindexingDocumentsButton')).toBe(true);
@@ -190,14 +169,11 @@ describe('Reindex deprecation flyout', () => {
190169
meta: defaultReindexStatusMeta,
191170
});
192171

193-
await act(async () => {
194-
testBed = await setupElasticsearchPage(httpSetup);
195-
});
196-
197-
testBed.component.update();
198172
const { actions, find, exists } = testBed;
199173

200174
await actions.table.clickDeprecationRowAt('reindex', 0);
175+
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
176+
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step
201177

202178
expect(find('reindexChecklistTitle').text()).toEqual('Reindexing in progress… 90%');
203179
expect(exists('cancelReindexingDocumentsButton')).toBe(false);
@@ -215,14 +191,11 @@ describe('Reindex deprecation flyout', () => {
215191
meta: defaultReindexStatusMeta,
216192
});
217193

218-
await act(async () => {
219-
testBed = await setupElasticsearchPage(httpSetup);
220-
});
221-
222194
const { actions, find, exists, component } = testBed;
223-
component.update();
224195

225196
await actions.table.clickDeprecationRowAt('reindex', 0);
197+
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
198+
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step
226199

227200
expect(find('reindexChecklistTitle').text()).toEqual('Reindexing in progress… 95%');
228201
expect(exists('cancelReindexingDocumentsButton')).toBe(false);
@@ -250,14 +223,11 @@ describe('Reindex deprecation flyout', () => {
250223
},
251224
]);
252225

253-
await act(async () => {
254-
testBed = await setupElasticsearchPage(httpSetup);
255-
});
256-
257-
testBed.component.update();
258226
const { actions, find } = testBed;
259227

260228
await actions.table.clickDeprecationRowAt('reindex', 0);
229+
await actions.reindexDeprecationFlyout.clickReindexButton(); // details step
230+
await actions.reindexDeprecationFlyout.clickReindexButton(); // warning step
261231

262232
expect(find('lowDiskSpaceCallout').text()).toContain('Nodes with low disk space');
263233
expect(find('impactedNodeListItem').length).toEqual(1);

x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/helpers/app_context.mock.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const servicesMock = {
5151
const idToUrlMap = {
5252
SNAPSHOT_RESTORE_LOCATOR: 'snapshotAndRestoreUrl',
5353
DISCOVER_APP_LOCATOR: 'discoverUrl',
54+
OBS_LOGS_EXPLORER_DATA_VIEW_LOCATOR: 'logsExplorerUrl',
5455
};
5556
type IdKey = keyof typeof idToUrlMap;
5657

@@ -75,6 +76,7 @@ shareMock.url.locators.get = (id: IdKey) => ({
7576
});
7677

7778
export const getAppContextMock = (kibanaVersion: SemVer) => ({
79+
dataSourceExclusions: {},
7880
featureSet: {
7981
mlSnapshots: true,
8082
migrateSystemIndices: true,

0 commit comments

Comments
 (0)