-
Notifications
You must be signed in to change notification settings - Fork 605
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
Bug 1768616: Allow gating RoutePage extensions by feature flags #3246
Bug 1768616: Allow gating RoutePage extensions by feature flags #3246
Conversation
@vojtechszocs: This pull request references Bugzilla bug 1768616, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. In 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 kubernetes/test-infra repository. |
cc @spadgett |
/assign |
@vojtechszocs I don't see any problems with the changes made to the network attachment definitions plugin. |
Ack @vojtechszocs |
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 can confirm that metal3-plugin routes are no more applied on cloud based cluster (AWS). On bare metal cluster the routes are applied as expected.
/test e2e-gcp-console |
/retest |
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.
/lgtm
Thanks everyone for the review, FYI the second commit 2d48790 removes @christianvogt Are you OK with that? The effective change is: - // use `withRouter` to force a re-render when routes change since we are using React.memo
const AppContents = connect((state: RootState) => ({
- activePerspective: getActivePerspective(state),
+ pageRouteExtensions: getPageRouteExtensions(state),
- }))(
- withRouter(
- React.memo(({ activePerspective }) => (
+ }))(({ pageRouteExtensions }) => ( |
), | ||
); | ||
pageRouteExtensions: getPageRouteExtensions(state), | ||
}))(({ pageRouteExtensions }) => ( |
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.
Won't this cause a re-render here on every state change since getPageRouteExtensions
returns a new array.
Specifically I forgot the use case for using memo
. But I believe this was all related to performance to reduce unnecessary re-renders.
@vojtechszocs Did you do any comparisons?
Edit note: the memo
and withRouter
was added before the use of connect
. It was used to prevent unnecessary re-renders.
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 did some comparisons. It doesn't look like we're worse than before.
However we have regressed (even without this change) from the original performance fix here: #1558
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.
Won't this cause a re-render here on every state change since
getPageRouteExtensions
returns a new array.
That's correct 😞
plugins.registry
.getRoutePages()
.filter((e) => plugins.registry.isExtensionInUse(e, flags))
yields a new array, due to filter
in getRoutePages()
. However, the content of such array should stay the same in case of state changes that don't effect RoutePage
extensions, since we're operating on the same extension objects (this.extensions
in ExtensionRegistry
).
I'll update the code to ensure we don't re-render unless RoutePage
extension required feature flags change.
@vojtechszocs Did you do any comparisons?
I'll update the code and will do some comparisons.
I did some comparisons. It doesn't look like we're worse than before.
However we have regressed (even without this change) from the original performance fix here: #1558
Maybe we can open a bug to track it so we don't forget about it.
/retest |
/hold |
2d48790
to
578d2d8
Compare
I've split This component split is very similar to existing Since Let me know what you think. |
I think you can based on the discussion above, #3246 (review). |
You don't need Latest change to the connect args looks better now. |
/lgtm |
/hold cancel |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, jtomasek, spadgett, vojtechszocs The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
@vojtechszocs: All pull requests linked via external trackers have merged. Bugzilla bug 1768616 has been moved to the MODIFIED state. In 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 kubernetes/test-infra repository. |
Follow up to #3066 (comment) the
RoutePage
extension now supports gating by Console feature flags.Entry modules of following plugins were modified to utilize this feature:
ceph-storage-plugin
(cc @cloudbehl)kubevirt-plugin
(cc @mareklibra)metal3-plugin
(cc @jtomasek)network-attachment-definition-plugin
(cc @pcbailey)noobaa-storage-plugin
(cc @afreen23)Entry module of
operator-lifecycle-manager
(cc @alecmerdler) now uses declared consumed extension types (theas
operator in TypeScript is a "force" cast and should be avoided if possible).@jtomasek Can you please verify this with existing Metal3 plugin routes?