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

[Guided onboarding] Added Guided onboarding to the Fleet plugin #142185

Merged

Conversation

yuliacech
Copy link
Contributor

@yuliacech yuliacech commented Sep 29, 2022

Summary

Fixes #140610, #138646
Partially addresses #139712

This PR is a part of the Guided onboarding work for 8.6, specifically these changes are important for the Security guide, the "Add data" step. When this step is active, the Integrations detail page for Elastic Defend will display a EUI tour pointing out the "Add integration" button. Also this button will redirect the user to the new Agent flow not only for the first agent install, but for repeat install as well. Other conditions for the new Agent flow are unchanged and it seems safe to redirect the user to the new flow even if they already have an Agent installed. The last change is on the data confirmation page. If the data step is active, the confirmation page will send a signal to the Guided onboarding plugin to mark the step as completed when the incoming data is detected.

The e2e UI tests will be addressed in a follow up PR (see #138568).

How to test

1. Add this code to the `KIBANA/config/kibana.dev.yml` file
# needed for the Fleet server
server.host: 0.0.0.0
xpack.fleet.agents.enabled: true
xpack.fleet.packages:
  - name: fleet_server
    version: latest
xpack.fleet.agentPolicies:
  - name: Fleet Server policy
    id: fleet-server-policy
    description: Fleet server policy
    namespace: default
    package_policies:
      - name: Fleet Server
        package:
          name: fleet_server

# needed to imitate Cloud deployments
xpack.cloud.id: 'testID'

# needed to enable guided onboarding plugin
guidedOnboarding.ui: true
  1. Start ES with this command
yarn es snapshot --license trial -E xpack.security.authc.api_key.enabled=true -E xpack.security.authc.token.enabled=true -E path.data=/tmp/es-data -E http.host=0.0.0.0
  1. Start Kibana with this command
yarn start --run-examples
  1. Start your docker app
  2. Start the Fleet server with this command (I was testing with the version 8.4.2)
docker run -e KIBANA_HOST=http://192.168.65.2:5601 -e KIBANA_USERNAME=elastic -e KIBANA_PASSWORD=changeme -e ELASTICSEARCH_HOST=http://192.168.65.2:9200 -e KIBANA_FLEET_SETUP=1 -e FLEET_SERVER_ENABLE=1 -e FLEET_SERVER_POLICY_ID=fleet-server-policy -p 8220:8220 docker.elastic.co/beats/elastic-agent:8.4.2
  1. In Kibana, navigate to http://localhost:5601/app/guidedOnboardingExample and start the Security guide. Make sure the green guided onboarding button is displayed in the header and the first step is active.

  2. In the guided onboarding checklist panel, click the "Start" button in the first step. Or alternatively navigate to http://localhost:5601/app/integrations/browse/security. Click the Elastic Defend card to open the details page.

  3. On the Elastic Defend details page, make sure the EUI tour is displayed.

  4. When clicking on the "Add integration" button, make sure the new Agent flow is used.

  5. Complete the flow and make sure, when the incoming data is detected, the guided onboarding step is marked completed.

  6. Delete the integration and restart the Security guide, but don't delete the installed Agent. Make sure the new flow is still used when installing the integration.

Screenshots

EUI tour on the details page

Screenshot 2022-10-03 at 10 05 14

The data step is marked completed

Screenshot 2022-10-03 at 10 04 41

Checklist

@yuliacech yuliacech changed the title [Guided onboarding] Added Eui tour to Integrations detail page [Guided onboarding] Added Guided onboarding to the Fleet plugin Oct 3, 2022
@yuliacech yuliacech marked this pull request as ready for review October 3, 2022 08:40
@yuliacech yuliacech requested review from a team as code owners October 3, 2022 08:40
@yuliacech yuliacech added release_note:skip Skip the PR/issue when compiling release notes Team:Journey/Onboarding Platform Journey Onboarding team v8.6.0 labels Oct 3, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/platform-onboarding (Team:Journey/Onboarding)

Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

Nice work @yuliacech! It's so exciting to start seeing this come together 🎉. I tested following the steps you provided and everything worked as expected.

I left a couple nits in the code, and one question around the footer button label for the tour. Otherwise, I'm happy with the changes once CI is green. Going to approve to not block you.

@@ -0,0 +1,27 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 thanks for adding this mock!

* An observable with the boolean value if the guided onboarding is currently active for the integration.
* Returns true, if the passed integration is used in the current guide's step.
* Returns false otherwise.
* @param {string} guideID the integration ID (package key) to check for in the guided onboarding config
Copy link
Contributor

Choose a reason for hiding this comment

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

typo here I think

Suggested change
* @param {string} guideID the integration ID (package key) to check for in the guided onboarding config
* @param {string} the integration ID (package key) to check for in the guided onboarding config

: of(false)
);
useEffect(() => {
setResult(!!isGuidedOnboardingActiveForIntegration);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the !! necessary? Shouldn't this always return a boolean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think useObservable adds an undefined to the types even when the original Observable is of type boolean.

footerAction={
<EuiButton onClick={() => setIsGuidedOnboardingTourOpen(false)} size="s" color="success">
{i18n.translate('xpack.fleet.guidedOnboardingTour.nextButtonLabel', {
defaultMessage: 'Next',
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be "End tour" or "Complete" instead when there is only one step?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would need to confirm with design and copy, but given that the tour doesn't complete the step but helps the user to move along, I think 'Next' could work here.

Copy link
Contributor

Choose a reason for hiding this comment

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

If clicking the button returns them to the setup guide, then I think "Next" makes perfect sense here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot, @kellyemurphy! Yes, the tour is used to point out the button. If it's closed, the guide stays in the same step until the user clicks the "Add integration" button and competes the installation.

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 3, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@nchaulet nchaulet requested review from nchaulet and removed request for nchaulet October 4, 2022 00:32
@yuliacech yuliacech force-pushed the guided_onboarding/8.6_integrations_tours branch from 016e6bb to e74b69c Compare October 4, 2022 11:31
@yuliacech
Copy link
Contributor Author

Thanks a lot for the review, @alisonelizabeth 🎉

@jen-huang jen-huang requested a review from hop-dev October 4, 2022 19:36
Copy link
Contributor

@hop-dev hop-dev left a comment

Choose a reason for hiding this comment

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

Tested locally and the code looks great. Thanks for this! 🚀

…/epm/screens/detail/components/with_guided_onboarding_tour.tsx

Co-authored-by: Kelly Murphy <[email protected]>
@yuliacech
Copy link
Contributor Author

Thanks a lot for your review, @hop-dev! 👍

@yuliacech yuliacech enabled auto-merge (squash) October 5, 2022 11:14
@yuliacech yuliacech merged commit 27ac4fc into elastic:main Oct 5, 2022
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 764 766 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 915.0KB 915.9KB +960.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 111.8KB 112.5KB +760.0B
guidedOnboarding 16.0KB 16.6KB +662.0B
total +1.4KB

History

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

@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Oct 5, 2022
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 11, 2022
…tic#142185)

* [Guided onboarding] Added a EuiTour for guided onboarding in Integrations

* [Guided onboarding] Added data step completion for Elastic Defend

* [Guided onboarding] Added tests for api

* [Guided onboarding] Fixed jest tests

* [Guided onboarding] Added a fail safe for guided onboarding plugin not available in fleet

* [Guided onboarding] Moved the guided onboarding hook to a different folder in the fleet plugin, also fixed tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* [Guided onboarding] Updates after the merge conflicts

* [Guided onboarding] Fixed typos

* [Guided onboarding] Fixed types error

* Update x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/components/with_guided_onboarding_tour.tsx

Co-authored-by: Kelly Murphy <[email protected]>

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Kelly Murphy <[email protected]>
WafaaNasr pushed a commit to WafaaNasr/kibana that referenced this pull request Oct 14, 2022
…tic#142185)

* [Guided onboarding] Added a EuiTour for guided onboarding in Integrations

* [Guided onboarding] Added data step completion for Elastic Defend

* [Guided onboarding] Added tests for api

* [Guided onboarding] Fixed jest tests

* [Guided onboarding] Added a fail safe for guided onboarding plugin not available in fleet

* [Guided onboarding] Moved the guided onboarding hook to a different folder in the fleet plugin, also fixed tests

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* [Guided onboarding] Updates after the merge conflicts

* [Guided onboarding] Fixed typos

* [Guided onboarding] Fixed types error

* Update x-pack/plugins/fleet/public/applications/integrations/sections/epm/screens/detail/components/with_guided_onboarding_tour.tsx

Co-authored-by: Kelly Murphy <[email protected]>

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Kelly Murphy <[email protected]>
@yuliacech yuliacech deleted the guided_onboarding/8.6_integrations_tours branch November 22, 2022 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:Journey/Onboarding Platform Journey Onboarding team v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Guided onboarding] [Security] "Force" the new Agent/Integrations flow
7 participants