OCPBUGS-81271: Trim subnet input in UDN creation form#425
Conversation
|
@pcbailey: This pull request references Jira Issue OCPBUGS-81271, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. 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 openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe subnet CIDR TextInput onChange now defensively parses input: it null-checks, splits by commas, trims each segment, filters out empty entries, and then calls setValue with the cleaned subnet array (validation still enabled). ChangesSubnet Input Sanitization
🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@pcbailey: This pull request references Jira Issue OCPBUGS-81271, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: 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 openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@src/views/udns/list/components/UserDefinedNetworkCreateForm.tsx`:
- Line 69: The setValue call for subnetField is producing [""] when the input is
cleared because "".trim().split(',') yields [""]; update the assignment in the
UserDefinedNetworkCreateForm so that the value passed to setValue is either an
empty array (or undefined per backend expectation) when the trimmed newValue is
empty — e.g. compute const subnets = newValue?.trim() ?
newValue.trim().split(',').map(s => s.trim()).filter(Boolean) : [] and pass
subnets into setValue(subnetField, ...); ensure you reference the existing
subnetField and setValue usage to locate the change.
- Line 69: The current call to setValue(subnetField,
newValue?.trim()?.split(','), ...) only trims the whole string and leaves
whitespace on individual CIDR entries; update the logic in
UserDefinedNetworkCreateForm where setValue is invoked to first split the input
by ',' then map over the resulting array to trim each CIDR and filter out any
empty strings (handle nullable newValue), and pass that cleaned array to
setValue(subnetField, ...), preserving the existing options object.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1335b910-37d8-4074-813b-448615290b3c
📒 Files selected for processing (1)
src/views/udns/list/components/UserDefinedNetworkCreateForm.tsx
3eb792e to
97beb73
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: avivtur, pcbailey 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 |
|
@pcbailey: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
@pcbailey: Jira Issue OCPBUGS-81271: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-81271 has been moved to the MODIFIED state. 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 openshift-eng/jira-lifecycle-plugin repository. |
Trim subnet input in the UserDefinedNetwork creation form to avoid error on submit.
Jira: https://redhat.atlassian.net/browse/OCPBUGS-81271
Summary by CodeRabbit