EDM-4063: Add docker:// protocol if link does not contain any#675
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Summary by CodeRabbit
WalkthroughSelectTargetStep.tsx adds protocol detection to artifact URLs. A PROTOCOL_REGEX constant identifies URLs with explicit protocols, and the download button's href conditionally prefixes docker:// only when no protocol is detected. ChangesProtocol-aware download button
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
libs/ui-components/src/components/Catalog/InstallWizard/steps/SelectTargetStep.tsx (1)
209-281:⚠️ Potential issue | 🟠 Major | ⚡ Quick winProtocol regex misclassifies
host:portimage refs as “already has protocol.”
/^[a-zA-Z][a-zA-Z0-9+.-]*:/matcheslocalhost:in values likelocalhost:5000/my-image, sohasProtocolbecomes true and Line 281 skips thedocker://prefix. That breaks the new behavior for common registry URLs without scheme.Use stricter detection (e.g., require
://or a small allowlist of expected schemes) so host:port is treated as no-protocol.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@libs/ui-components/src/components/Catalog/InstallWizard/steps/SelectTargetStep.tsx` around lines 209 - 281, The PROTOCOL_REGEX used by NewDeviceTarget (PROTOCOL_REGEX and hasProtocol) incorrectly treats host:port (e.g., localhost:5000/...) as having a scheme; change the detection to require an explicit scheme separator (e.g., "://") or match a small allowlist of known schemes so that values like "localhost:5000/..." are considered no-protocol and get the docker:// prefix; update PROTOCOL_REGEX and any uses of hasProtocol (where artifactUrl is checked before building href) accordingly so only true URIs (like "http://", "https://", "docker://", "oci://", etc.) bypass the docker:// prepend.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@libs/ui-components/src/components/Catalog/InstallWizard/steps/SelectTargetStep.tsx`:
- Around line 209-281: The PROTOCOL_REGEX used by NewDeviceTarget
(PROTOCOL_REGEX and hasProtocol) incorrectly treats host:port (e.g.,
localhost:5000/...) as having a scheme; change the detection to require an
explicit scheme separator (e.g., "://") or match a small allowlist of known
schemes so that values like "localhost:5000/..." are considered no-protocol and
get the docker:// prefix; update PROTOCOL_REGEX and any uses of hasProtocol
(where artifactUrl is checked before building href) accordingly so only true
URIs (like "http://", "https://", "docker://", "oci://", etc.) bypass the
docker:// prepend.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: b2d736dc-9312-43b7-a773-18caa7cda6eb
📒 Files selected for processing (1)
libs/ui-components/src/components/Catalog/InstallWizard/steps/SelectTargetStep.tsx
97f0434 to
0acdacd
Compare
* EDM-4058: Correctly identify RBAC exclusions (#671) Made-with: Cursor (cherry picked from commit afa4951) * EDM-3976 vulnerabilities empty state (#651) * No need to return placeholder when no configs exist Made-with: Cursor (cherry picked from commit 15c4ddc) * EDM-4008: Enforce only valid date range selection (#660) Made-with: Cursor (cherry picked from commit 5ee7434) * EDM-4020: Refresh vulnerability summary in Overview (#657) Made-with: Cursor (cherry picked from commit 4204596) * EDM-4063: Add docker:// protocol if link does not contain any (#675) (cherry picked from commit 24c25bf) Made-with: Cursor * EDM-4014 device logs cancel (#659) * EDM-4014: Add cancel button and improve overall UX * EDM-4012: Reset filters when logType changes * Fix disconnect banner for dark theme with suggested token Made-with: Cursor (cherry picked from commit 8c875e0) * EDM-4018: Allow search for vulnerabilities be case-insensitive (#656) * EDM-4018: Allow search for vulnerabilities be case-insensitive * Fix space not being an allowed character Made-with: Cursor (cherry picked from commit 623d65a) * EDM-4011: Fix parser missing footer depending on formatting (#663) Made-with: Cursor (cherry picked from commit 0ce4600) * EDM-4013 device logs search validations (#662) * EDM-4013: Block file paths with dots for moving away of /var/log * EDM-4013: Strengthen validations for systemd unit names Made-with: Cursor (cherry picked from commit ac370df) --------- Co-authored-by: Rastislav Wagner <rawagner@redhat.com>
No description provided.