Skip to content

Commit

Permalink
[Index Management] Add bulk edit data retention (elastic#203083)
Browse files Browse the repository at this point in the history
Closes elastic#165142

## Summary

This PR adds bulk edit data retention to Data streams table.

On all offerings apart from serverless security project:


https://github.com/user-attachments/assets/aa091fc1-5029-4542-b76b-8045c65dda27


On serverless security project:



https://github.com/user-attachments/assets/cbccc8bd-d3f1-4511-8134-bfb0a9e8587f





### How to test:

Testing in serverless security project:
1. Start ES with `yarn es serverless --projectType security -E
data_streams.lifecycle.retention.max=200d` and Kibana with `yarn
serverless-security`
2. Navigate to console and create a few data streams following [these
instructions](https://www.elastic.co/guide/en/elasticsearch/reference/current/set-up-a-data-stream.html#create-component-templates)
3. Navigate to Index Management -> Data streams
4. Select multiple data streams and click on bulk edit data retention
button
5. Verify that:
- The help text displays the set max data retention with a link to
cloud.
- The form doesn't allow setting a data retention higher than the max
data retention.
- If any of the data streams has a reduced data retention period, an
error banner is shown, displaying the affected data streams.


Testing in stateful and searc/oblt serverless project:
1. Start ES with `yarn es serverless` and Kibana with `yarn
serverless-security`
2. Navigate to console and create a few data streams following [this
instructions](https://www.elastic.co/guide/en/elasticsearch/reference/current/set-up-a-data-stream.html#create-component-templates)
3. Navigate to Index Management -> Data streams
4. Select multiple data streams and click on bulk edit data retention
button
5. Verify that:
- There is no help text displaying the max data retention and no
validation for the data retention period.
- If any of the data streams has a reduced data retention period, an
error banner is shown, displaying the affected data streams.

Configure cloud locally by adding the following to
`config/kibana.dev.yml` and restarting Kibana:
```
xpack.cloud.id: 'test'
xpack.cloud.base_url: "https://cloud.elastic.co"
xpack.cloud.deployment_url: "/deployments/deploymentId"
```


### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed -
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7619

---------

Co-authored-by: kibanamachine <[email protected]>
  • Loading branch information
ElenaStoeva and kibanamachine authored Dec 19, 2024
1 parent 094e4ae commit f72b63f
Show file tree
Hide file tree
Showing 23 changed files with 840 additions and 341 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22141,7 +22141,6 @@
"xpack.idxMgmt.dataStreamList.table.actionDeleteText": "Supprimer",
"xpack.idxMgmt.dataStreamList.table.dataRetentionColumnTitle": "Conservation des données",
"xpack.idxMgmt.dataStreamList.table.dataRetentionColumnTooltip": "Les données sont conservées au moins pour cette durée avant leur suppression automatique. La valeur de rétention de données s'applique uniquement aux données gérées directement par le flux de données. {canDisableDataRetention, plural, one {Si certaines données sont sujettes à une politique de gestion du cycle de vie de l'index, alors la valeur de conservation des données réglée pour le flux de données ne s'applique par à ces données.} other {}}",
"xpack.idxMgmt.dataStreamList.table.deleteDataStreamsButtonLabel": "Supprimer {count, plural, one {le flux de données} other {les flux de données} }",
"xpack.idxMgmt.dataStreamList.table.healthColumnTitle": "Intégrité",
"xpack.idxMgmt.dataStreamList.table.hiddenDataStreamBadge": "Masqué",
"xpack.idxMgmt.dataStreamList.table.indicesColumnTitle": "Index",
Expand All @@ -22157,22 +22156,16 @@
"xpack.idxMgmt.dataStreamListControls.includeStatsSwitchLabel": "Statistiques incluses",
"xpack.idxMgmt.dataStreamListControls.includeStatsSwitchToolTip": "L'inclusion de statistiques peut augmenter le temps de rechargement",
"xpack.idxMgmt.dataStreamListDescription.learnMoreLinkText": "En savoir plus.",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.cancelButtonLabel": "Annuler",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionEnabledField": "Activer la conservation des données",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionField": "Conservation des données",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionFieldNonNegativeError": "Une valeur positive est requise.",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionFieldRequiredError": "Une valeur de conservation des données est requise.",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.errorDataRetentionNotification": "Erreur lors de la mise à niveau de la conservation des données : \"{error}\"",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.fullyManagedByILMButtonLabel": "Stratégie ILM",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.fullyManagedByILMDescription": "Afin de modifier la conservation des données pour ce flux de données, vous devez modifier le {link} associé.",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.fullyManagedByILMTitle": "Ce flux de données et les index associés sont gérés par la stratégie ILM",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.learnMoreLinkText": "Comment ça fonctionne ?",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.saveButtonLabel": "Enregistrer",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.someManagedByILMBody": "Un index ou plus sont gérés par une politique ILM ({viewAllIndicesLink}). La mise à niveau de la conservation des données pour ce flux de données n'aura pas d'incidence sur ces index. À la place, vous devrez mettre à niveau la politique {ilmPolicyLink}.",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.someManagedByILMTitle": "Certains index sont gérés par la stratégie ILM",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.successDataRetentionNotification": "Conservation des données {disabledDataRetention, plural, one { désactivée } other { mise à niveau } }",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.timeUnitField": "Unité de temps",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.unitsAriaLabel": "Unité de temps",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.viewAllIndices": "afficher les index",
"xpack.idxMgmt.dataStreamsDetailsPanel.manageButtonLabel": "Gérer",
"xpack.idxMgmt.dataStreamsDetailsPanel.stepLogistics.dataRetentionFieldDecimalError": "La valeur doit être un nombre entier.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21999,7 +21999,6 @@
"xpack.idxMgmt.dataStreamList.table.actionDeleteText": "削除",
"xpack.idxMgmt.dataStreamList.table.dataRetentionColumnTitle": "データ保持",
"xpack.idxMgmt.dataStreamList.table.dataRetentionColumnTooltip": "データは少なくともこの期間保存された後、自動的に削除されます。データ保持値は、データストリームによって直接管理されたデータにのみ適用されます。{canDisableDataRetention, plural, one {一部のデータにインデックスライフサイクル管理ポリシーが適用される場合、データストリームに設定されたデータ保持値はそのデータに適用されません。} other {}}",
"xpack.idxMgmt.dataStreamList.table.deleteDataStreamsButtonLabel": "{count, plural, other {個のデータストリーム}}を削除",
"xpack.idxMgmt.dataStreamList.table.healthColumnTitle": "ヘルス",
"xpack.idxMgmt.dataStreamList.table.hiddenDataStreamBadge": "非表示",
"xpack.idxMgmt.dataStreamList.table.indicesColumnTitle": "インデックス",
Expand All @@ -22015,22 +22014,16 @@
"xpack.idxMgmt.dataStreamListControls.includeStatsSwitchLabel": "統計情報を含める",
"xpack.idxMgmt.dataStreamListControls.includeStatsSwitchToolTip": "統計情報を含めると、再読み込み時間が長くなることがあります",
"xpack.idxMgmt.dataStreamListDescription.learnMoreLinkText": "詳細情報",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.cancelButtonLabel": "キャンセル",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionEnabledField": "データ保持を有効化",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionField": "データ保持",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionFieldNonNegativeError": "正の値が必要です。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionFieldRequiredError": "データ保持値が必要です。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.errorDataRetentionNotification": "データ保持の更新エラー:''{error}''",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.fullyManagedByILMButtonLabel": "ILMポリシー",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.fullyManagedByILMDescription": "このデータストリームのデータ保持を編集するには、関連する{link}を編集する必要があります。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.fullyManagedByILMTitle": "このデータストリームと関連するインデックスはILMによって管理されます。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.learnMoreLinkText": "仕組み",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.saveButtonLabel": "保存",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.someManagedByILMBody": "ILMポリシー({viewAllIndicesLink})によって1つ以上のインデックスが管理されます。このデータストリームのデータ保持を更新しても、これらのインデックスには影響しません。代わりに、{ilmPolicyLink}ポリシーを更新する必要があります。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.someManagedByILMTitle": "一部のインデックスはILMによって管理されます。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.successDataRetentionNotification": "データ保持が{disabledDataRetention, plural, one {無効化されました} other {更新されました} }",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.timeUnitField": "時間単位",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.unitsAriaLabel": "時間単位",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.viewAllIndices": "インデックスを表示",
"xpack.idxMgmt.dataStreamsDetailsPanel.manageButtonLabel": "管理",
"xpack.idxMgmt.dataStreamsDetailsPanel.stepLogistics.dataRetentionFieldDecimalError": "値は整数でなければなりません。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21653,7 +21653,6 @@
"xpack.idxMgmt.dataStreamList.table.actionDeleteText": "删除",
"xpack.idxMgmt.dataStreamList.table.dataRetentionColumnTitle": "数据保留",
"xpack.idxMgmt.dataStreamList.table.dataRetentionColumnTooltip": "会至少在这个时长内保留数据,然后自动将其删除。数据保留值仅适用于由数据流直接管理的数据。{canDisableDataRetention, plural, one {如果某些数据受索引生命周期管理策略约束,则为数据流设置的数据保留值不适用于该数据。} other {}}",
"xpack.idxMgmt.dataStreamList.table.deleteDataStreamsButtonLabel": "删除{count, plural, other {数据流} }",
"xpack.idxMgmt.dataStreamList.table.healthColumnTitle": "运行状况",
"xpack.idxMgmt.dataStreamList.table.hiddenDataStreamBadge": "隐藏",
"xpack.idxMgmt.dataStreamList.table.indicesColumnTitle": "索引",
Expand All @@ -21669,21 +21668,16 @@
"xpack.idxMgmt.dataStreamListControls.includeStatsSwitchLabel": "包含统计信息",
"xpack.idxMgmt.dataStreamListControls.includeStatsSwitchToolTip": "包含统计信息可能会延长重新加载时间",
"xpack.idxMgmt.dataStreamListDescription.learnMoreLinkText": "了解详情。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.cancelButtonLabel": "取消",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionEnabledField": "启用数据保留",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionField": "数据保留",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionFieldNonNegativeError": "需要提供正值。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.dataRetentionFieldRequiredError": "数据保留值必填。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.fullyManagedByILMButtonLabel": "ILM 策略",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.fullyManagedByILMDescription": "要编辑此数据流的数据保留,必须编辑其关联 {link}。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.fullyManagedByILMTitle": "此数据流及其关联索引由 ILM 管理",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.learnMoreLinkText": "工作原理?",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.saveButtonLabel": "保存",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.someManagedByILMBody": "一个或多个索引由 ILM 策略管理 ({viewAllIndicesLink})。更新此数据流的数据保留不会影响到这些索引。相反,您必须更新 {ilmPolicyLink} 策略。",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.someManagedByILMTitle": "某些索引由 ILM 管理",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.successDataRetentionNotification": "数据保留{disabledDataRetention, plural, one {已禁用} other {已更新} }",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.timeUnitField": "时间单位",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.unitsAriaLabel": "时间单位",
"xpack.idxMgmt.dataStreamsDetailsPanel.editDataRetentionModal.viewAllIndices": "查看索引",
"xpack.idxMgmt.dataStreamsDetailsPanel.manageButtonLabel": "管理",
"xpack.idxMgmt.dataStreamsDetailsPanel.stepLogistics.dataRetentionFieldDecimalError": "此值应为整数。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export interface DataStreamsTabTestBed extends TestBed<TestSubjects> {
clickDeleteDataStreamButton: () => void;
clickEditDataRetentionButton: () => void;
clickDetailPanelIndexTemplateLink: () => void;
clickManageDataStreamsButton: () => void;
clickBulkEditDataRetentionButton: () => void;
};
findDeleteActionAt: (index: number) => ReactWrapper;
findDeleteConfirmationModal: () => ReactWrapper;
Expand Down Expand Up @@ -210,6 +212,14 @@ export const setup = async (
component.update();
};

const clickManageDataStreamsButton = () => {
testBed.find('dataStreamActionsPopoverButton').simulate('click');
};

const clickBulkEditDataRetentionButton = () => {
testBed.find('bulkEditDataRetentionButton').simulate('click');
};

const findDetailPanel = () => {
const { find } = testBed;
return find('dataStreamDetailPanel');
Expand Down Expand Up @@ -258,6 +268,8 @@ export const setup = async (
clickDeleteDataStreamButton,
clickEditDataRetentionButton,
clickDetailPanelIndexTemplateLink,
clickManageDataStreamsButton,
clickBulkEditDataRetentionButton,
},
findDeleteActionAt,
findDeleteConfirmationModal,
Expand Down
Loading

0 comments on commit f72b63f

Please sign in to comment.