NO-JIRA: Convert useTechPreviewFlagProvider to static function#15960
NO-JIRA: Convert useTechPreviewFlagProvider to static function#15960openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
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 |
📝 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)
Comment |
There was a problem hiding this comment.
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.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: logonoff, vojtechszocs 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 |
|
in a dev instance, turned off /verified by @logonoff |
|
@logonoff: This PR has been marked as verified by 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. |
|
/retest |
|
/hold Revision 762a071 was retested 3 times: holding |
|
/unhold |
|
@logonoff: 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. |
(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.