-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for marking component templates as deprecated #101148
Add support for marking component templates as deprecated #101148
Conversation
They'll also not appear when using a wildcard search by default
server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplate.java
Outdated
Show resolved
Hide resolved
…entTemplate.java Co-authored-by: eyalkoren <41850454+eyalkoren@users.noreply.github.com>
also add docs
…ort version is sufficient
Hi @felixbarny, I've created a changelog YAML for you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks like a good start to me, I don't have anything other than minor comments so far
server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplate.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/cluster/metadata/ComponentTemplateTests.java
Outdated
Show resolved
Hide resolved
server/src/test/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplateTests.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicyTests.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexTemplateService.java
Show resolved
Hide resolved
Pinging @elastic/es-data-management (Team:Data Management) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. I left some minor comments but nothing major. I think this will require merging master and adjusting the TransportVersions before merging though.
server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplate.java
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplate.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplate.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/metadata/ComponentTemplate.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java
Outdated
Show resolved
Hide resolved
@@ -809,6 +809,10 @@ public static boolean randomBoolean() { | |||
return random().nextBoolean(); | |||
} | |||
|
|||
public static Boolean randomOptionalBoolean() { | |||
return randomBoolean() ? Boolean.TRUE : randomFrom(Boolean.FALSE, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changes the statistics of the responses somewhat, what about
return randomBoolean() ? Boolean.TRUE : randomFrom(Boolean.FALSE, null); | |
return randomFrom(Boolean.TRUE, Boolean.FALSE, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was on purpose because otherwise, "falsey" return values (Boolean.FALSE
, null
) would have a higher probability. As this is a new method, and mostly used for new code, it doesn't really alter existing behavior. But it does assume that null
is equivalent to false
, which may not always be true in all cases.
I'll leave this as-is for now but happy to change if you still think it would be better. But I'll not block merging.
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/LifecyclePolicy.java
Outdated
Show resolved
Hide resolved
Partially addresses #170805 ## Summary With elastic/elasticsearch#101148 we now can alert the users when an ingest pipeline will soon be deprecated and shouldnt be relied upon. This PR adds a badge and a callout to the ingest pipelines UI to alert the users about this. ##### How to test * Start up kibana and es * Navigate to Stack management -> Ingest pipelines * Verify that: * Deprecated pipelines are hidden by default * Upon enabling filtering to see them they should pop up on the table with a badge * Verify that deprecated policies are highlighted and when editing, we also show a warning callout. ### Screenshot <img width="1386" alt="Screenshot 2024-02-05 at 16 02 18" src="https://github.com/elastic/kibana/assets/6585477/739d6fea-5f15-4da4-aee8-cae8f412a040"> --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com> Co-authored-by: Yulia Cech <yulia.cech@elastic.co>
…onent template UIs (#174450) Partially addresses #170805 ## Summary With elastic/elasticsearch#101148 we now can alert the users when a component template or index template will soon be deprecated and shouldnt be relied upon. This PR adds a badge and a callout to the component template and index template UIs to alert the users about this. ##### How to test * Start up kibana and es * Navigate to Stack management -> index management (component_templates|index_templates) * Verify that: * Deprecated resources are hidden by default * Upon enabling filtering to see them they should pop up on the table with a badge * Verify that deprecated resources are highlighted and when editing, we also show a warning callout. <details> <summary>Create deprecated component template</summary> ``` PUT _component_template/template_1 { "template": { "settings" : { "number_of_shards" : 1 } }, "deprecated": true } ``` </details> <details> <summary>Screenshots</summary> // index templates     // component templates     </details> --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com> Co-authored-by: Yulia Cech <yulia.cech@elastic.co>
Partially addresses elastic#170805 ## Summary With elastic/elasticsearch#101148 we now can alert the users when an ingest pipeline will soon be deprecated and shouldnt be relied upon. This PR adds a badge and a callout to the ingest pipelines UI to alert the users about this. ##### How to test * Start up kibana and es * Navigate to Stack management -> Ingest pipelines * Verify that: * Deprecated pipelines are hidden by default * Upon enabling filtering to see them they should pop up on the table with a badge * Verify that deprecated policies are highlighted and when editing, we also show a warning callout. ### Screenshot <img width="1386" alt="Screenshot 2024-02-05 at 16 02 18" src="https://github.com/elastic/kibana/assets/6585477/739d6fea-5f15-4da4-aee8-cae8f412a040"> --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com> Co-authored-by: Yulia Cech <yulia.cech@elastic.co>
…onent template UIs (elastic#174450) Partially addresses elastic#170805 ## Summary With elastic/elasticsearch#101148 we now can alert the users when a component template or index template will soon be deprecated and shouldnt be relied upon. This PR adds a badge and a callout to the component template and index template UIs to alert the users about this. ##### How to test * Start up kibana and es * Navigate to Stack management -> index management (component_templates|index_templates) * Verify that: * Deprecated resources are hidden by default * Upon enabling filtering to see them they should pop up on the table with a badge * Verify that deprecated resources are highlighted and when editing, we also show a warning callout. <details> <summary>Create deprecated component template</summary> ``` PUT _component_template/template_1 { "template": { "settings" : { "number_of_shards" : 1 } }, "deprecated": true } ``` </details> <details> <summary>Screenshots</summary> // index templates     // component templates     </details> --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com> Co-authored-by: Yulia Cech <yulia.cech@elastic.co>
Partially addresses elastic#170805 ## Summary With elastic/elasticsearch#101148 we now can alert the users when an ingest pipeline will soon be deprecated and shouldnt be relied upon. This PR adds a badge and a callout to the ingest pipelines UI to alert the users about this. ##### How to test * Start up kibana and es * Navigate to Stack management -> Ingest pipelines * Verify that: * Deprecated pipelines are hidden by default * Upon enabling filtering to see them they should pop up on the table with a badge * Verify that deprecated policies are highlighted and when editing, we also show a warning callout. ### Screenshot <img width="1386" alt="Screenshot 2024-02-05 at 16 02 18" src="https://github.com/elastic/kibana/assets/6585477/739d6fea-5f15-4da4-aee8-cae8f412a040"> --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com> Co-authored-by: Yulia Cech <yulia.cech@elastic.co>
…onent template UIs (elastic#174450) Partially addresses elastic#170805 ## Summary With elastic/elasticsearch#101148 we now can alert the users when a component template or index template will soon be deprecated and shouldnt be relied upon. This PR adds a badge and a callout to the component template and index template UIs to alert the users about this. ##### How to test * Start up kibana and es * Navigate to Stack management -> index management (component_templates|index_templates) * Verify that: * Deprecated resources are hidden by default * Upon enabling filtering to see them they should pop up on the table with a badge * Verify that deprecated resources are highlighted and when editing, we also show a warning callout. <details> <summary>Create deprecated component template</summary> ``` PUT _component_template/template_1 { "template": { "settings" : { "number_of_shards" : 1 } }, "deprecated": true } ``` </details> <details> <summary>Screenshots</summary> // index templates     // component templates     </details> --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com> Co-authored-by: Yulia Cech <yulia.cech@elastic.co>
Partially addresses elastic#170805 ## Summary With elastic/elasticsearch#101148 we now can alert the users when an ingest pipeline will soon be deprecated and shouldnt be relied upon. This PR adds a badge and a callout to the ingest pipelines UI to alert the users about this. ##### How to test * Start up kibana and es * Navigate to Stack management -> Ingest pipelines * Verify that: * Deprecated pipelines are hidden by default * Upon enabling filtering to see them they should pop up on the table with a badge * Verify that deprecated policies are highlighted and when editing, we also show a warning callout. ### Screenshot <img width="1386" alt="Screenshot 2024-02-05 at 16 02 18" src="https://github.com/elastic/kibana/assets/6585477/739d6fea-5f15-4da4-aee8-cae8f412a040"> --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com> Co-authored-by: Yulia Cech <yulia.cech@elastic.co>
…onent template UIs (elastic#174450) Partially addresses elastic#170805 ## Summary With elastic/elasticsearch#101148 we now can alert the users when a component template or index template will soon be deprecated and shouldnt be relied upon. This PR adds a badge and a callout to the component template and index template UIs to alert the users about this. ##### How to test * Start up kibana and es * Navigate to Stack management -> index management (component_templates|index_templates) * Verify that: * Deprecated resources are hidden by default * Upon enabling filtering to see them they should pop up on the table with a badge * Verify that deprecated resources are highlighted and when editing, we also show a warning callout. <details> <summary>Create deprecated component template</summary> ``` PUT _component_template/template_1 { "template": { "settings" : { "number_of_shards" : 1 } }, "deprecated": true } ``` </details> <details> <summary>Screenshots</summary> // index templates     // component templates     </details> --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Yulia Čech <6585477+yuliacech@users.noreply.github.com> Co-authored-by: Yulia Cech <yulia.cech@elastic.co>
Deprecated component templates don't appear when using a wildcard search by default.
This also needs to be extended to composable index templates, ILM policies, and ingest pipelines.
At this point this is just a POC and means as a conversation starter on whether it's worth implementing this.
closes #100992