-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
fix: product docs installation status #226919
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant) |
Hey @arturoliduena
Do we expect the KB installation to automatically install product docs, |
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 did the following steps:
- Installed the KB with ELSER
- The product docs install button was successfully enabled ✅
- Then I changed the KB model to e5
- 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
@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. |
@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. |
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(() => { |
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 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?
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 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?
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.
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.
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.
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.
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.
ok, so we'll move it out of this PR?
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.
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.
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.
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
setInstalling(true); | ||
setInstalled(false); | ||
} else if (status.overall === 'installed') { | ||
setInstalling(false); | ||
setInstalled(true); | ||
} else if (status.overall === 'uninstalled') { | ||
setInstalling(false); | ||
setInstalled(false); |
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 odd?
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.
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?
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 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)
.
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.
Thanks, @dgieselaar, for the suggestion. I have changed useGetProductStatus
to useProductDocs
and handled the status there. It is clearer
…nstalled for the first time
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.
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
💚 Build Succeeded
Metrics [docs]Async chunks
History
|
Starting backport for target branches: 8.19, 9.1 |
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)
# 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]>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
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
# 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-->
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