Skip to content

fix: product docs installation status #226919

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

Conversation

arturoliduena
Copy link
Contributor

@arturoliduena arturoliduena commented Jul 8, 2025

Closes 226914

Summary

After switching the KB model, product documentation was not automatically installed, even if it had been installed previously. The user must reload the page to view the current installation status of the product documentation.

Screen.Recording.2025-07-07.at.17.17.13.mov

@arturoliduena arturoliduena requested a review from a team as a code owner July 8, 2025 06:56
@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Jul 8, 2025
Copy link
Contributor

github-actions bot commented Jul 8, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@arturoliduena arturoliduena added backport:version Backport to applied version labels release_note:fix v9.1.0 v8.19.0 Team:Obs AI Assistant Observability AI Assistant labels Jul 8, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@viduni94
Copy link
Contributor

viduni94 commented Jul 8, 2025

Hey @arturoliduena
Quick question, when you say

product documentation was not automatically installed

Do we expect the KB installation to automatically install product docs,
OR do we expect the Install button to be enabled for product doc installation after the KB is installed without needed a refresh?

Copy link
Contributor

@viduni94 viduni94 left a comment

Choose a reason for hiding this comment

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

I did the following steps:

  1. Installed the KB with ELSER
  2. The product docs install button was successfully enabled ✅
  3. Then I changed the KB model to e5
  4. After the model change was completed, I can see the product doc install button is enabled again, but the new docs are also getting installed in the background.

Ideally, we should show the Installing... status if the product docs are already being installed in the background when the KB model is changed. Otherwise it feels like the user has to click install again and the UI represents an incorrect state.

Screen.Recording.2025-07-08.at.1.48.04.PM.mov

@arturoliduena
Copy link
Contributor Author

Do we expect the KB installation to automatically install product docs,
OR do we expect the Install button to be enabled for product doc installation after the KB is installed without needed a refresh?

@viduni94, sorry for the confusion. After [AI Infra] Disables the Install product doc button when the Knowledge Base hasn't been installed #226604 changes, we see this small bug, where the install product doc button doesn't enable after installing the KB (the user needs to refresh the page), that what I am trying to fix here.

@arturoliduena
Copy link
Contributor Author

Ideally, we should show the Installing... status if the product docs are already being installed in the background when the KB model is changed. Otherwise it feels like the user has to click install again and the UI represents an incorrect state.

