-
Notifications
You must be signed in to change notification settings - Fork 57
CNV-77387: GA Eject/Inject CD-ROM - remove feature gate switch #3439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
CNV-77387: GA Eject/Inject CD-ROM - remove feature gate switch #3439
Conversation
|
@upalatucci: This pull request references CNV-77383 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "4.22.0" version, but no target version was set. 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. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: upalatucci 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 |
📝 WalkthroughWalkthroughThis PR removes the Advanced CD-ROM features functionality by deleting translation entries across six language locales, eliminating the feature flag constant, removing related helper functions, and cleaning up all component references to this feature flag. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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 |
- Remove 'Enable advanced CD-ROM features' toggle from Settings > Preview features - Show Mount/Eject for CD-ROM disks without checking declarative hotplug feature gate - Eject/Inject CD-ROM is now generally available in the UI
9f4b961 to
040aea4
Compare
|
@upalatucci: This pull request references CNV-77387 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. 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. |
|
@upalatucci: This pull request references CNV-77387 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. 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. |
|
@upalatucci: This pull request references CNV-77387 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/utils/components/DiskModal/utils/helpers.ts`:
- Around line 324-326: Change the isHotPluggableEnabled signature to include an
explicit boolean return type and allow undefined input: update the function
declaration for isHotPluggableEnabled to have a return type of boolean (and make
the featureGates parameter optional if you want to preserve the current
undefined-safe behavior), keeping the body as-is and continuing to reference
HotPlugFeatures.HotplugVolumes.
| export const isHotPluggableEnabled = (featureGates: string[]) => { | ||
| if (isDeclarativeHotplugVolumesEnabled(featureGates)) { | ||
| if (!featureGates?.includes(HotPlugFeatures.HotplugVolumes)) { | ||
| return true; | ||
| } | ||
| } | ||
| return false; | ||
| return !featureGates?.includes(HotPlugFeatures.HotplugVolumes); | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n src/utils/components/DiskModal/utils/helpers.ts | sed -n '320,330p'Repository: kubevirt-ui/kubevirt-plugin
Length of output: 413
🏁 Script executed:
rg -n 'DeclarativeHotplugVolumes' --type=ts --type=tsxRepository: kubevirt-ui/kubevirt-plugin
Length of output: 98
🏁 Script executed:
rg -n 'HotPlugFeatures' src/utils/components/DiskModal/utils/helpers.ts -A 2 -B 2Repository: kubevirt-ui/kubevirt-plugin
Length of output: 437
🏁 Script executed:
rg -n 'DeclarativeHotplugVolumes' --type tsRepository: kubevirt-ui/kubevirt-plugin
Length of output: 696
🏁 Script executed:
fd constants.ts | head -5 | xargs cat -n | head -100Repository: kubevirt-ui/kubevirt-plugin
Length of output: 1685
🏁 Script executed:
rg -n 'isDeclarativeHotplugVolumesEnabled' --type tsRepository: kubevirt-ui/kubevirt-plugin
Length of output: 53
🏁 Script executed:
cat -n src/utils/components/DiskModal/utils/constants.ts | head -50Repository: kubevirt-ui/kubevirt-plugin
Length of output: 903
Add explicit return type for consistency with coding guidelines.
The logic simplification is correct, and the optional chaining handles undefined input gracefully. However, add an explicit return type annotation:
-export const isHotPluggableEnabled = (featureGates: string[]) => {
+export const isHotPluggableEnabled = (featureGates: string[]): boolean => {
return !featureGates?.includes(HotPlugFeatures.HotplugVolumes);
};Note: HotPlugFeatures.DeclarativeHotplugVolumes remains actively used in the codebase for the Advanced CD-ROM feature flag functionality, so it is not dead code.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| export const isHotPluggableEnabled = (featureGates: string[]) => { | |
| if (isDeclarativeHotplugVolumesEnabled(featureGates)) { | |
| if (!featureGates?.includes(HotPlugFeatures.HotplugVolumes)) { | |
| return true; | |
| } | |
| } | |
| return false; | |
| return !featureGates?.includes(HotPlugFeatures.HotplugVolumes); | |
| }; | |
| export const isHotPluggableEnabled = (featureGates: string[]): boolean => { | |
| return !featureGates?.includes(HotPlugFeatures.HotplugVolumes); | |
| }; |
🤖 Prompt for AI Agents
In `@src/utils/components/DiskModal/utils/helpers.ts` around lines 324 - 326,
Change the isHotPluggableEnabled signature to include an explicit boolean return
type and allow undefined input: update the function declaration for
isHotPluggableEnabled to have a return type of boolean (and make the
featureGates parameter optional if you want to preserve the current
undefined-safe behavior), keeping the body as-is and continuing to reference
HotPlugFeatures.HotplugVolumes.
| }; | ||
|
|
||
| export const isHotPluggableEnabled = (featureGates: string[]) => { | ||
| if (isDeclarativeHotplugVolumesEnabled(featureGates)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that we can confirm that we no longer need to explicitly check if there is a discrepancy between the two featuregates. Are both featuregates removed on 4.22?
|
/hold we don't know if the feature gate will be removed for 4.22 |
Summary
Implements CNV-77387: UI: GA Eject/Inject CD-ROM Support — remove the feature gate switch so the feature is generally available.
Changes
isDeclarativeHotplugVolumesEnabled; simplifiedisHotPluggableEnabled. Add CD-ROM modal no longer gates on the feature.Acceptance criteria
Summary by CodeRabbit
Release Notes