-
Notifications
You must be signed in to change notification settings - Fork 670
NO-JIRA: Convert useTechPreviewFlagProvider to static function #15960
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?
Conversation
|
@logonoff: This pull request explicitly references no jira issue. 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. |
|
/label px-approved |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: logonoff 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 pull request refactors the tech preview feature flag initialization in OpenShift Console. The change migrates from a hook-based provider pattern ( 🚥 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)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Comment |
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 `@frontend/packages/console-app/src/features/tech-preview.ts`:
- Around line 4-5: The current handler sets FLAG_TECH_PREVIEW from
window.SERVER_FLAGS.techPreview which can throw if SERVER_FLAGS is undefined;
update the handler (function name: handler) to defensively read the flag using
optional chaining and a default false (e.g., base the value on
window.SERVER_FLAGS?.techPreview || false or
Boolean(window.SERVER_FLAGS?.techPreview)) before calling
setFeatureFlag(FLAG_TECH_PREVIEW, ...), ensuring no runtime TypeError when
SERVER_FLAGS is missing.
|
@logonoff: The following test failed, say
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. |
(s3e5 "Initiation")
window.SERVER_FLAGSis generated by the backend server and is known to not change. Thus, we do not need a hook and ReactNode for this flag, and we can simplify this to a simpleconsole.flagfor performanceSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.