-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Ingest Pipelines] Add generated copy for all processors #95507
[Ingest Pipelines] Add generated copy for all processors #95507
Conversation
generic processor descriptions - added initial pass of generated descriptions for all processors
defaultMessage: | ||
"Appends values to a field's array. If the field contains a single value, the processor first converts it to an array. If the field doesn't exist, the processor creates an array containing the appended values.", | ||
}), | ||
getDefaultDescription: ({ field, value }) => | ||
i18n.translate('xpack.ingestPipelines.processors.defaultDescription.append', { | ||
defaultMessage: 'Appends "{value}" to the "{field}" field', |
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.
I like to write commit messages as commands, so I personally would prefer to see this written as "Append" instead of "Appends", and the other descriptions updated similarly. This also makes the messages just a bit shorter. 🤷 I dunno, I'll defer to whatever the writers think is best. :)
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.
Yeah the current writeup was very WIP, just to get the general format done, I was later going to reach out to at least a few others to see if someone can do some rewriting of the actual text, as it's not currently in top shape :)
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.
I disagree. The ingest processor takes action on the provided input. I like to think of it in a sentence and ask the question, "What does this <name_of_thing>
do?" For example:
"What does this machine do?" --> "It grinds coffee beans."
You wouldn't say, "It grind coffee beans". Each of the ingest processor descriptions use this same format. For example, the Append processor "Appends one or more values to an existing array...."
cc: @gchaps to add or clarify
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.
++ to what @lockewritesdocs said.
@jloleysens (cc @cjcenizal) This is great. I'm wondering if we can take a look at also appending the name to the "Processor" test that's shown in the form. For example, something like updating to Pipeline - "apm_user_agent". That way if the user wants to overwrite the generated description with something more custom/detailed such as "pipeline does this then this then this" they are still easily able to see the pipeline name independently. |
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@jethr0null just want to make sure I understand your suggestion correctly;
Would this apply to processors other than "Pipeline"? If I'm understanding correctly, I think your suggestion makes a lot of sense, but one way a user can solve for this need is by adding that value to their custom description. Otherwise, I think to add a special "extra" value for certain processors we should enumerate all cases and check which value specifically should always show. This might be best done in follow-up PR, but happy to update this opinion given more info :) |
…iption to appear as placeholder
@elasticmachine merge upstream |
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.
Strictly a CSS review - thanks for adding the notes, just one small suggestion.
|
||
// By default, flex sets the element width to "auto", we set this explicitly again to avoid the flex item growing beyond the width given | ||
// by flex. This applies to both of the classes below | ||
&__controlsFlexItem { |
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.
You could combine these into a single rule since they share the same, single style.
&__controlsFlexItem { | |
&__controlsFlexItem, &__descriptionContainer { | |
min-width: 0; | |
} |
…trings and doing better serialization
@elasticmachine merge upstream |
@elasticmachine merge upstream |
- slight update to SCSS classes to not have unused class
the KV processor value and field split fields accept " "
Thanks for the copy review @lockewritesdocs ! I believe I have addressed all of your feedback. Would you mind taking another look? |
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.
Great progress! However, there are still a few descriptions that don't display. I commented on each of those and indicated what might be the issue, plus suggested a few edits.
...blic/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx
Outdated
Show resolved
Hide resolved
}), | ||
getDefaultDescription: ({ if: value }) => | ||
value | ||
? i18n.translate('xpack.ingestPipelines.processors.defaultDescription.drop', { |
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.
? i18n.translate('xpack.ingestPipelines.processors.defaultDescription.drop', { | |
i18n.translate('xpack.ingestPipelines.processors.defaultDescription.drop', { |
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.
The description for Drop wasn't rendering, and I think the errant ?
might be why.
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.
See my comment regarding "Fail" below. Would this be a suitable alternative to always display:
"Drops documents without returning an error" 👈🏻 taken from the description provided for the type.
defaultMessage: | ||
'Returns a custom error message on failure. Often used to notify requesters of required conditions.', | ||
}), | ||
getDefaultDescription: ({ if: value }) => | ||
value | ||
? i18n.translate('xpack.ingestPipelines.processors.defaultDescription.fail', { |
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.
? i18n.translate('xpack.ingestPipelines.processors.defaultDescription.fail', { | |
i18n.translate('xpack.ingestPipelines.processors.defaultDescription.fail', { |
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.
The description for Fail wasn't rendering, and I think the errant ?
might be why.
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 ? :
combo is intentional at the moment. If we have no if
value; I recall we said that we don't actually want to display these in the default descriptions anyway, might this work:
"Raises an exception that halts execution"
getDefaultDescription: ({ field, processor }) => { | ||
const processorName = Object.keys(processor ?? {})[0]; | ||
return processorName | ||
? i18n.translate('xpack.ingestPipelines.processors.defaultDescription.foreach', { |
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.
? i18n.translate('xpack.ingestPipelines.processors.defaultDescription.foreach', { | |
i18n.translate('xpack.ingestPipelines.processors.defaultDescription.foreach', { |
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.
The description for Foreach wasn't rendering, and I think the errant ?
might be why.
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.
@lockewritesdocs This is the description for the Foreach processor. The ?
guards us from trying to build a default description if we bad data. This is a limitation that will be removed once we address #95906. Let me know if this is unclear!
...blic/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx
Outdated
Show resolved
Hide resolved
...blic/application/components/pipeline_editor/components/shared/map_processor_type_to_form.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
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.
One suggestion, but otherwise LGTM. Thanks for iterating @jloleysens!
const processorName = Object.keys(processor ?? {})[0]; | ||
return processorName | ||
? i18n.translate('xpack.ingestPipelines.processors.defaultDescription.foreach', { | ||
defaultMessage: 'Runs the "{processorName}" processor for each object in "{field}"', |
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.
defaultMessage: 'Runs the "{processorName}" processor for each object in "{field}"', | |
defaultMessage: 'Runs a processor for each object in "{field}"', |
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.
Suggest removing processorName
so that the default description displays if the user doesn't supply a processor name.
* - minor refactor of 'description' -> 'typeDescription' for generic processor descriptions - added initial pass of generated descriptions for all processors * fix i18n * added wrapping div and title to description and changed default description to appear as placeholder * reworked the description width and overflow styling * only show the text title on hover when we are not showing the text input * fixed a number of minor issues with using values as though they are strings and doing better serialization * slight optimisation to scss * - implement copy feedback - clean up a lot of uses of "target_field = field". it is better to not show these - made "replacement" a required field on gsub (which it was not) * revert the previouis validation as empty values are acceptbale for the replacement text * - updated the copy per feedback and fixed a missing i18n.translate - slight update to SCSS classes to not have unused class * Added an empty string field validator that accepts spaces so that the KV processor value and field split fields accept " " * replace use of HTML "title" with EuiToolTip * remove unused variable and import * implemented feedback; removed if from default descriptions and other minor updates * update default description of foreach to always display Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
* - minor refactor of 'description' -> 'typeDescription' for generic processor descriptions - added initial pass of generated descriptions for all processors * fix i18n * added wrapping div and title to description and changed default description to appear as placeholder * reworked the description width and overflow styling * only show the text title on hover when we are not showing the text input * fixed a number of minor issues with using values as though they are strings and doing better serialization * slight optimisation to scss * - implement copy feedback - clean up a lot of uses of "target_field = field". it is better to not show these - made "replacement" a required field on gsub (which it was not) * revert the previouis validation as empty values are acceptbale for the replacement text * - updated the copy per feedback and fixed a missing i18n.translate - slight update to SCSS classes to not have unused class * Added an empty string field validator that accepts spaces so that the KV processor value and field split fields accept " " * replace use of HTML "title" with EuiToolTip * remove unused variable and import * implemented feedback; removed if from default descriptions and other minor updates * update default description of foreach to always display Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…6660) * - minor refactor of 'description' -> 'typeDescription' for generic processor descriptions - added initial pass of generated descriptions for all processors * fix i18n * added wrapping div and title to description and changed default description to appear as placeholder * reworked the description width and overflow styling * only show the text title on hover when we are not showing the text input * fixed a number of minor issues with using values as though they are strings and doing better serialization * slight optimisation to scss * - implement copy feedback - clean up a lot of uses of "target_field = field". it is better to not show these - made "replacement" a required field on gsub (which it was not) * revert the previouis validation as empty values are acceptbale for the replacement text * - updated the copy per feedback and fixed a missing i18n.translate - slight update to SCSS classes to not have unused class * Added an empty string field validator that accepts spaces so that the KV processor value and field split fields accept " " * replace use of HTML "title" with EuiToolTip * remove unused variable and import * implemented feedback; removed if from default descriptions and other minor updates * update default description of foreach to always display Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
…6659) * - minor refactor of 'description' -> 'typeDescription' for generic processor descriptions - added initial pass of generated descriptions for all processors * fix i18n * added wrapping div and title to description and changed default description to appear as placeholder * reworked the description width and overflow styling * only show the text title on hover when we are not showing the text input * fixed a number of minor issues with using values as though they are strings and doing better serialization * slight optimisation to scss * - implement copy feedback - clean up a lot of uses of "target_field = field". it is better to not show these - made "replacement" a required field on gsub (which it was not) * revert the previouis validation as empty values are acceptbale for the replacement text * - updated the copy per feedback and fixed a missing i18n.translate - slight update to SCSS classes to not have unused class * Added an empty string field validator that accepts spaces so that the KV processor value and field split fields accept " " * replace use of HTML "title" with EuiToolTip * remove unused variable and import * implemented feedback; removed if from default descriptions and other minor updates * update default description of foreach to always display Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@jloleysens Could you please add a "Release note" section to this PR's description? I think users will love this feature and I've labeled it so it will be highlighted in the 7.13 release announcement. |
Great point @cjcenizal ! I just updated the description. |
💔 Build Failed
Failed CI StepsTest FailuresKibana Pipeline / general / X-Pack EPM API Integration Tests.x-pack/test/fleet_api_integration/apis/agents_setup·ts.Fleet Endpoints fleet_agents_setup "after all" hook for "should create or update the fleet_enroll user if called multiple times with forceRecreate flag"Standard Out
Stack Trace
Kibana Pipeline / general / X-Pack API Integration Tests.x-pack/test/api_integration/apis/security_solution/feature_controls·ts.apis SecuritySolution Endpoints feature controls APIs can't be accessed by user with no privilegesStandard Out
Stack Trace
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
Fix #95486
As described in #94432 we should provide descriptions for processors out of the box. Most processors are very simple and so helpful descriptions can be deduced from processor configuration.
This contribution adds:
Assists with addressing this elastic/elasticsearch#70442
Additional changes
Reworked the styling for the description width to function in the following way:
max-width: 600px
)title
attribute on containing div for this only when we are not showing that text input)min-width: auto
which overrides the defaultauto
which stops the flex item content from growing beyond the amount it is given byflex-grow: 1
Release note 🚀
We enhanced the Ingest Node Pipelines UI with generated, default descriptions for all ES processors. These descriptions are designed to be concise, processor-specific and provide an at-a-glance window into what a processor is doing. This eases the burden on users of having to provide good, often repetitive descriptions. Users still have the option of adding a custom description that will be stored in the pipeline configuration.
Checklist
Adding test coverage for this functionality in #97799