@viduni94, do you think we should address this in this PR? We are planning to make product docs an implementation detail of the knowledge base (#225580), so this won't be necessary.

@viduni94
Copy link
Contributor

viduni94 commented Jul 9, 2025

@viduni94, do you think we should address this in this PR? We are planning to make product docs an implementation detail of the knowledge base (#225580), so this won't be necessary.

I feel like we should address it. Even though we are planning to change the implementation later, because until that is released the user would have a confusing experience right? Is it a complex fix?

What happens if the user clicks install again when the product docs are being installed in the background? Does it restart it? Or does it start another task to install?

I feel the best option is to show the correct UI state if possible.

@arturoliduena
Copy link
Contributor Author

I feel like we should address it. Even though we are planning to change the implementation later, because until that is released the user would have a confusing experience right? Is it a complex fix?

agree with you @viduni94, I just pushed the changes to address this

@@ -144,6 +146,9 @@ export function ChangeKbModel({ knowledgeBase }: { knowledgeBase: UseKnowledgeBa
knowledgeBase.warmupModel(selectedInferenceId);
} else {
knowledgeBase.install(selectedInferenceId);
installProductDoc(selectedInferenceId).then(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes the product doc install with the KB (even when the KB is being installed for the first time)
I saw you've created an issue to do this anyway, but was it intentional to include that behaviour in this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea of [Obs AI Assistant] Unify product docs installation with KB installation is to move the installation of product docs to the KB installation flow, unlike now, where we have to call 2 different endpoints and handle them as different actions.

Do you think we shouldn't install product docs when users install KB for the first time? We can add it later in the unification. I don't have a strong preference. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

good that we will do this, but A) let's do it server-side, B) make sure the UX is updated to reflect the fact that the "knowledge base" as a feature includes product docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, @dgieselaar, we will do it server-side. A and B are considered in [Obs AI Assistant] Make product docs an implementation detail of the knowledge base ticket.

Copy link
Member

Choose a reason for hiding this comment

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

ok, so we'll move it out of this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with @dgieselaar

was it intentional to include that behaviour in this PR

I asked this because the UX seemed a little confusing because the product doc button's status changes when the user performs an action on the KB model for the first time here. And when we are coupling the implementation as part of #227475 we should make it clear in the UX.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was intentional to include it here, but I agree that the UX isn't clear. Let's remove this and implement it right as part of #227475, thanks @viduni94 and @dgieselaar

Comment on lines 46 to 53
setInstalling(true);
setInstalled(false);
} else if (status.overall === 'installed') {
setInstalling(false);
setInstalled(true);
} else if (status.overall === 'uninstalled') {
setInstalling(false);
setInstalled(false);
Copy link
Member

Choose a reason for hiding this comment

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

This looks odd?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

horrible TBH, do you think there is a better solution at the moment? I didn't want to introduce a new hook (useProductDoc). combining useGetProductDocStatus, useInstallProductDoc, and useUninstallProductDoc. Could this be better?

Copy link
Member

Choose a reason for hiding this comment

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

This whole file is weird (I know that's not you). We have isInstalling, isInstalled, isStatusLoading. I would expect something like this in terms of state management:

installStatusFetch (inferenceEndpointId) {
  loading: boolean,
  installStatus: 'notInstalled' | 'installing' | 'installed' | 'failed'
}

and everything to be managed via one hook. e.g. useGetProductStatus needs to know when the product docs have been uninstalled or installed. So you'd have something like useProductDocs(knowledgeBase.inferenceEndpointId).

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, @dgieselaar, for the suggestion. I have changed useGetProductStatus to useProductDocs and handled the status there. It is clearer

Copy link
Contributor

@viduni94 viduni94 left a comment

Choose a reason for hiding this comment

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

Just making a note here about a behaviour I noticed.

When I switch models from ELSER --> e5 --> ELSER, we get a notification immediately saying product docs are successfully installed. It's a confusing UX experience because when updating the model we don't mention that we are updating product docs as well.

But I think it's okay for now since we are planning to improve this experience by coupling product docs with KB. (cc: @isaclfreire )

Screen.Recording.2025-07-14.at.1.56.22.PM.mov

@elasticmachine
Copy link
Contributor

elasticmachine commented Jul 15, 2025

💚 Build Succeeded

  • Buildkite Build
  • Commit: 70f32df
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-226919-70f32dfe577a

Metrics [docs]

Async chunks

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

id before after diff
observabilityAiAssistantManagement 97.8KB 97.8KB -19.0B

History

@arturoliduena arturoliduena merged commit 28e765c into elastic:main Jul 15, 2025
11 of 12 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

https://github.com/elastic/kibana/actions/runs/16292475408

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 15, 2025
Closes [226914](elastic#226914)
## Summary

After switching the KB model, product documentation was not
automatically installed, even if it had been installed previously. The
user must reload the page to view the current installation status of the
product documentation.

https://github.com/user-attachments/assets/a60a98e2-30a3-4253-b423-366fe00f1845

---------

Co-authored-by: Viduni Wickramarachchi <[email protected]>
(cherry picked from commit 28e765c)
kibanamachine added a commit that referenced this pull request Jul 15, 2025
# Backport

This will backport the following commits from `main` to `9.1`:
- [fix: product docs installation status
(#226919)](#226919)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Arturo
Lidueña","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-15T11:51:32Z","message":"fix:
product docs installation status (#226919)\n\nCloses
[226914](https://github.com/elastic/kibana/issues/226914)\n##
Summary\n\nAfter switching the KB model, product documentation was
not\nautomatically installed, even if it had been installed previously.
The\nuser must reload the page to view the current installation status
of the\nproduct
documentation.\n\n\nhttps://github.com/user-attachments/assets/a60a98e2-30a3-4253-b423-366fe00f1845\n\n---------\n\nCo-authored-by:
Viduni Wickramarachchi
<[email protected]>","sha":"28e765c1cee10dc6f6c5ea266b45130fb6789e05","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Obs
AI
Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"fix:
product docs installation
status","number":226919,"url":"https://github.com/elastic/kibana/pull/226919","mergeCommit":{"message":"fix:
product docs installation status (#226919)\n\nCloses
[226914](https://github.com/elastic/kibana/issues/226914)\n##
Summary\n\nAfter switching the KB model, product documentation was
not\nautomatically installed, even if it had been installed previously.
The\nuser must reload the page to view the current installation status
of the\nproduct
documentation.\n\n\nhttps://github.com/user-attachments/assets/a60a98e2-30a3-4253-b423-366fe00f1845\n\n---------\n\nCo-authored-by:
Viduni Wickramarachchi
<[email protected]>","sha":"28e765c1cee10dc6f6c5ea266b45130fb6789e05"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226919","number":226919,"mergeCommit":{"message":"fix:
product docs installation status (#226919)\n\nCloses
[226914](https://github.com/elastic/kibana/issues/226914)\n##
Summary\n\nAfter switching the KB model, product documentation was
not\nautomatically installed, even if it had been installed previously.
The\nuser must reload the page to view the current installation status
of the\nproduct
documentation.\n\n\nhttps://github.com/user-attachments/assets/a60a98e2-30a3-4253-b423-366fe00f1845\n\n---------\n\nCo-authored-by:
Viduni Wickramarachchi
<[email protected]>","sha":"28e765c1cee10dc6f6c5ea266b45130fb6789e05"}}]}]
BACKPORT-->

Co-authored-by: Arturo Lidueña <[email protected]>
Co-authored-by: Viduni Wickramarachchi <[email protected]>
@arturoliduena
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

arturoliduena added a commit to arturoliduena/kibana that referenced this pull request Jul 16, 2025
Closes [226914](elastic#226914)
## Summary

After switching the KB model, product documentation was not
automatically installed, even if it had been installed previously. The
user must reload the page to view the current installation status of the
product documentation.

https://github.com/user-attachments/assets/a60a98e2-30a3-4253-b423-366fe00f1845

---------

Co-authored-by: Viduni Wickramarachchi <[email protected]>
(cherry picked from commit 28e765c)

# Conflicts:
#	x-pack/platform/plugins/private/observability_ai_assistant_management/public/hooks/use_get_product_doc_status.ts
#	x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_get_product_doc.ts
#	x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_get_product_doc_status.ts
arturoliduena added a commit that referenced this pull request Jul 16, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [fix: product docs installation status
(#226919)](#226919)

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Arturo
Lidueña","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-15T11:51:32Z","message":"fix:
product docs installation status (#226919)\n\nCloses
[226914](https://github.com/elastic/kibana/issues/226914)\n##
Summary\n\nAfter switching the KB model, product documentation was
not\nautomatically installed, even if it had been installed previously.
The\nuser must reload the page to view the current installation status
of the\nproduct
documentation.\n\n\nhttps://github.com/user-attachments/assets/a60a98e2-30a3-4253-b423-366fe00f1845\n\n---------\n\nCo-authored-by:
Viduni Wickramarachchi
<[email protected]>","sha":"28e765c1cee10dc6f6c5ea266b45130fb6789e05","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Obs
AI
Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"fix:
product docs installation
status","number":226919,"url":"https://github.com/elastic/kibana/pull/226919","mergeCommit":{"message":"fix:
product docs installation status (#226919)\n\nCloses
[226914](https://github.com/elastic/kibana/issues/226914)\n##
Summary\n\nAfter switching the KB model, product documentation was
not\nautomatically installed, even if it had been installed previously.
The\nuser must reload the page to view the current installation status
of the\nproduct
documentation.\n\n\nhttps://github.com/user-attachments/assets/a60a98e2-30a3-4253-b423-366fe00f1845\n\n---------\n\nCo-authored-by:
Viduni Wickramarachchi
<[email protected]>","sha":"28e765c1cee10dc6f6c5ea266b45130fb6789e05"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/227992","number":227992,"state":"MERGED","mergeCommit":{"sha":"5dba1bdbca9f1b2bd41614cd4a4a08308f8cce76","message":"[9.1]
fix: product docs installation status (#226919) (#227992)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`9.1`:\n- [fix: product docs installation
status\n(#226919)](https://github.com/elastic/kibana/pull/226919)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by:
Arturo Lidueña <[email protected]>\nCo-authored-by: Viduni
Wickramarachchi
<[email protected]>"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/226919","number":226919,"mergeCommit":{"message":"fix:
product docs installation status (#226919)\n\nCloses
[226914](https://github.com/elastic/kibana/issues/226914)\n##
Summary\n\nAfter switching the KB model, product documentation was
not\nautomatically installed, even if it had been installed previously.
The\nuser must reload the page to view the current installation status
of the\nproduct
documentation.\n\n\nhttps://github.com/user-attachments/assets/a60a98e2-30a3-4253-b423-366fe00f1845\n\n---------\n\nCo-authored-by:
Viduni Wickramarachchi
<[email protected]>","sha":"28e765c1cee10dc6f6c5ea266b45130fb6789e05"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels ci:project-deploy-observability Create an Observability project release_note:fix Team:Obs AI Assistant Observability AI Assistant v8.19.0 v9.1.0 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Obs AI Assistant] product docs installation status
5 participants