forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.18] [UA] Implement read-only and unfreeze flows for indices (elast…
…ic#210199) (elastic#211361) # Backport This will backport the following commits from `8.x` to `8.18`: - [[UA] Implement read-only and unfreeze flows for indices (elastic#210199)](elastic#210199) <!--- Backport version: 9.6.4 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Gerard Soldevila","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-14T16:09:38Z","message":"[UA] Implement read-only and unfreeze flows for indices (elastic#210199)\n\n## Summary\r\n\r\nAddress https://github.com/elastic/kibana-team/issues/1418,\r\nhttps://github.com/elastic/kibana/issues/205945\r\n\r\n* Implement the \"make readonly\" flow for _old index_ deprecations.\r\n* Implement the \"unfreeze\" flow for _old indices_ that are frozen and\r\n`verified_read_only: true` (making them read-only is no longer an option\r\nfor those).\r\n* Refactor the code so that the \"reindex\" flyout steps are generalised\r\nto support the new flows.\r\n* Rename vars with misleading names (see\r\nhttps://github.com/elastic/pull/209522).\r\n\r\n---------\r\n\r\nCo-authored-by: Rudolf Meijering <[email protected]>","sha":"3768c353b4ba0420e7d4e55100312d88b727cb3c","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","v9.0.0","backport:version","v8.18.0"],"title":"[UA] Implement read-only and unfreeze flows for indices","number":210199,"url":"https://github.com/elastic/kibana/pull/210199","mergeCommit":{"message":"[UA] Implement read-only and unfreeze flows for indices (elastic#210199)\n\n## Summary\r\n\r\nAddress https://github.com/elastic/kibana-team/issues/1418,\r\nhttps://github.com/elastic/kibana/issues/205945\r\n\r\n* Implement the \"make readonly\" flow for _old index_ deprecations.\r\n* Implement the \"unfreeze\" flow for _old indices_ that are frozen and\r\n`verified_read_only: true` (making them read-only is no longer an option\r\nfor those).\r\n* Refactor the code so that the \"reindex\" flyout steps are generalised\r\nto support the new flows.\r\n* Rename vars with misleading names (see\r\nhttps://github.com/elastic/pull/209522).\r\n\r\n---------\r\n\r\nCo-authored-by: Rudolf Meijering <[email protected]>","sha":"3768c353b4ba0420e7d4e55100312d88b727cb3c"}},"sourceBranch":"8.x","suggestedTargetBranches":["9.0","8.18"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
- Loading branch information
1 parent
f11680d
commit 8b1f5f1
Showing
62 changed files
with
2,828 additions
and
830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 56 additions & 56 deletions
112
x-pack/platform/plugins/private/translations/translations/fr-FR.json
Large diffs are not rendered by default.
Oops, something went wrong.
112 changes: 56 additions & 56 deletions
112
x-pack/platform/plugins/private/translations/translations/ja-JP.json
Large diffs are not rendered by default.
Oops, something went wrong.
112 changes: 56 additions & 56 deletions
112
x-pack/platform/plugins/private/translations/translations/zh-CN.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
x-pack/platform/plugins/private/upgrade_assistant/common/update_index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export type UpdateIndexOperation = 'blockWrite' | 'unfreeze'; |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...stant/public/application/components/es_deprecations/deprecation_types/indices/context.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React, { createContext, useContext } from 'react'; | ||
|
||
import { ApiService } from '../../../../lib/api'; | ||
import { useReindex, ReindexState } from './use_reindex'; | ||
import { UpdateIndexState, useUpdateIndex } from './use_update_index'; | ||
import { EnrichedDeprecationInfo } from '../../../../../../common/types'; | ||
|
||
export interface IndexStateContext { | ||
deprecation: EnrichedDeprecationInfo; | ||
reindexState: ReindexState; | ||
startReindex: () => Promise<void>; | ||
cancelReindex: () => Promise<void>; | ||
updateIndexState: UpdateIndexState; | ||
updateIndex: () => Promise<void>; | ||
} | ||
|
||
const IndexContext = createContext<IndexStateContext | undefined>(undefined); | ||
|
||
export const useIndexContext = () => { | ||
const context = useContext(IndexContext); | ||
if (context === undefined) { | ||
throw new Error('useIndexContext must be used within a <IndexStatusProvider />'); | ||
} | ||
return context; | ||
}; | ||
|
||
interface Props { | ||
api: ApiService; | ||
children: React.ReactNode; | ||
deprecation: EnrichedDeprecationInfo; | ||
} | ||
|
||
export const IndexStatusProvider: React.FunctionComponent<Props> = ({ | ||
api, | ||
deprecation, | ||
children, | ||
}) => { | ||
const indexName = deprecation.index!; | ||
const { reindexState, startReindex, cancelReindex } = useReindex({ | ||
indexName, | ||
api, | ||
}); | ||
|
||
const { updateIndexState, updateIndex } = useUpdateIndex({ | ||
indexName, | ||
api, | ||
correctiveAction: deprecation.correctiveAction, | ||
}); | ||
|
||
return ( | ||
<IndexContext.Provider | ||
value={{ | ||
deprecation, | ||
reindexState, | ||
startReindex, | ||
cancelReindex, | ||
updateIndexState, | ||
updateIndex, | ||
}} | ||
> | ||
{children} | ||
</IndexContext.Provider> | ||
); | ||
}; |
Oops, something went wrong.