Bump PF6 chatbot and disable markdown#3141
Bump PF6 chatbot and disable markdown#3141openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
Conversation
WalkthroughPatternFly packages were upgraded and imports migrated from Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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 unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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 effectiveYou 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 itlibs/chatbot/lib/components/ChatBot/BotMessage.tsx (1)
2-4: Prefer public exports for MessageLoading to avoid CJS path couplingImporting 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 resolutionsThe 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-iconsalias
– 6.2.2 pulled transitively
– legacy 5.x and 4.x versions for PF5 codepaths
• Chatbot is resolved cleanly to 6.4.0-prerelease.4To 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 treeYou 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.
⛔ Files ignored due to path filters (1)
yarn.lockis 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 correctSwitching 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 migratedImporting 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 yourpackage.jsoncontext around the override and to inspectyarn.lockfor all instances of@patternfly/react-iconsand their versions. Once this runs, we’ll know if only6.3.1is 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 pathThis 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 improvementUsing 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.
There was a problem hiding this comment.
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.
⛔ Files ignored due to path filters (1)
yarn.lockis 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.cssmatches the dependency bump.
7-7: Verify thatpatternfly-addons.cssresolves at build time
I wasn’t able to inspectnode_moduleshere, so please ensure after installing dependencies that:
node_modules/@patternfly-6/patternfly/patternfly-addons.cssexists (or revert to…/dist/patternfly-addons.cssif the path has changed).- No stale imports of
@patternfly-6/chatbot/dist/css/main.cssremain elsewhere in the codebase.
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherry-pick releases/v0.1-chatbot |
|
@rawagner: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
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. |
e6b83a4
into
openshift-assisted:master
|
@rawagner: new pull request created: #3142 DetailsIn response to this:
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. |
Summary by CodeRabbit
Bug Fixes
Chores