Skip to content

Bump PF6 chatbot and disable markdown#3141

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

Bump PF6 chatbot and disable markdown#3141
openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
rawagner:bump_pf6

Conversation

@rawagner
Copy link
Member

@rawagner rawagner commented Aug 26, 2025

Summary by CodeRabbit

  • Bug Fixes

    • User messages in the chatbot no longer render Markdown, preventing unintended formatting and links.
    • Conversation fetches now support abort/cancel to avoid hanging requests.
  • Chores

    • Upgraded PatternFly packages to 6.3.1 for UI consistency and compatibility.
    • Switched chatbot components to the new @patternfly/chatbot (6.4.0-prerelease.4).
    • Updated dependency resolutions to ensure consistent icon and PatternFly asset versions.

@openshift-ci openshift-ci bot requested review from batzionb and celdrake August 26, 2025 14:08
@coderabbitai
Copy link

coderabbitai bot commented Aug 26, 2025

Walkthrough

PatternFly packages were upgraded and imports migrated from @patternfly-6/* to @patternfly/*, @patternfly/chatbot was added, CSS import paths updated, Message usage gained isMarkdownDisabled for non-bot messages, and a fetch to /v1/conversations was made cancellable via an AbortController signal.

Changes

Cohort / File(s) Summary of Changes
Dependency upgrades & resolutions
apps/assisted-ui/package.json, libs/chatbot/package.json, package.json
Upgrade PatternFly aliases and React bindings to 6.3.1, add @patternfly/chatbot@6.4.0-prerelease.4, remove legacy @patternfly-6/* aliases, and add root resolutions entry for chatbot react-icons.
Chatbot import migration
libs/chatbot/lib/components/ChatBot/BotMessage.tsx, .../ChatBot/ChatBot.tsx, .../ChatBot/ChatBotHistory.tsx, .../ChatBot/ChatBotWindow.tsx, .../ChatBot/helpers.ts
Replace imports from @patternfly-6/chatbot with @patternfly/chatbot; in ChatBotWindow.tsx pass isMarkdownDisabled for non-bot Message.
UI CSS path updates
apps/assisted-ui/src/components/Chatbot.tsx
Update PatternFly CSS import paths to new package locations.

Sequence Diagram(s)

sequenceDiagram
  participant UI as ChatBot UI
  participant History as ChatBotHistory
  participant API as /v1/conversations
  rect rgba(200,230,255,0.4)
    UI->>History: open conversation window
    Note right of History: create AbortController
    History->>API: onApiCall('/v1/conversations', { signal: abort.signal })
    API-->>History: response or AbortError
    alt aborted
      History->>UI: handle abort (no-op/cleanup)
    else success
      History->>UI: render conversation list
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

lgtm

Suggested reviewers

  • celdrake
  • batzionb
  • ammont82

Poem

A little hop through deps and imports,
I nudged the chatbot into fresher courts.
Abort the fetch if the user moves on,
Muzzle markdown when the bots are gone.
A rabbit's tweak — neat, small, and spry. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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 added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 26, 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 (6)
apps/assisted-ui/src/components/Chatbot.tsx (1)

6-7: CSS path update OK; consider aligning remaining PF paths for consistency

'@patternfly/chatbot/dist/css/main.css' is the right package path after the migration. If the repo is standardizing on '@patternfly/' imports (vs. '@patternfly-6/' aliases), consider aligning the addons stylesheet path for consistency.

Apply this minimal diff if/when you remove the '-6' aliases:

-import '@patternfly-6/patternfly/patternfly-addons.css';
+import '@patternfly/patternfly/patternfly-addons.css';

Please double-check in your local build that the chatbot styles load as expected (no missing icons/layout regressions).

libs/chatbot/lib/components/ChatBot/ChatBotHistory.tsx (2)

41-47: Wire AbortController signal into the fetch to make aborts effective

You create an AbortController but its signal isn't passed to the request, so aborting has no effect.

Apply:

-        const resp = await onApiCall('/v1/conversations');
+        const resp = await onApiCall('/v1/conversations', { signal: abortController.signal });

This keeps the existing onApiCall contract (typeof fetch) and enables proper cancellation.


57-57: Nit: fix typo in comment ("throws")

Minor readability improvement.

-        // aborting fetch trows 'AbortError', we can ignore it
+        // aborting fetch throws 'AbortError', we can ignore it
libs/chatbot/lib/components/ChatBot/BotMessage.tsx (1)

2-4: Prefer public exports for MessageLoading to avoid CJS path coupling

Importing from 'dist/cjs/.../MessageLoading' ties you to the package’s internal layout and may cause ESM/CJS interop quirks with modern bundlers.

If MessageLoading is re-exported by '@patternfly/chatbot', switch to:

-import { Message } from '@patternfly/chatbot';
-import MessageLoading from '@patternfly/chatbot/dist/cjs/Message/MessageLoading';
+import { Message, MessageLoading } from '@patternfly/chatbot';

If it’s not re-exported yet, consider opening an upstream issue or at least prefer the ESM path (dist/esm) in ESM builds.

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

6-9: Pin React Icons to v6.3.1 via Yarn resolutions

The PF6 bumps and Chatbot addition remain correct, but the lockfile shows multiple 6.x icon versions (6.2.2 and 6.3.1), which may lead to duplicate bundles at runtime:

• Lockfile entries for @patternfly/react-icons:
– 6.3.1 via @patternfly-6/react-icons alias
– 6.2.2 pulled transitively
– legacy 5.x and 4.x versions for PF5 codepaths
• Chatbot is resolved cleanly to 6.4.0-prerelease.4

To ensure only v6.3.1 of the PF6 icon set is used, add a Yarn resolution in apps/assisted-ui/package.json:

   "dependencies": {
     "@patternfly-6/patternfly": "npm:@patternfly/patternfly@6.3.1",
     "@patternfly-6/react-core": "npm:@patternfly/react-core@6.3.1",
     "@patternfly/chatbot": "6.4.0-prerelease.4",
     "@patternfly/patternfly": "5.2.0"
   },
+  "resolutions": {
+    "@patternfly/react-icons": "6.3.1"
+  }

Optional follow-up checks:

  • Verify CSS imports for PF6 and Chatbot are each included exactly once.
  • Confirm no other PF6 packages pull newer icon versions after adding the resolution.
libs/chatbot/package.json (1)

35-45: Reduce duplication between alias and direct PF6 deps to simplify the tree

You currently declare both the @patternfly-6/* aliases and the direct @patternfly/* 6.3.1 packages. This typically installs the same version twice under different names and can hinder deduping. Since the code in this package imports via @patternfly-6/* (and @patternfly/chatbot), consider keeping only the alias set plus @patternfly/chatbot to avoid redundancy.

Apply this diff to drop the duplicate direct entries:

   "dependencies": {
     "@patternfly-6/patternfly": "npm:@patternfly/patternfly@6.3.1",
     "@patternfly-6/react-core": "npm:@patternfly/react-core@6.3.1",
     "@patternfly-6/react-icons": "npm:@patternfly/react-icons@6.3.1",
     "@patternfly-6/react-styles": "npm:@patternfly/react-styles@6.3.1",
     "@patternfly-6/react-tokens": "npm:@patternfly/react-tokens@6.3.1",
     "@patternfly/chatbot": "6.4.0-prerelease.4",
-    "@patternfly/patternfly": "6.3.1",
-    "@patternfly/react-core": "6.3.1",
-    "@patternfly/react-icons": "6.3.1",
-    "@patternfly/react-styles": "6.3.1",
-    "@patternfly/react-tokens": "6.3.1",
     "file-saver": "^2.0.2",
     "lodash-es": "^4.17.21",
     "uuid": "^8.1"
   },

If other parts of this package import the unprefixed @patternfly/* paths, flip the recommendation: drop the alias set and keep the unprefixed packages, then update imports accordingly. The key is to use one scheme consistently.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b93e663 and cf687a4.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • apps/assisted-ui/package.json (1 hunks)
  • apps/assisted-ui/src/components/Chatbot.tsx (1 hunks)
  • libs/chatbot/lib/components/ChatBot/BotMessage.tsx (1 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBot.tsx (1 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotHistory.tsx (1 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (2 hunks)
  • libs/chatbot/lib/components/ChatBot/helpers.ts (1 hunks)
  • libs/chatbot/package.json (1 hunks)
  • package.json (1 hunks)
⏰ 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: circular-deps
  • GitHub Check: tests
  • GitHub Check: lint
  • GitHub Check: unit-tests
  • GitHub Check: format
🔇 Additional comments (6)
libs/chatbot/lib/components/ChatBot/helpers.ts (1)

2-2: PF Chatbot import migration looks correct

Switching Message to import from '@patternfly/chatbot' aligns with the PF6 bump. The local Pick<React.ComponentProps, 'role' | 'content' | 'timestamp'> remains valid with the new package.

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

2-2: Good: ChatbotToggle import migrated to '@patternfly/chatbot'

No API changes apparent for ChatbotToggle usage (tooltipLabel, isChatbotVisible, onToggleChatbot). Looks compatible with the PF6 bump.

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

6-6: Good: Chatbot conversation types/import migrated

Importing ChatbotConversationHistoryNav, ChatbotDisplayMode, and Conversation from '@patternfly/chatbot' matches the dependency update and the usage below remains type-compatible.

package.json (1)

24-25: I've added a script to display your package.json context around the override and to inspect yarn.lock for all instances of @patternfly/react-icons and their versions. Once this runs, we’ll know if only 6.3.1 is present (meaning the override worked) or if there are duplicates requiring manual checks.

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

20-20: Good migration to the new @patternfly/chatbot import path

This aligns with the dependency changes in the package.json files and avoids the deprecated @patternfly-6/chatbot alias. No issues spotted with the imported symbols.


184-185: Disabling Markdown for user messages is a solid safety/usability improvement

Using isMarkdownDisabled on user-authored messages reduces rendering surprises and mitigates content injection vectors. Two quick follow-ups to keep behavior consistent:

  • Confirm Message in @patternfly/chatbot@6.4.0-prerelease.4 exposes isMarkdownDisabled (type defs should enforce this).
  • Confirm bot messages still intentionally allow Markdown (looks intentional given the PR title), and that any links in bot output are sanitized upstream.

You can validate the prop at compile time; additionally, ensure no runtime peer/prop warnings in the console during dev.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between cf687a4 and cc51377.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • apps/assisted-ui/package.json (1 hunks)
  • apps/assisted-ui/src/components/Chatbot.tsx (1 hunks)
  • libs/chatbot/lib/components/ChatBot/BotMessage.tsx (1 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBot.tsx (1 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotHistory.tsx (3 hunks)
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (2 hunks)
  • libs/chatbot/lib/components/ChatBot/helpers.ts (1 hunks)
  • libs/chatbot/package.json (1 hunks)
  • package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (7)
  • libs/chatbot/lib/components/ChatBot/helpers.ts
  • libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx
  • libs/chatbot/lib/components/ChatBot/BotMessage.tsx
  • libs/chatbot/lib/components/ChatBot/ChatBot.tsx
  • libs/chatbot/lib/components/ChatBot/ChatBotHistory.tsx
  • package.json
  • libs/chatbot/package.json
⏰ 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: circular-deps
  • GitHub Check: unit-tests
  • GitHub Check: lint
  • GitHub Check: format
🔇 Additional comments (2)
apps/assisted-ui/src/components/Chatbot.tsx (2)

6-6: PF chatbot CSS import aligned to new package.

Importing from @patternfly/chatbot/dist/css/main.css matches the dependency bump.


7-7: Verify that patternfly-addons.css resolves at build time
I wasn’t able to inspect node_modules here, so please ensure after installing dependencies that:

  • node_modules/@patternfly-6/patternfly/patternfly-addons.css exists (or revert to …/dist/patternfly-addons.css if the path has changed).
  • No stale imports of @patternfly-6/chatbot/dist/css/main.css remain elsewhere in the codebase.

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

openshift-ci bot commented Aug 27, 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

@rawagner
Copy link
Member Author

/cherry-pick releases/v0.1-chatbot

@openshift-cherrypick-robot
Copy link
Contributor

@rawagner: once the present PR merges, I will cherry-pick it on top of releases/v0.1-chatbot in a new PR and assign it to you.

Details

In response to this:

/cherry-pick releases/v0.1-chatbot

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 kubernetes-sigs/prow repository.

@openshift-merge-bot openshift-merge-bot bot merged commit e6b83a4 into openshift-assisted:master Aug 27, 2025
11 checks passed
@openshift-cherrypick-robot
Copy link
Contributor

@rawagner: new pull request created: #3142

Details

In response to this:

/cherry-pick releases/v0.1-chatbot

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 kubernetes-sigs/prow repository.

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. 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