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

Fix 'PLUGIN_VERSION' export from 'shared' #1497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SanjalKatiyar
Copy link
Collaborator

@SanjalKatiyar SanjalKatiyar commented Jul 26, 2024

There is no process object at runtime, this causes an issue when shared is consumed as a library and consumer is not explicitly defining a corresponding value of process.env.PLUGIN_VERSION during the bundler build.

Temporary workaround: if using webpack as a bundler, consumer of the shared needs to add:

    new webpack.DefinePlugin({
      ...
      'process.env.PLUGIN_VERSION': <SOME_DUMMY_VALUE>,
    }),

@alfonsomthd
Copy link
Collaborator

/lgtm

@SanjalKatiyar
Copy link
Collaborator Author

/test odf-console-e2e-aws

1 similar comment
@SanjalKatiyar
Copy link
Collaborator Author

/test odf-console-e2e-aws

@alfonsomthd
Copy link
Collaborator

/retest

Copy link
Contributor

openshift-ci bot commented Jul 29, 2024

@SanjalKatiyar: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/odf-console-e2e-aws 0966ed1 link true /test odf-console-e2e-aws

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

@@ -12,4 +12,4 @@ export const DEFAULT_NS = 'default';
export const RACK_LABEL = 'topology.rook.io/rack';
export const NOOBA_EXTERNAL_PG_SECRET_NAME = 'noobaa-external-pg';
export const NOOBAA_EXTERNAL_PG_TLS_SECRET_NAME = 'noobaa-external-pg-tls';
export const PLUGIN_VERSION = process.env.PLUGIN_VERSION;
export const PLUGIN_VERSION = process?.env?.PLUGIN_VERSION;
Copy link
Collaborator

Choose a reason for hiding this comment

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

E2E tests were always failing, so I saw the videos and reproduced locally:
Screenshot from 2024-07-30 08-58-10
From the MDN docs:
image

I tested this solution locally and it works:

Suggested change
export const PLUGIN_VERSION = process?.env?.PLUGIN_VERSION;
export const PLUGIN_VERSION = typeof process === 'undefined' ? undefined : process?.env?.PLUGIN_VERSION;

@openshift-ci openshift-ci bot removed the lgtm label Jul 30, 2024
Copy link
Contributor

openshift-ci bot commented Jul 30, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SanjalKatiyar

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants