Skip to content
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] Polish pipeline debugging workflow #76058

Merged

Conversation

alisonelizabeth
Copy link
Contributor

@alisonelizabeth alisonelizabeth commented Aug 27, 2020

This PR contains a number of general usability and design improvements.

I tried to break the work up logically by commit (although I didn’t do the best job toward the end 😅). To test, please follow the same instructions in #74964 and ensure there are no regressions.

Notable changes:

  • More robust logic to determine the previous processor input (“Data in” accordion on the output tab of the processor flyout)
  • Better handling of re-running simulation
    • From the initial flow ("Add documents" button):
      • User can click the “Run the pipeline” button OR click the “Output” tab to rerun simulation.
      • Clicking "Refresh output" will refresh the output AND the verbose output (to refresh processor results)
    • From the processor flyout:
      • Simulation will run when clicking the “Update” button OR the “Output” tab.
      • If configuration changes are made, but the user cancels the submission, simulation will rerun with the original processors.
        • Note: I hit some oddities keeping the form in sync when going back and forth between the configuration and output tabs, so if you could test this area that would be appreciated!
  • Created a container component for the test_pipeline_flyout
  • Created two components for editing and adding a processor. This was previously one with conditional logic (formerly manage_processor_form). I felt this was getting overly complex, and there was enough divergence that it made sense to create two separate components.
  • Various UX improvements
    • New icons to represent statuses
    • New layout for processor output tab
    • New design for the test actions section

What’s missing:

  • Better UX for empty prompt. Michael provided a design for this, but it will require additional refactoring. I’m putting it on hold for now and will address separately.
  • There is still not a way to cancel/stop simulation (without refreshing page). Design pending.

Screenshots

Screen Shot 2020-09-01 at 8 54 06 PM

Screen Shot 2020-09-01 at 8 54 14 PM

Screen Shot 2020-09-01 at 8 54 27 PM

Screen Shot 2020-09-01 at 9 44 18 AM

Screen Shot 2020-09-02 at 9 43 15 AM

Screen Shot 2020-09-02 at 9 43 25 AM

Screen Shot 2020-09-02 at 9 43 36 AM

Screen Shot 2020-09-02 at 9 43 46 AM

@alisonelizabeth alisonelizabeth added v8.0.0 Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes v7.10.0 Feature:Ingest Node Pipelines Ingest node pipelines management labels Aug 27, 2020
@alisonelizabeth alisonelizabeth changed the title [Ingest pipelines] [WIP] Polish pipeline debugging workflow [Ingest pipelines] Polish pipeline debugging workflow Sep 2, 2020
@mdefazio
Copy link
Contributor

mdefazio commented Sep 2, 2020

Here are some initial thoughts:

  • I think we could make the Output flyout close when clicking outside of it.
  • Perhaps the 'Run the pipeline' button in the flyout could be above the code block/document block so it matches the placement of 'Refresh output' on the Output tab?
  • Will we be able to provide the list of fields available in the processor configuration?
  • Hitting 'Update' closes the flyout, so changing the configuration and viewing the output is difficult
  • When updating the configuration, the 'Update' button should be disabled until a change is made. Then perhaps we need to add a status icon next to the Output tab to indicate that the output is not current until 'Update' is clicked. Closing the flyout might then also need an alert modal that asks to save/dismiss changes?
  • Do we need a similar alert modal when cancelling the Edit Pipeline flow when there are edits and the user doesn't hit Save?

@alisonelizabeth
Copy link
Contributor Author

Thanks @mdefazio for the initial feedback!

I think we could make the Output flyout close when clicking outside of it.

👍 I don't have a strong opinion about this, but don't mind implementing it.

Perhaps the 'Run the pipeline' button in the flyout could be above the code block/document block so it matches the placement of 'Refresh output' on the Output tab?

For me, it feels a little cumbersome to first add JSON for the sample documents and then move your mouse back up to click "Run the pipeline". When filling out a form, I typically would expect the submit button to be below. I understand this is only one field though so we might treat it a little differently.

Will we be able to provide the list of fields available in the processor configuration?

Can you clarify what you mean here? JL is working on building out the forms for each processor type.

Hitting 'Update' closes the flyout, so changing the configuration and viewing the output is difficult
When updating the configuration, the 'Update' button should be disabled until a change is made. Then perhaps we need to add a status icon next to the Output tab to indicate that the output is not current until 'Update' is clicked. Closing the flyout might then also need an alert modal that asks to save/dismiss changes?
Do we need a similar alert modal when cancelling the Edit Pipeline flow when there are edits and the user doesn't hit Save?

If you click the "Output" tab, the simulation will rerun with your unsaved changes, so you are able to toggle back and forth between configuration and output and make changes. I understand this may not be obvious though. If you cancel, the output will be reset to the original state. I don't think we've typically disabled forms if the user has not changed any values. Similarly, we don't have confirmation modals for exiting forms with unsaved changes. I think the latter is needed, but just wanted to point out that it is probably an issue we need to solve across several of our apps with forms.

@alisonelizabeth alisonelizabeth marked this pull request as ready for review September 2, 2020 17:12
@alisonelizabeth alisonelizabeth requested review from a team as code owners September 2, 2020 17:12
@elasticmachine
Copy link
Contributor

Pinging @elastic/es-ui (Team:Elasticsearch UI)

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @alisonelizabeth !

I had one code change in view that would be great to get your thoughts on, but I view it as non-blocking for this contribution.

In terms of UX everything worked as expected from your PR description. I think it would be great if we can make the documents dropdown a little bit bigger:

Screenshot 2020-09-07 at 14 57 23

I really like the "Data in"/"Data out" sections added per processor. It gives users a lot of insight into the per-step transformations. I wonder if it is worth add a way to view these on the processor itself? I'd be interested to hear your thoughts @mdefazio !

return (
<EditProcessorForm
{...rest}
processor={processor!}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to remove the !

[form, onClose, onSubmit]
);

const resetProcessors = () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we wrap this in a useCallback?

@@ -149,6 +156,8 @@ export const PipelineProcessorsContextProvider: FunctionComponent<Props> = ({
});
break;
case 'managingProcessor':
setUnsavedProcessorFormData(processorTypeAndOptions);
Copy link
Contributor

@jloleysens jloleysens Sep 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If unsavedProcessorDataFormData is only used inside of the form can we push the state further down the component tree? Perhaps the state tracking this could live in the processor settings form component where the tabs get rendered?

Additionally, I think the getDefaultProcessorOptions function that we are passing into the processor settings form fields component could be slightly updated. Maybe something like in processor_form.container:

// ...
const unsavedState = useRef<{} | undefined>();

// we set unsavedState.current whenever a form update happens...

const getProcessor = useCallback((): ProcessorInternal => {
    let options;

    if (unsavedFormData) {
      options = unsavedFormData.current.options;
    } else {
      defaultFields = { fields: processor?.options ?? {} };
    }

    return { ...processor, options: };
  }, [processor]);
// ...

Then we always sync using the form.subscribe callback that is calling onFormUpdate. I think one step further would be to hold "unsaved" state in a useRef. Did not test this 😅 - lmk what you think!

Also, then instead of passing in processor and getDefaultOptions to processor fields form, we just pass in the getProcessor callback since it is a "computed" value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion. I went ahead and implemented this, but only update the ref on submit rather than the form.subscribe callback, as the form data ends up getting reset on tab change here.

@jloleysens
Copy link
Contributor

It is a little bit tricky to assess, but I am assuming we have not introduced changes that require test coverage changes.

@alisonelizabeth
Copy link
Contributor Author

Thanks for the review @jloleysens! I addressed your feedback via 1aa0ef4. I also made the dropdown wider and fixed an alignment issue with the custom icons within the callout.

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments regarding design and UX:

  • Let's change success check to a checkInCircle so it stands out more.
  • Change the dot icon color to euiColorLightShade so it doesn't stand out more. My thinking here is that by making more contrast between these it will be more obvious where in the list the pipeline stopped.
  • Perhaps change 'Test' to 'Test pipeline' in the updated testing module (also would match the flyout header title) so it's clearer what this area does
  • I think we could add a status and timestamp in the flyout that indicates that testing state. I find myself unsure when it ran and what action in the UI will trigger a new run. (maybe a larger UI issue here?)
  • Add a play icon to 'Run the pipeline' button in document tab since we have the refresh icon in the output tab
  • 'Output' button in test module should read 'View output' so it represents an action
  • Maybe not for this PR, but I noticed that the 'Refresh' button in the pipeline list is using the secondary color—this should be primary to match the Create button
    image

@alisonelizabeth
Copy link
Contributor Author

@elasticmachine merge upstream

@alisonelizabeth
Copy link
Contributor Author

Thanks @mdefazio! Great suggestions.

I addressed most of your comments. Would you mind taking another look? I'm still not 100% on the best approach for adding a status/timestamp to the flyout. As mentioned 1:1, perhaps it's best to punt on this until we get some user testing.

Maybe not for this PR, but I noticed that the 'Refresh' button in the pipeline list is using the secondary color—this should be primary to match the Create button

Great catch. I took a look at some of our other UIs, and we're also using the secondary color 🤔. The button was not introduced as part of this PR so I'm going to leave as-is for now, and it also might be something we need to address across other apps.

Latest screenshots:

Screen Shot 2020-09-15 at 12 35 26 PM

Screen Shot 2020-09-15 at 12 35 08 PM

Screen Shot 2020-09-15 at 12 09 21 PM

Copy link
Contributor

@mdefazio mdefazio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I see we don't have the euiColorLightShade as an option for the icon. Maybe this is something we can look into on the EUI side. But we'd obviously like to remove those hex values in a follow up PR.

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Build metrics

@kbn/optimizer bundle module count

id value diff baseline
ingestPipelines 447 +16 431

async chunks size

id value diff baseline
ingestPipelines 764.4KB +20.0KB 744.4KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@alisonelizabeth alisonelizabeth merged commit 309fe76 into elastic:master Sep 15, 2020
@alisonelizabeth alisonelizabeth deleted the ingest_pipelines/polish branch September 15, 2020 20:24
alisonelizabeth added a commit to alisonelizabeth/kibana that referenced this pull request Sep 15, 2020
jloleysens added a commit to jloleysens/kibana that referenced this pull request Sep 16, 2020
…s-for-710

* 'master' of github.com:elastic/kibana: (95 commits)
  log request body in new ES client (elastic#77150)
  use `navigateToUrl` to navigate to recent nav links (elastic#77446)
  Move core config service to `kbn/config` package (elastic#76874)
  [UBI] Copy license to /licenses folder (elastic#77563)
  Skip flaky Events Viewer Cypress test
  [Lens] Remove dynamic names in telemetry fields (elastic#76988)
  [Maps] Add DynamicStyleProperty#getMbPropertyName and DynamicStyleProperty#getMbPropertyValue (elastic#77366)
  [Enterprise Search] Add flag to restrict width of layout (elastic#77539)
  [Security Solutions][Cases - Timeline] Fix bug when adding a timeline to a case (elastic#76967)
  [Security Solution][Detections] Integration test for Editing a Rule (elastic#77090)
  [Ingest pipelines] Polish pipeline debugging workflow (elastic#76058)
  [@kbn/utils] Adds missing dependency (elastic#77536)
  Add the Enterprise Search logo to the Overview search result (elastic#77514)
  [Logs UI] [Metrics UI] Remove saved object field mappings (elastic#75482)
  [Security Solution][Exceptions] Exception modal bulk close option only closes alerts generated by same rule (elastic#77402)
  Adds @kbn/utils package (elastic#76518)
  Map layout changes (elastic#77132)
  [Security Solution] [Detections] EQL Rule Creation (elastic#76831)
  Adding test user to maps tests under documents source folder  (elastic#77245)
  Suppress error logs when clients connect over HTTP instead of HTTPS (elastic#77397)
  ...

# Conflicts:
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/index.ts
#	x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/phases/warm_phase.tsx
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 16, 2020
* master: (55 commits)
  [Grok] Fix missing error message in error toasts (elastic#77499)
  [Alerting] Exempt Alerts pre 7.10 from RBAC on their Action execution until updated (elastic#75563)
  [ML] fix type in apply_influencer_filters_action (elastic#77495)
  [Lens] create reusable component for filters and range aggregation (elastic#77453)
  fix eslint violations
  Collapse alert chart previews by default (elastic#77479)
  [ML] Fixing field caps wrapper endpoint (elastic#77546)
  showing service maps when filte by environment not defined (elastic#77483)
  [Lens] Settings panel redesign and separate settings per y axis (elastic#76373)
  log request body in new ES client (elastic#77150)
  use `navigateToUrl` to navigate to recent nav links (elastic#77446)
  Move core config service to `kbn/config` package (elastic#76874)
  [UBI] Copy license to /licenses folder (elastic#77563)
  Skip flaky Events Viewer Cypress test
  [Lens] Remove dynamic names in telemetry fields (elastic#76988)
  [Maps] Add DynamicStyleProperty#getMbPropertyName and DynamicStyleProperty#getMbPropertyValue (elastic#77366)
  [Enterprise Search] Add flag to restrict width of layout (elastic#77539)
  [Security Solutions][Cases - Timeline] Fix bug when adding a timeline to a case (elastic#76967)
  [Security Solution][Detections] Integration test for Editing a Rule (elastic#77090)
  [Ingest pipelines] Polish pipeline debugging workflow (elastic#76058)
  ...
gmmorris added a commit to gmmorris/kibana that referenced this pull request Sep 16, 2020
* master: (54 commits)
  [Grok] Fix missing error message in error toasts (elastic#77499)
  [Alerting] Exempt Alerts pre 7.10 from RBAC on their Action execution until updated (elastic#75563)
  [ML] fix type in apply_influencer_filters_action (elastic#77495)
  [Lens] create reusable component for filters and range aggregation (elastic#77453)
  fix eslint violations
  Collapse alert chart previews by default (elastic#77479)
  [ML] Fixing field caps wrapper endpoint (elastic#77546)
  showing service maps when filte by environment not defined (elastic#77483)
  [Lens] Settings panel redesign and separate settings per y axis (elastic#76373)
  log request body in new ES client (elastic#77150)
  use `navigateToUrl` to navigate to recent nav links (elastic#77446)
  Move core config service to `kbn/config` package (elastic#76874)
  [UBI] Copy license to /licenses folder (elastic#77563)
  Skip flaky Events Viewer Cypress test
  [Lens] Remove dynamic names in telemetry fields (elastic#76988)
  [Maps] Add DynamicStyleProperty#getMbPropertyName and DynamicStyleProperty#getMbPropertyValue (elastic#77366)
  [Enterprise Search] Add flag to restrict width of layout (elastic#77539)
  [Security Solutions][Cases - Timeline] Fix bug when adding a timeline to a case (elastic#76967)
  [Security Solution][Detections] Integration test for Editing a Rule (elastic#77090)
  [Ingest pipelines] Polish pipeline debugging workflow (elastic#76058)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Ingest Node Pipelines Ingest node pipelines management release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants