Skip to content

Conversation

@eliorerz
Copy link
Owner

@eliorerz eliorerz commented Dec 9, 2025

  • Change label from "BCM Link" to "BCM Node"
  • Display only node UUID instead of full URL
  • Extract UUID from BCM link using regex pattern
  • Keep full URL as clickable link target

Summary by CodeRabbit

  • New Features

    • BCM link label updated to "BCM Node".
    • BCM links now display a concise node identifier parsed from the URL, with the full URL shown as a fallback.
    • Link styling improved for better readability while still opening in a new tab.
  • Chores

    • Production container image no longer includes the kubectl binary.

✏️ Tip: You can customize this high-level summary in your review settings.

- Change label from "BCM Link" to "BCM Node"
- Display only node UUID instead of full URL
- Extract UUID from BCM link using regex pattern
- Keep full URL as clickable link target
@coderabbitai
Copy link

coderabbitai bot commented Dec 9, 2025

Walkthrough

Renamed "BCM Link" to "BCM Node" and added regex-based extraction of a node ID from device URLs for display; removed wordBreak: 'break-all' inline style. Also removed production-stage installation of kubectl from the Dockerfile.

Changes

Cohort / File(s) Summary
BCM Node Display Enhancement
src/pages/HostDetail.tsx
Changed label from "BCM Link" to "BCM Node"; use regex /device/([a-f0-9-]+) to extract node ID from the URL and display it as link text with fallback to the full URL; keep external link icon and target behavior; removed wordBreak: 'break-all' inline style.
Production Image Cleanup
Dockerfile
Removed the RUN step in the production stage that installed curl and downloaded/moved kubectl into /usr/local/bin; production image no longer includes kubectl.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review regex in HostDetail.tsx for correct capture of expected device ID formats and proper fallback handling.
  • Verify link rendering (text, icon, target, and styling) across typical and edge-case URLs.
  • Confirm Dockerfile production stage no longer requires kubectl for runtime behavior and that build pipelines remain valid without it.

Poem

A rabbit hops through code so neat, 🐇
Sniffs out IDs from every street,
"BCM Node" I proudly sing,
Links are tidy, no more string.
The image trims a heavy shoe—light leaps anew. ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Update BCM display in host details' accurately reflects the primary change of updating how BCM links are displayed in the host details page.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Update-BCM-display-in-host-details

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3df621e and cc8e934.

📒 Files selected for processing (1)
  • Dockerfile (0 hunks)
💤 Files with no reviewable changes (1)
  • Dockerfile
⏰ 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). (2)
  • GitHub Check: Verify container build
  • GitHub Check: Build application

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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)
src/pages/HostDetail.tsx (1)

282-288: Implementation meets PR objectives. Consider a more precise UUID pattern.

The UUID extraction logic correctly preserves the full URL as the link target while displaying only the node ID. The fallback to the full URL ensures robustness if the regex doesn't match.

For stricter validation, consider using a more precise UUID pattern:

-                              {(() => {
-                                // Extract node ID from URL like: https://bcm.service.demo:8081/base-view/device/5d0ac70b-0b46-4338-9003-3d785d46b7e4
-                                const match = host.spec.bcm_link.match(/\/device\/([a-f0-9-]+)/i)
-                                return match ? match[1] : host.spec.bcm_link
-                              })()}
+                              {(() => {
+                                // Extract node ID from URL like: https://bcm.service.demo:8081/base-view/device/5d0ac70b-0b46-4338-9003-3d785d46b7e4
+                                const match = host.spec.bcm_link.match(/\/device\/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/i)
+                                return match ? match[1] : host.spec.bcm_link
+                              })()}

This ensures the pattern matches valid UUID format (8-4-4-4-12 hex digits) rather than any sequence of hex characters and hyphens.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 23b5e77 and 3df621e.

📒 Files selected for processing (1)
  • src/pages/HostDetail.tsx (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). (2)
  • GitHub Check: Build application
  • GitHub Check: Verify container build
🔇 Additional comments (1)
src/pages/HostDetail.tsx (1)

280-280: LGTM! Clear label change.

The label update from "BCM Link" to "BCM Node" accurately reflects that the display now shows the node UUID rather than a full URL.

- kubectl is not used by the Express server
- Reduces image size by ~50MB
- Reduces attack surface
- Improves container security posture
@eliorerz eliorerz merged commit 77d4208 into main Dec 10, 2025
6 checks passed
@eliorerz eliorerz deleted the Update-BCM-display-in-host-details branch December 10, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants