Skip to content
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

CONSOLE-2904: Allow disabling dynamic plugins via query parameter #9363

Conversation

vojtechszocs
Copy link
Contributor

@vojtechszocs vojtechszocs commented Jun 28, 2021

This PR implements the disable-plugins query parameter as outlined in "Error Handling" section of OpenShift Console Dynamic Plugins feature page.

  • ?disable-plugins or ?disable-plugins= prevents loading of any dynamic plugins (disable all)
  • ?disable-plugins=foo,bar prevents loading of dynamic plugins named foo or bar (disable selectively)

This has no effect on static plugins, which are built into the Console application.

@openshift-ci openshift-ci bot added the component/core Related to console core functionality label Jun 28, 2021
@openshift-ci openshift-ci bot added component/sdk Related to console-plugin-sdk approved Indicates a PR has been approved by an approver from all required OWNERS files. component/shared Related to console-shared labels Jun 28, 2021
@vojtechszocs vojtechszocs force-pushed the allow-disabling-dynamic-plugins branch from 0e17237 to 0fcd6fb Compare June 28, 2021 18:49
@openshift-ci openshift-ci bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. component/olm Related to OLM kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated labels Jun 28, 2021
@vojtechszocs vojtechszocs changed the title Allow disabling dynamic plugins Allow disabling dynamic plugins via query parameter Jun 28, 2021

if (process.env.NODE_ENV !== 'production') {
// Expose Console plugin store for debugging
window.pluginStore = pluginStore;

// Expose function to load dynamic plugins directly from URLs
window.loadPluginFromURL = loadPluginFromURL;

This comment was marked as resolved.

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. We should update the dynamic plugins enhancement for the change to the query param (using "" instead of all to match all plugins).

@vojtechszocs vojtechszocs force-pushed the allow-disabling-dynamic-plugins branch from 0fcd6fb to 5b22935 Compare June 29, 2021 19:13
@openshift-ci openshift-ci bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 29, 2021
@vojtechszocs
Copy link
Contributor Author

Rebased and modified PluginStore to ensure allowedDynamicPluginNames is effectively immutable after initialization.

@spadgett
Copy link
Member

@vojtechszocs #8919 has merged, so you should be able to rebase

@vojtechszocs
Copy link
Contributor Author

Rebased and reflected the change in openshift/enhancements#820

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve
/assign @yapei @ahardin-rh @RickJWagner
for approvals
/hold

import { loadPluginFromURL } from '@console/dynamic-plugin-sdk/src/runtime/plugin-loader';
import { getURLSearchParams } from './components/utils/link';

const getAllowedDynamicPluginNames = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should this be getEnabledDynamicPluginNames?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, will update.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 1, 2021
@spadgett spadgett added this to the v4.9 milestone Jul 1, 2021
@spadgett spadgett changed the title Allow disabling dynamic plugins via query parameter CONSOLE-2904: Allow disabling dynamic plugins via query parameter Jul 1, 2021
@ahardin-rh
Copy link

/label docs-approved

@openshift-ci openshift-ci bot added the docs-approved Signifies that Docs has signed off on this PR label Jul 1, 2021
@vojtechszocs vojtechszocs force-pushed the allow-disabling-dynamic-plugins branch from 0fd8c59 to 234a4f7 Compare July 2, 2021 19:50
Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jul 2, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 2, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vojtechszocs
Copy link
Contributor Author

/retest

1 similar comment
@vojtechszocs
Copy link
Contributor Author

/retest

@yapei
Copy link
Contributor

yapei commented Jul 16, 2021

tested(detailed steps are in test case) and no issues found
/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Jul 16, 2021
@spadgett
Copy link
Member

/unassign @RickJWagner
/assign @sferich888
for px-approval

@sferich888 This lets users disable any dynamic plugin using a query parameter

@sferich888
Copy link

/label px-approved
/unassign @sferich888

@openshift-ci openshift-ci bot added the px-approved Signifies that Product Support has signed off on this PR label Jul 22, 2021
@spadgett
Copy link
Member

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 22, 2021
@openshift-merge-robot openshift-merge-robot merged commit f2712a7 into openshift:master Jul 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/olm Related to OLM component/sdk Related to console-plugin-sdk component/shared Related to console-shared docs-approved Signifies that Docs has signed off on this PR kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants