Skip to content

MGMT-21333: Enable chatbot in standalone UI#3084

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
rawagner:chatbot_standalone
Aug 1, 2025
Merged

MGMT-21333: Enable chatbot in standalone UI#3084
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
rawagner:chatbot_standalone

Conversation

@rawagner
Copy link
Member

@rawagner rawagner commented Jul 30, 2025

run with

AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui

Summary by CodeRabbit

  • New Features

    • Introduced chatbot integration in the Assisted Installer UI, allowing users to interact with a chatbot when authenticated.
    • Added environment variable support for chatbot configuration and authentication token.
    • Updated UI to display the chatbot only when a valid token is present.
  • Documentation

    • Added instructions for enabling and running the chatbot feature in the README.
  • Bug Fixes

    • Improved error handling for chatbot API responses to display detailed error messages.
  • Chores

    • Updated dependencies to include chatbot and PatternFly 6 packages.
    • Enhanced development and deployment configurations for chatbot proxying and environment variable management.
    • Added environment template and scripts to support chatbot token injection and configuration.
    • Added script inclusion for environment variables in the UI HTML.
    • Adjusted environment variable access methods and global declarations for token support.
    • Added file copy step in the build process to include environment template in the build output.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 30, 2025

@rawagner: This pull request references MGMT-21333 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

run with

AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 30, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 30, 2025

Walkthrough

This change integrates a ChatBot feature into the assisted-ui application. It introduces a new ChatBot React component, conditionally rendered based on token availability, updates environment variable handling and deployment scripts, modifies nginx and development server configurations to proxy chatbot requests, adds PatternFly 6 dependencies, and documents usage instructions. It also improves error handling in the chatbot library and updates environment variable access patterns.

Changes

Cohort / File(s) Change Summary
ChatBot Component Integration
apps/assisted-ui/src/components/Chatbot.tsx, apps/assisted-ui/src/components/App.tsx
Adds a new ChatBot React component with authorization header injection, conditionally renders it in the UI based on token presence.
Environment Variable Handling and HTML Integration
apps/assisted-ui/env.template.js, apps/assisted-ui/public/env.js, apps/assisted-ui/deploy/start.sh, apps/assisted-ui/index.html, apps/assisted-ui/src/main.tsx
Introduces environment variable templates and scripts for token injection, updates HTML to load env.js, and extends the Window interface in TypeScript.
Build and Deployment Configuration
apps/assisted-ui/Containerfile, apps/assisted-ui/deploy/nginx.conf
Copies env.template.js during build, adds nginx location block to proxy /chatbot requests with WebSocket support and timeout settings.
Dependency and Development Configuration Updates
apps/assisted-ui/package.json, apps/assisted-ui/vite.config.ts
Adds chatbot and PatternFly 6 dependencies, updates Vite config to merge environment variables and proxy /chatbot requests in dev server.
Documentation
apps/assisted-ui/README.md
Adds instructions for running the UI with chatbot enabled, including required environment variables and commands.
ChatBot Library Error Handling
libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx
Adds explicit error handling for non-OK streaming API responses by throwing errors with detailed messages.
Environment Variable Access Update
apps/assisted-ui/src/config.ts
Changes environment variable references from process.env to import.meta.env for certain constants.
ChatBot Package TypeScript Configuration
libs/chatbot/package.json
Updates TypeScript typesVersions to include source TypeScript file alongside built declarations.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AssistedUI
    participant ChatBotComponent
    participant Nginx
    participant ChatService

    User->>AssistedUI: Loads UI (index.html loads env.js)
    AssistedUI->>ChatBotComponent: Renders if OCM_TOKEN is available
    User->>ChatBotComponent: Sends message
    ChatBotComponent->>Nginx: POST /chatbot/v1/streaming_query (with Authorization header)
    Nginx->>ChatService: Proxies request to $AIUI_CHAT_API_URL/v1/streaming_query
    ChatService-->>Nginx: Streaming response (or error)
    Nginx-->>ChatBotComponent: Streams response back
    ChatBotComponent->>User: Displays chatbot reply or error
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • MGMT-20953: Add AI ChatBot #3016: Introduces the @openshift-assisted/chatbot library, which is directly integrated and extended by this PR.
  • Make chatbot public #3040: Updates the chatbot package's package.json to make it publicly accessible, related through the chatbot package but without overlapping code changes.

Suggested labels

lgtm, size/M

Suggested reviewers

  • celdrake
  • ammont82

Poem

🐇✨
In the UI garden, a chatbot now blooms,
With tokens and proxies, it brightly resumes.
Env files and configs, all neatly in tow,
PatternFly 6 brings a fresh, modern glow.
Ask it your questions, don’t be shy—
The rabbit’s chatbot is standing by!
🥕💬

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci bot requested review from ElayAharoni and batzionb July 30, 2025 08:06
@openshift-ci openshift-ci bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 30, 2025
@rawagner rawagner force-pushed the chatbot_standalone branch from 5e41b10 to 03f6291 Compare July 30, 2025 08:08
@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 30, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 30, 2025

@rawagner: This pull request references MGMT-21333 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

run with

AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui

Summary by CodeRabbit

  • New Features

  • Introduced chatbot integration in the Assisted Installer UI, allowing users to interact with a chatbot when authenticated.

  • Added environment variable support for chatbot configuration and authentication token.

  • Updated UI to display the chatbot only when a valid token is present.

  • Documentation

  • Added instructions for enabling and running the chatbot feature in the README.

  • Bug Fixes

  • Improved error handling for chatbot API responses to display detailed error messages.

  • Chores

  • Updated dependencies to include chatbot and PatternFly 6 packages.

  • Enhanced development and deployment configurations for chatbot proxying and environment variable management.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
apps/assisted-ui/README.md (1)

94-101: LGTM with minor markdown improvements needed.

The chatbot documentation is clear and accurate. The environment variables and command example match the implementation.

Address the markdown style issues:

-```
+```bash
 $ AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui

</blockquote></details>
<details>
<summary>apps/assisted-ui/src/components/Chatbot.tsx (1)</summary><blockquote>

`20-20`: **Consider making username configurable.**

The hardcoded username 'Assisted Installer user' could be made configurable through props or environment variables for better flexibility.



```diff
-  return <AIChatBot onApiCall={onApiCall} username={'Assisted Installer user'} />;
+  return <AIChatBot onApiCall={onApiCall} username={process.env.AIUI_CHAT_USERNAME || 'Assisted Installer user'} />;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3692b1 and 03f6291.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (13)
  • apps/assisted-ui/Containerfile (1 hunks)
  • apps/assisted-ui/README.md (1 hunks)
  • apps/assisted-ui/deploy/nginx.conf (1 hunks)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
  • apps/assisted-ui/env.template.js (1 hunks)
  • apps/assisted-ui/index.html (1 hunks)
  • apps/assisted-ui/package.json (1 hunks)
  • apps/assisted-ui/public/env.js (1 hunks)
  • apps/assisted-ui/src/components/App.tsx (2 hunks)
  • apps/assisted-ui/src/components/Chatbot.tsx (1 hunks)
  • apps/assisted-ui/src/main.tsx (1 hunks)
  • apps/assisted-ui/vite.config.ts (2 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.
apps/assisted-ui/README.md (1)

Learnt from: celdrake
PR: #3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

apps/assisted-ui/package.json (1)

Learnt from: celdrake
PR: #3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

apps/assisted-ui/src/components/Chatbot.tsx (1)

Learnt from: celdrake
PR: #3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

apps/assisted-ui/src/components/App.tsx (1)

Learnt from: celdrake
PR: #3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

🧬 Code Graph Analysis (3)
libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1)
libs/types/assisted-installer-service.d.ts (1)
  • Error (997-1018)
apps/assisted-ui/src/components/Chatbot.tsx (2)
libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1)
  • ChatBotWindowProps (49-57)
libs/ui-lib/lib/ocm/services/UISettingsService.ts (1)
  • fetch (8-11)
apps/assisted-ui/src/components/App.tsx (2)
libs/ui-lib/lib/ocm/components/Routes.tsx (1)
  • UILibRoutes (17-57)
apps/assisted-ui/src/components/Chatbot.tsx (1)
  • getOcmToken (7-7)
🪛 markdownlint-cli2 (0.17.2)
apps/assisted-ui/README.md

98-98: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


99-99: Dollar signs used before commands without showing output

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: tests
  • GitHub Check: translation-files
  • GitHub Check: unit-tests
  • GitHub Check: circular-deps
  • GitHub Check: format
  • GitHub Check: lint
🔇 Additional comments (17)
apps/assisted-ui/index.html (1)

9-9: LGTM! Proper script placement for environment configuration.

The script tag is correctly placed in the head section before the main application script, ensuring environment variables are available when the application initializes.

apps/assisted-ui/public/env.js (1)

1-1: No conflict detected between static public/env.js and generated src/env.js.

The deployment’s start.sh uses env.template.js under $NGINX_APP_ROOT/src and writes to $NGINX_APP_ROOT/src/env.js, while your checked-in fallback lives at apps/assisted-ui/public/env.js. They never collide in the same directory, so no further changes are needed.

apps/assisted-ui/src/main.tsx (1)

5-9: LGTM! Proper TypeScript global interface extension.

The declaration correctly extends the Window interface with an optional OCM_TOKEN property, enabling type-safe access to the global variable throughout the application.

apps/assisted-ui/Containerfile (1)

28-28: Confirm env.template.js path and runtime usage

  • Verified that apps/assisted-ui/env.template.js exists in the build context and matches the absolute source path used in the COPY command.
  • I couldn’t find any startup scripts or entrypoint logic that processes this template in the runtime container.

Please confirm that:

  1. The template is indeed needed at runtime and is processed by your container’s entrypoint or startup script.
  2. If it’s not used at runtime, consider removing the COPY step or adding the necessary processing logic.
apps/assisted-ui/src/components/App.tsx (2)

7-7: LGTM!

Clean import of the ChatBot component and token utility function.


17-20: LGTM!

The conditional rendering approach is well-implemented. Using additionalComponents ensures the ChatBot doesn't interfere with routing, and the token check provides appropriate feature gating.

apps/assisted-ui/deploy/start.sh (2)

7-7: LGTM!

Correctly adds the chatbot URL environment variable to the nginx configuration substitution.


14-15: LGTM!

The environment variable substitution for the OCM token follows the established pattern and correctly generates the runtime environment file.

libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1)

136-140: LGTM!

Excellent addition of proper HTTP status checking. This prevents attempting to process the response stream when the server returns an error status, and the error message extraction from the detail field follows standard API conventions.

apps/assisted-ui/package.json (2)

3-3: LGTM!

Correctly adds the workspace dependency for the chatbot package.


6-11: LGTM!

Smart approach using npm aliases to include PatternFly 6 packages alongside the existing v5 dependencies. The consistent versioning (6.2.2) across all PatternFly 6 packages ensures compatibility.

apps/assisted-ui/deploy/nginx.conf (1)

17-29: LGTM! Proxy configuration follows established patterns.

The new /chatbot/ location block correctly mirrors the existing /api configuration with appropriate WebSocket support, timeouts, and body size limits. The configuration properly uses the $AIUI_CHAT_URL environment variable for dynamic backend routing.

apps/assisted-ui/vite.config.ts (2)

33-39: LGTM! Improved environment variable handling.

The merge of default values with loaded environment variables ensures robust configuration management, preventing undefined values when environment variables are not set.


48-52: LGTM! Proper proxy configuration for chatbot.

The proxy setup correctly forwards /chatbot requests to the backend URL with appropriate path rewriting and origin handling for cross-origin requests.

apps/assisted-ui/src/components/Chatbot.tsx (3)

3-5: CSS imports are well-organized for PatternFly 6 integration.

The imports include the necessary base styles, chatbot-specific CSS, and PatternFly addons in the correct order for proper styling.


7-7: Consider security implications of token exposure.

The token is accessible via both environment variables and window globals, which could potentially expose sensitive credentials in client-side code.

Consider implementing additional security measures such as:

  • Token validation/sanitization before use
  • Secure token storage mechanisms
  • Token expiration handling

9-18: LGTM! Proper API call interception with authorization.

The onApiCall implementation correctly:

  • Matches the expected ChatBotWindowProps['onApiCall'] type
  • Preserves existing request options using spread operators
  • Properly merges headers while adding Authorization
  • Uses the /chatbot proxy endpoint for backend communication

@rawagner rawagner force-pushed the chatbot_standalone branch from 03f6291 to 33c5a70 Compare July 30, 2025 08:43
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 30, 2025

@rawagner: This pull request references MGMT-21333 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

run with

AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui

Summary by CodeRabbit

  • New Features

  • Introduced chatbot integration in the Assisted Installer UI, allowing users to interact with a chatbot when authenticated.

  • Added environment variable support for chatbot configuration and authentication token.

  • Updated UI to display the chatbot only when a valid token is present.

  • Documentation

  • Added instructions for enabling and running the chatbot feature in the README.

  • Bug Fixes

  • Improved error handling for chatbot API responses to display detailed error messages.

  • Chores

  • Updated dependencies to include chatbot and PatternFly 6 packages.

  • Enhanced development and deployment configurations for chatbot proxying and environment variable management.

  • Added environment template and scripts to support chatbot token injection and configuration.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/assisted-ui/README.md (2)

94-100: Add language specifier to the fenced block to satisfy markdown-lint (MD040)

markdownlint-cli flags unqualified ``` blocks. Prefix with the language (bash fits here) to silence the warning and enable syntax highlighting.

-$ AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
+```bash
+$ AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui


---

`96-100`: **Consider clarifying where `chatbot_url` comes from**

Readers may not know which service endpoint to supply. A short hint (e.g., “the public base URL of the Assisted-UI ChatBot service”) or a link to internal docs would prevent support questions.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 03f6291d4f63ab6a24f92b76ab0fed933fd7ebf2 and 33c5a70f5a7dc5addd40385b6cbdebfe4037bc10.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `yarn.lock` is excluded by `!**/yarn.lock`, `!**/*.lock`

</details>

<details>
<summary>📒 Files selected for processing (13)</summary>

* `apps/assisted-ui/Containerfile` (1 hunks)
* `apps/assisted-ui/README.md` (1 hunks)
* `apps/assisted-ui/deploy/nginx.conf` (1 hunks)
* `apps/assisted-ui/deploy/start.sh` (1 hunks)
* `apps/assisted-ui/env.template.js` (1 hunks)
* `apps/assisted-ui/index.html` (1 hunks)
* `apps/assisted-ui/package.json` (1 hunks)
* `apps/assisted-ui/public/env.js` (1 hunks)
* `apps/assisted-ui/src/components/App.tsx` (2 hunks)
* `apps/assisted-ui/src/components/Chatbot.tsx` (1 hunks)
* `apps/assisted-ui/src/main.tsx` (1 hunks)
* `apps/assisted-ui/vite.config.ts` (2 hunks)
* `libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx` (1 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (2)</summary>

* apps/assisted-ui/index.html
* apps/assisted-ui/deploy/start.sh

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (10)</summary>

* apps/assisted-ui/src/main.tsx
* apps/assisted-ui/src/components/App.tsx
* apps/assisted-ui/public/env.js
* apps/assisted-ui/vite.config.ts
* libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx
* apps/assisted-ui/deploy/nginx.conf
* apps/assisted-ui/Containerfile
* apps/assisted-ui/src/components/Chatbot.tsx
* apps/assisted-ui/env.template.js
* apps/assisted-ui/package.json

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧠 Learnings (2)</summary>

<details>
<summary>📓 Common learnings</summary>

Learnt from: celdrake
PR: #3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.


</details>
<details>
<summary>apps/assisted-ui/README.md (1)</summary>

Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

</details>

</details><details>
<summary>🪛 markdownlint-cli2 (0.17.2)</summary>

<details>
<summary>apps/assisted-ui/README.md</summary>

98-98: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

99-99: Dollar signs used before commands without showing output

(MD014, commands-show-output)

</details>

</details>

</details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

@rawagner rawagner force-pushed the chatbot_standalone branch from 33c5a70 to 61d2373 Compare July 30, 2025 09:03
@openshift-ci-robot
Copy link

openshift-ci-robot commented Jul 30, 2025

@rawagner: This pull request references MGMT-21333 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

run with

AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui

Summary by CodeRabbit

  • New Features

  • Introduced chatbot integration in the Assisted Installer UI, allowing users to interact with a chatbot when authenticated.

  • Added environment variable support for chatbot configuration and authentication token.

  • Updated UI to display the chatbot only when a valid token is present.

  • Documentation

  • Added instructions for enabling and running the chatbot feature in the README.

  • Bug Fixes

  • Improved error handling for chatbot API responses to display detailed error messages.

  • Chores

  • Updated dependencies to include chatbot and PatternFly 6 packages.

  • Enhanced development and deployment configurations for chatbot proxying and environment variable management.

  • Added environment template and scripts to support chatbot token injection and configuration.

  • Added script inclusion for environment variables in the UI HTML.

  • Adjusted environment variable access methods and global declarations for token support.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/assisted-ui/README.md (1)

94-100: Add a language tag to the fenced code block to satisfy markdownlint (MD040) and improve rendering

markdownlint flags the new snippet because it lacks a language identifier. Adding bash (or shell) silences the warning and enables syntax highlighting.

-```
+```bash
 $ AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
-```
+```
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 33c5a70 and 61d2373.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (14)
  • apps/assisted-ui/Containerfile (1 hunks)
  • apps/assisted-ui/README.md (1 hunks)
  • apps/assisted-ui/deploy/nginx.conf (1 hunks)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
  • apps/assisted-ui/env.template.js (1 hunks)
  • apps/assisted-ui/index.html (1 hunks)
  • apps/assisted-ui/package.json (1 hunks)
  • apps/assisted-ui/public/env.js (1 hunks)
  • apps/assisted-ui/src/components/App.tsx (2 hunks)
  • apps/assisted-ui/src/components/Chatbot.tsx (1 hunks)
  • apps/assisted-ui/src/config.ts (1 hunks)
  • apps/assisted-ui/src/main.tsx (1 hunks)
  • apps/assisted-ui/vite.config.ts (2 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • apps/assisted-ui/index.html
  • apps/assisted-ui/Containerfile
  • apps/assisted-ui/src/config.ts
🚧 Files skipped from review as they are similar to previous changes (10)
  • apps/assisted-ui/public/env.js
  • apps/assisted-ui/deploy/start.sh
  • apps/assisted-ui/src/components/App.tsx
  • apps/assisted-ui/vite.config.ts
  • apps/assisted-ui/env.template.js
  • apps/assisted-ui/src/main.tsx
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx
  • apps/assisted-ui/deploy/nginx.conf
  • apps/assisted-ui/src/components/Chatbot.tsx
  • apps/assisted-ui/package.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.
apps/assisted-ui/README.md (1)

Learnt from: celdrake
PR: #3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

🪛 markdownlint-cli2 (0.17.2)
apps/assisted-ui/README.md

98-98: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


99-99: Dollar signs used before commands without showing output

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: tests
  • GitHub Check: lint
  • GitHub Check: translation-files
  • GitHub Check: circular-deps
  • GitHub Check: unit-tests
  • GitHub Check: format

@rawagner
Copy link
Member Author

/retest

@rawagner rawagner force-pushed the chatbot_standalone branch from 61d2373 to 17aca9b Compare July 31, 2025 07:41
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/assisted-ui/README.md (1)

98-100: Add fenced-code language for Markdown lint compliance

markdownlint is flagging MD040 because the block lacks an explicit language.
Mark it as bash (or shell) to silence the linter and preserve syntax highlighting.

-```
-$ AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
-```
+```bash
+$ AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
+```
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61d2373 and 17aca9b.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (14)
  • apps/assisted-ui/Containerfile (1 hunks)
  • apps/assisted-ui/README.md (1 hunks)
  • apps/assisted-ui/deploy/nginx.conf (1 hunks)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
  • apps/assisted-ui/env.template.js (1 hunks)
  • apps/assisted-ui/index.html (1 hunks)
  • apps/assisted-ui/package.json (1 hunks)
  • apps/assisted-ui/public/env.js (1 hunks)
  • apps/assisted-ui/src/components/App.tsx (2 hunks)
  • apps/assisted-ui/src/components/Chatbot.tsx (1 hunks)
  • apps/assisted-ui/src/config.ts (1 hunks)
  • apps/assisted-ui/src/main.tsx (1 hunks)
  • apps/assisted-ui/vite.config.ts (2 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • apps/assisted-ui/index.html
  • apps/assisted-ui/src/config.ts
🚧 Files skipped from review as they are similar to previous changes (11)
  • apps/assisted-ui/deploy/start.sh
  • apps/assisted-ui/public/env.js
  • apps/assisted-ui/vite.config.ts
  • apps/assisted-ui/src/main.tsx
  • apps/assisted-ui/src/components/App.tsx
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx
  • apps/assisted-ui/Containerfile
  • apps/assisted-ui/env.template.js
  • apps/assisted-ui/package.json
  • apps/assisted-ui/src/components/Chatbot.tsx
  • apps/assisted-ui/deploy/nginx.conf
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.
apps/assisted-ui/README.md (1)

Learnt from: celdrake
PR: #3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

🪛 markdownlint-cli2 (0.17.2)
apps/assisted-ui/README.md

98-98: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


99-99: Dollar signs used before commands without showing output

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: translation-files
  • GitHub Check: unit-tests
  • GitHub Check: circular-deps
  • GitHub Check: tests
  • GitHub Check: lint
  • GitHub Check: format
🔇 Additional comments (1)
apps/assisted-ui/README.md (1)

96-100: Clarify the script name vs. earlier “yarn start” instruction

Earlier in the README the dev-mode section instructs readers to run yarn start, while this new snippet uses yarn start:assisted_ui. Consider adding a brief note explaining the difference (e.g., “start:assisted_ui runs the UI in standalone mode, whereas start launches the full console”). This prevents confusion for newcomers switching between modes.

@rawagner rawagner force-pushed the chatbot_standalone branch from 17aca9b to 438a49d Compare July 31, 2025 08:38
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/assisted-ui/README.md (1)

98-100: Specify code-block language and satisfy markdown-lint rules

markdownlint flags two issues:

  1. MD040 – missing fenced-code language.
  2. MD014 – dollar-prompt used without showing command output.

Add a language hint (bash) and, if you want to keep the prompt, explicitly silence MD014 by showing expected output or dropping the $:

-```
-$ AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
-```
+```bash
+# Launch the UI with chatbot enabled
+AIUI_CHAT_URL=<chatbot_url> \
+AIUI_OCM_TOKEN="$(ocm token)" \
+yarn start:assisted_ui
+```

This keeps CI green and improves readability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17aca9b and 438a49d.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (15)
  • apps/assisted-ui/Containerfile (1 hunks)
  • apps/assisted-ui/README.md (1 hunks)
  • apps/assisted-ui/deploy/nginx.conf (1 hunks)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
  • apps/assisted-ui/env.template.js (1 hunks)
  • apps/assisted-ui/index.html (1 hunks)
  • apps/assisted-ui/package.json (1 hunks)
  • apps/assisted-ui/public/env.js (1 hunks)
  • apps/assisted-ui/src/components/App.tsx (2 hunks)
  • apps/assisted-ui/src/components/Chatbot.tsx (1 hunks)
  • apps/assisted-ui/src/config.ts (1 hunks)
  • apps/assisted-ui/src/main.tsx (1 hunks)
  • apps/assisted-ui/vite.config.ts (2 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1 hunks)
  • libs/chatbot/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • apps/assisted-ui/index.html
  • libs/chatbot/package.json
🚧 Files skipped from review as they are similar to previous changes (12)
  • apps/assisted-ui/env.template.js
  • apps/assisted-ui/public/env.js
  • apps/assisted-ui/deploy/start.sh
  • apps/assisted-ui/src/components/App.tsx
  • apps/assisted-ui/src/main.tsx
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx
  • apps/assisted-ui/src/config.ts
  • apps/assisted-ui/deploy/nginx.conf
  • apps/assisted-ui/Containerfile
  • apps/assisted-ui/vite.config.ts
  • apps/assisted-ui/src/components/Chatbot.tsx
  • apps/assisted-ui/package.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.
apps/assisted-ui/README.md (1)

Learnt from: celdrake
PR: #3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

🪛 markdownlint-cli2 (0.17.2)
apps/assisted-ui/README.md

98-98: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


99-99: Dollar signs used before commands without showing output

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: format
  • GitHub Check: lint
  • GitHub Check: translation-files
  • GitHub Check: tests
  • GitHub Check: circular-deps
  • GitHub Check: unit-tests
🔇 Additional comments (1)
apps/assisted-ui/README.md (1)

94-95: Section heading LGTM

The new “ChatBot” section is clear and well-placed.

@rawagner rawagner force-pushed the chatbot_standalone branch from 438a49d to e6f3c22 Compare July 31, 2025 09:10
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/assisted-ui/README.md (1)

98-100: Fix markdown-lint violations: add language tag and drop prompt char

markdownlint flags this fenced block for lacking a language spec (MD040) and for using $ prompt glyphs without showing output (MD014). Both can be resolved by:

-```
-$ AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
-```
+```bash
+AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
+```

Removing the leading $ keeps the snippet copy-paste friendly while satisfying the linter.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 438a49d and e6f3c22.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (15)
  • apps/assisted-ui/Containerfile (1 hunks)
  • apps/assisted-ui/README.md (1 hunks)
  • apps/assisted-ui/deploy/nginx.conf (1 hunks)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
  • apps/assisted-ui/env.template.js (1 hunks)
  • apps/assisted-ui/index.html (1 hunks)
  • apps/assisted-ui/package.json (1 hunks)
  • apps/assisted-ui/public/env.js (1 hunks)
  • apps/assisted-ui/src/components/App.tsx (2 hunks)
  • apps/assisted-ui/src/components/Chatbot.tsx (1 hunks)
  • apps/assisted-ui/src/config.ts (1 hunks)
  • apps/assisted-ui/src/main.tsx (1 hunks)
  • apps/assisted-ui/vite.config.ts (3 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1 hunks)
  • libs/chatbot/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • apps/assisted-ui/index.html
  • apps/assisted-ui/src/config.ts
  • apps/assisted-ui/Containerfile
🚧 Files skipped from review as they are similar to previous changes (11)
  • apps/assisted-ui/public/env.js
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx
  • apps/assisted-ui/src/main.tsx
  • apps/assisted-ui/src/components/App.tsx
  • apps/assisted-ui/env.template.js
  • libs/chatbot/package.json
  • apps/assisted-ui/deploy/start.sh
  • apps/assisted-ui/package.json
  • apps/assisted-ui/deploy/nginx.conf
  • apps/assisted-ui/vite.config.ts
  • apps/assisted-ui/src/components/Chatbot.tsx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.
apps/assisted-ui/README.md (1)

Learnt from: celdrake
PR: #3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

🪛 markdownlint-cli2 (0.17.2)
apps/assisted-ui/README.md

98-98: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


99-99: Dollar signs used before commands without showing output

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: tests
  • GitHub Check: unit-tests
  • GitHub Check: lint
  • GitHub Check: translation-files
  • GitHub Check: circular-deps
  • GitHub Check: format
🔇 Additional comments (1)
apps/assisted-ui/README.md (1)

94-96: Nice addition – clear entry-point for enabling the chatbot

The short explanation + prerequisite note (“logged in via ocm”) is concise and immediately actionable. 👍

@rawagner
Copy link
Member Author

/retest

Copy link
Contributor

@celdrake celdrake 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

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 31, 2025
@rawagner rawagner force-pushed the chatbot_standalone branch from e6f3c22 to cda5fbb Compare July 31, 2025 11:27
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 31, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/assisted-ui/README.md (1)

98-100: Add a language hint to fenced code block
markdownlint flags the block because it lacks a language specifier. Adding bash (or shell) after the opening back-ticks will silence the linter and enable syntax highlighting:

-```
+$ AIUI_CHAT_API_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
+```
+```bash
 $ AIUI_CHAT_API_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e6f3c22 and cda5fbb.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (15)
  • apps/assisted-ui/Containerfile (1 hunks)
  • apps/assisted-ui/README.md (1 hunks)
  • apps/assisted-ui/deploy/nginx.conf (1 hunks)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
  • apps/assisted-ui/env.template.js (1 hunks)
  • apps/assisted-ui/index.html (1 hunks)
  • apps/assisted-ui/package.json (1 hunks)
  • apps/assisted-ui/public/env.js (1 hunks)
  • apps/assisted-ui/src/components/App.tsx (2 hunks)
  • apps/assisted-ui/src/components/Chatbot.tsx (1 hunks)
  • apps/assisted-ui/src/config.ts (1 hunks)
  • apps/assisted-ui/src/main.tsx (1 hunks)
  • apps/assisted-ui/vite.config.ts (3 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1 hunks)
  • libs/chatbot/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • apps/assisted-ui/index.html
  • apps/assisted-ui/env.template.js
  • apps/assisted-ui/Containerfile
🚧 Files skipped from review as they are similar to previous changes (11)
  • apps/assisted-ui/public/env.js
  • apps/assisted-ui/deploy/start.sh
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx
  • apps/assisted-ui/src/components/App.tsx
  • apps/assisted-ui/deploy/nginx.conf
  • apps/assisted-ui/src/config.ts
  • libs/chatbot/package.json
  • apps/assisted-ui/vite.config.ts
  • apps/assisted-ui/package.json
  • apps/assisted-ui/src/main.tsx
  • apps/assisted-ui/src/components/Chatbot.tsx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.
apps/assisted-ui/README.md (1)

Learnt from: celdrake
PR: #3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

🪛 markdownlint-cli2 (0.17.2)
apps/assisted-ui/README.md

98-98: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


99-99: Dollar signs used before commands without showing output

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: unit-tests
  • GitHub Check: tests
  • GitHub Check: translation-files
  • GitHub Check: circular-deps
  • GitHub Check: lint
  • GitHub Check: format
🔇 Additional comments (1)
apps/assisted-ui/README.md (1)

94-96: Consistent variable naming—good alignment with existing patterns
The switch to AIUI_CHAT_API_URL follows the same *_API_URL convention used elsewhere (AIUI_APP_API_URL), which improves discoverability and avoids collisions with potential future variables. No further action needed.

@rawagner rawagner force-pushed the chatbot_standalone branch from cda5fbb to 846a25f Compare August 1, 2025 08:20
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 1, 2025

@rawagner: This pull request references MGMT-21333 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.20.0" version, but no target version was set.

Details

In response to this:

run with

AIUI_CHAT_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui

Summary by CodeRabbit

  • New Features

  • Introduced chatbot integration in the Assisted Installer UI, allowing users to interact with a chatbot when authenticated.

  • Added environment variable support for chatbot configuration and authentication token.

  • Updated UI to display the chatbot only when a valid token is present.

  • Documentation

  • Added instructions for enabling and running the chatbot feature in the README.

  • Bug Fixes

  • Improved error handling for chatbot API responses to display detailed error messages.

  • Chores

  • Updated dependencies to include chatbot and PatternFly 6 packages.

  • Enhanced development and deployment configurations for chatbot proxying and environment variable management.

  • Added environment template and scripts to support chatbot token injection and configuration.

  • Added script inclusion for environment variables in the UI HTML.

  • Adjusted environment variable access methods and global declarations for token support.

  • Added file copy step in the build process to include environment template in the build output.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/assisted-ui/README.md (2)

94-100: Add language identifier and drop leading $ to satisfy markdownlint rules

markdownlint-cli2 flags these lines (MD040 & MD014). Adding a language spec improves syntax highlighting, and removing the prompt character keeps the snippet compliant with MD014 while still copy-/paste-friendly.

-```
-$ AIUI_CHAT_API_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
-```
+```bash
+AIUI_CHAT_API_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
+```

96-97: Briefly explain each env var for discoverability

Readers unfamiliar with the project may not know what endpoint the chatbot expects or why the OCM token is needed. A one-liner for each variable (similar to earlier AIUI_APP_API_URL doc) would improve self-service use of this feature.

Example:

AIUI_CHAT_API_URL: URL of the chatbot backend
AIUI_OCM_TOKEN:  OCM access token used for authentication
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cda5fbb and 846a25f.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (15)
  • apps/assisted-ui/Containerfile (1 hunks)
  • apps/assisted-ui/README.md (1 hunks)
  • apps/assisted-ui/deploy/nginx.conf (1 hunks)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
  • apps/assisted-ui/env.template.js (1 hunks)
  • apps/assisted-ui/index.html (1 hunks)
  • apps/assisted-ui/package.json (2 hunks)
  • apps/assisted-ui/public/env.js (1 hunks)
  • apps/assisted-ui/src/components/App.tsx (2 hunks)
  • apps/assisted-ui/src/components/Chatbot.tsx (1 hunks)
  • apps/assisted-ui/src/config.ts (1 hunks)
  • apps/assisted-ui/src/main.tsx (1 hunks)
  • apps/assisted-ui/vite.config.ts (3 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1 hunks)
  • libs/chatbot/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/assisted-ui/index.html
🚧 Files skipped from review as they are similar to previous changes (13)
  • apps/assisted-ui/src/components/App.tsx
  • apps/assisted-ui/env.template.js
  • apps/assisted-ui/src/config.ts
  • apps/assisted-ui/src/main.tsx
  • apps/assisted-ui/public/env.js
  • libs/chatbot/package.json
  • apps/assisted-ui/deploy/nginx.conf
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx
  • apps/assisted-ui/deploy/start.sh
  • apps/assisted-ui/package.json
  • apps/assisted-ui/vite.config.ts
  • apps/assisted-ui/Containerfile
  • apps/assisted-ui/src/components/Chatbot.tsx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.
📚 Learning: in the assisted-installer-ui chatbot feedback implementation, the onfeedbacksubmit callback requires...
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

Applied to files:

  • apps/assisted-ui/README.md
🪛 markdownlint-cli2 (0.17.2)
apps/assisted-ui/README.md

98-98: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


99-99: Dollar signs used before commands without showing output

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: lint
  • GitHub Check: translation-files
  • GitHub Check: unit-tests
  • GitHub Check: tests
  • GitHub Check: format
  • GitHub Check: circular-deps

@rawagner rawagner force-pushed the chatbot_standalone branch from 846a25f to 9bed810 Compare August 1, 2025 08:57
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/assisted-ui/README.md (1)

98-100: Add a language tag and drop the leading $ to satisfy markdown-lint and improve copy-paste UX

markdownlint flags this block for (a) missing fenced-block language (MD040) and (b) leading $ without output (MD014).
Adding the bash tag and removing the prompt symbol keeps the example readable while eliminating linter noise.

-```
-$ AIUI_CHAT_API_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
-```
+```bash
+AIUI_CHAT_API_URL=<chatbot_url> AIUI_OCM_TOKEN=$(ocm token) yarn start:assisted_ui
+```
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 846a25f and 9bed810.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (15)
  • apps/assisted-ui/Containerfile (1 hunks)
  • apps/assisted-ui/README.md (1 hunks)
  • apps/assisted-ui/deploy/nginx.conf (1 hunks)
  • apps/assisted-ui/deploy/start.sh (1 hunks)
  • apps/assisted-ui/env.template.js (1 hunks)
  • apps/assisted-ui/index.html (1 hunks)
  • apps/assisted-ui/package.json (1 hunks)
  • apps/assisted-ui/public/env.js (1 hunks)
  • apps/assisted-ui/src/components/App.tsx (2 hunks)
  • apps/assisted-ui/src/components/Chatbot.tsx (1 hunks)
  • apps/assisted-ui/src/config.ts (1 hunks)
  • apps/assisted-ui/src/main.tsx (1 hunks)
  • apps/assisted-ui/vite.config.ts (3 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1 hunks)
  • libs/chatbot/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • apps/assisted-ui/deploy/start.sh
  • apps/assisted-ui/index.html
🚧 Files skipped from review as they are similar to previous changes (12)
  • apps/assisted-ui/public/env.js
  • libs/chatbot/package.json
  • apps/assisted-ui/src/components/App.tsx
  • apps/assisted-ui/src/main.tsx
  • apps/assisted-ui/env.template.js
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx
  • apps/assisted-ui/src/config.ts
  • apps/assisted-ui/Containerfile
  • apps/assisted-ui/vite.config.ts
  • apps/assisted-ui/deploy/nginx.conf
  • apps/assisted-ui/package.json
  • apps/assisted-ui/src/components/Chatbot.tsx
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.
📚 Learning: in the assisted-installer-ui chatbot feedback implementation, the onfeedbacksubmit callback requires...
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.

Applied to files:

  • apps/assisted-ui/README.md
🪛 markdownlint-cli2 (0.17.2)
apps/assisted-ui/README.md

98-98: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


99-99: Dollar signs used before commands without showing output

(MD014, commands-show-output)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: translation-files
  • GitHub Check: unit-tests
  • GitHub Check: circular-deps
  • GitHub Check: tests
  • GitHub Check: format
  • GitHub Check: lint
🔇 Additional comments (1)
apps/assisted-ui/README.md (1)

94-100: Consider clarifying “standalone UI” vs. dev-mode to avoid confusion

Earlier in the README the dev workflow is started with yarn start, whereas this snippet uses yarn start:assisted_ui.
A brief note (e.g., “The start:assisted_ui script runs the UI in standalone mode without the backend proxy …”) would help newcomers understand when to use each command.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 1, 2025
@openshift-ci
Copy link

openshift-ci bot commented Aug 1, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: celdrake, rawagner

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 83e1963 into openshift-assisted:master Aug 1, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants