forked from opensearch-project/ml-commons-dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
Refine AI chatbot registration process #11
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
Merged
asteriscos
merged 12 commits into
4.14.0
from
bug/10-refine-ai-chatbot-registration-process
Sep 23, 2025
Merged
Refine AI chatbot registration process #11
asteriscos
merged 12 commits into
4.14.0
from
bug/10-refine-ai-chatbot-registration-process
Sep 23, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enhance the error popover by adding a «panelStyle» property with word-wrapping. This ensures long text breaks properly, improving readability and preventing layout issues.
Enhance error propagation and contextual data in HTTP client operations by introducing a detailed «HttpError» utility. Update test cases to validate enriched error messages, including status text and request details. Refactor installation steps to incorporate structured error handling using «StepError», providing detailed context and possible causes for failures. Improve diagnostic messaging during installation, including step-specific details and enriched error descriptions. Add utility functions to extract status codes and derive potential causes for issues, improving debugging capabilities. Update related unit tests to ensure comprehensive coverage of new behaviors.
Introduce rollback functionality to the installation process, enabling the reversal of completed steps upon failure. Extend «InstallationAIAssistantStep» with a new «rollback» method and update «InstallationProgressManager» to manage rollback execution. Add rollback handling for agent, connector, and model creation steps, ensuring created resources are cleaned up if subsequent steps fail. Enhance integration tests to validate rollback behavior and update the «InstallationResult» structure to include «rollbackErrors» for improved error reporting.
Refine the error message in the «TestModelConnectionStep» test to improve clarity and match the updated phrasing. This ensures the test provides more precise feedback when the step validation fails.
Simplify the «HttpError» implementation by removing all logic related to determining and handling the presence of a response body. Eliminate the «responseBodyOmitted» property, the «hasMeaningfulBody» function, and associated references. This change reduces complexity and aligns with a security-focused approach by avoiding reliance on response body content.
Enhance the test for «WindowFetchHttpClient» by adding assertions for «status» and «statusText» in propagated HTTP errors, ensuring more comprehensive error validation. Simplify the failure message validation in «InstallationProgressManager» tests by removing redundant details, improving clarity and focus on the core error message.
Simplify code structure by normalizing formatting for better readability across files. Replace «RollbackError» type with an «interface» for consistency. Update multiline constructs to align with style guidelines. These changes improve code maintainability and adhere to standardized practices.
All errors related to this specific linter rule will be ignored.
|
Introduce an optional «onRollback» callback to the «TestStep» class, enabling custom rollback logic during test execution. Update the «rollback» method to invoke this callback if provided. Add a new test case to verify proper rollback execution order for failed and completed steps. Ensure rollback errors are collected and validated. Enhances test coverage and ensures consistent behavior during rollback scenarios.
Introduce a unit test to verify the behavior of the «ModelRegister» component during installation failure. Mock dependencies like «ModelForm» and «useAssistantInstallation» to simulate scenarios, ensuring proper handling of error states and absence of success messages.
Introduce rollback tracking in the installation process to record reverted steps during failures. Update the response structure to include a «rollbacks» field and propagate this data through the installation workflow. Enhance the UI to display rollback summaries using «addInfoToast» when installation errors occur. Modify tests to verify rollback behavior and ensure accurate reporting of reverted steps. Improve error handling and state management by adding a reference to track the last rollback summary and avoid duplicate toasts.
Standardize imports across test files by replacing inline React imports with named imports. Simplify code structure for readability by reformatting multiline arrays and conditionals. Remove the «override» keyword from rollback methods in multiple classes to align with TypeScript conventions and ensure compatibility. Improve readability in «derivePossibleCauses» by reformatting conditional checks for network issues. These changes enhance code consistency, maintainability, and readability.
Update mocked components and hooks to use explicit «React» references instead of named imports. This change ensures compatibility with Jest's module mocking and avoids potential conflicts with React's internal APIs. Additionally, replace JSX syntax with «React.createElement» in the mocked «MockModelForm» for consistency and clarity in the mock's implementation.
🟢 Test Legend
🧪 UI Tests 🟢
📋Test Details |
gonzaarancibia
approved these changes
Sep 22, 2025
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.
🟢 LGTM
...sistant/modules/installation-manager/infrastructure/steps/update-ml-commons-settings-step.ts
Show resolved
Hide resolved
🧪 UI Tests 🟢
📋Test Details🟢 1️⃣ In **Explore > Machine Learning**: Click **Add Model** → Fill required fields → Enter invalid **API Key** → Step **Test Model Connection** should fail → Clicking the failed step's cross should display **detailed error info (not just status code)**
Screen.Recording.2025-09-23.at.11.14.25.AM.mov
🟢 2️⃣ In **Explore > Machine Learning**: Click **Add Model** → Fill required fields → Enter invalid **API Key** → Registration should fail → UI must show **rollback executed** message → In **DevTools > Network**, verify rollback endpoints were called in backend
Screen.Recording.2025-09-23.at.11.16.31.AM.mov
|
Machi3mfl
approved these changes
Sep 23, 2025
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.
LGTM!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR add error handling and backend consistency when a model registration fails.
Validation of failed
Test Model Connection
Rollback execution when model registration step fails
Issue resolved
closes #10
Tasks/Evidence
Verifies that clicking the failed step’s cross now displays detailed error information (instead of just the status code).
Enhance the error popover by adding a «panelStyle» property with word-wrapping. This ensures long text breaks properly, improving readability and preventing layout issues.
Enhance error propagation and contextual data in HTTP client operations by introducing a detailed «HttpError» utility.
Refactor installation steps to incorporate structured error handling using «StepError», providing detailed context and possible causes for failures. Improve diagnostic messaging during installation, including step-specific details and enriched error descriptions.
Add utility functions to extract status codes and derive potential causes for issues, improving debugging capabilities.
Introduce rollback functionality to the installation process, enabling the reversal of completed steps upon failure. Extend «InstallationAIAssistantStep» with a new «rollback» method and update «InstallationProgressManager» to manage rollback execution. Add rollback handling for agent, connector, and model creation steps, ensuring created resources are cleaned up if subsequent steps fail.
Enhance the UI to display rollback summaries using «addInfoToast» when installation errors occur.

Evidence
🟢 Test Legend
🧪 UI Tests
📋Test Details
⚫ 1️⃣ In **Explore > Machine Learning**: Click **Add Model** → Fill required fields → Enter invalid **API Key** → Step **Test Model Connection** should fail → Clicking the failed step's cross should display **detailed error info (not just status code)**
⚫ 2️⃣ In **Explore > Machine Learning**: Click **Add Model** → Fill required fields → Enter invalid **API Key** → Registration should fail → UI must show **rollback executed** message → In **DevTools > Network**, verify rollback endpoints were called in backend