console icon indicating copy to clipboard operation
console copied to clipboard

Bump Yarn to v1 latest & add script to check PatternFly modules

Open vojtechszocs opened this issue 1 year ago • 2 comments

The aim of this PR is to avoid webpack build or performance issues due to multiple version resolutions of PatternFly packages.

  • Upgrade Yarn from version 1.22.15 (2021-09-30) to 1.22.22 (2024-03-09)
  • Check PatternFly package version resolutions as part of Console postinstall hook

Example - check resolutions on current Console code base

x1

Example - add @patternfly/patternfly :exclamation: and another dummy package to the list

x2

:exclamation: PKGS_TO_CHECK lists all PatternFly v5 packages, except for @patternfly/patternfly.

@patternfly/patternfly is excluded because a v4 package gets pulled in via @patternfly-4/react-console.

$ yarn why @patternfly/patternfly
..
=> Found "@patternfly/[email protected]"
..
=> Found "@patternfly-4/react-console#@patternfly/[email protected]"
..

Having multiple @patternfly/patternfly resolutions should be OK since this package only contains style related assets.

vojtechszocs avatar Mar 27 '24 19:03 vojtechszocs

@vojtechszocs: This pull request references CONSOLE-3997 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to this:

Follow-up to #13693

The aim of this PR is to avoid webpack build or performance issues due to multiple version resolutions of PatternFly packages.

  • Upgrade Yarn from version 1.22.15 (2021-09-30) to 1.22.22 (2024-03-09)
  • Check PatternFly package version resolutions as part of Console postinstall hook

Example - check resolutions on current Console code base

x1

Example - add @patternfly/patternfly :exclamation: and another dummy package to the list

x2

:exclamation: PKGS_TO_CHECK lists all PatternFly v5 packages, except for @patternfly/patternfly.

@patternfly/patternfly is excluded because a v4 package gets pulled in via @patternfly-4/react-console.

$ yarn why @patternfly/patternfly
..
=> Found "@patternfly/[email protected]"
..
=> Found "@patternfly-4/react-console#@patternfly/[email protected]"
..

Having multiple @patternfly/patternfly resolutions should be OK since this package only contains style related assets.

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.

openshift-ci-robot avatar Apr 02 '24 12:04 openshift-ci-robot

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, 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

openshift-ci[bot] avatar Apr 04 '24 14:04 openshift-ci[bot]

QE Approver: /assign @yapei Docs Approver: /assign @opayne1 PX Approver: /assign @RickJWagner

jhadvig avatar Apr 04 '24 14:04 jhadvig

/label px-approved

RickJWagner avatar Apr 04 '24 18:04 RickJWagner

/label docs-approved

opayne1 avatar Apr 04 '24 19:04 opayne1

This PR has been tested and no issue was found /qe-approved

XiyunZhao avatar Apr 11 '24 10:04 XiyunZhao

/label qe-approved

XiyunZhao avatar Apr 11 '24 11:04 XiyunZhao

@vojtechszocs: This pull request references CONSOLE-3997 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to this:

Follow-up to #13693

The aim of this PR is to avoid webpack build or performance issues due to multiple version resolutions of PatternFly packages.

  • Upgrade Yarn from version 1.22.15 (2021-09-30) to 1.22.22 (2024-03-09)
  • Check PatternFly package version resolutions as part of Console postinstall hook

Example - check resolutions on current Console code base

x1

Example - add @patternfly/patternfly :exclamation: and another dummy package to the list

x2

:exclamation: PKGS_TO_CHECK lists all PatternFly v5 packages, except for @patternfly/patternfly.

@patternfly/patternfly is excluded because a v4 package gets pulled in via @patternfly-4/react-console.

$ yarn why @patternfly/patternfly
..
=> Found "@patternfly/[email protected]"
..
=> Found "@patternfly-4/react-console#@patternfly/[email protected]"
..

Having multiple @patternfly/patternfly resolutions should be OK since this package only contains style related assets.

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.

openshift-bot avatar Apr 11 '24 11:04 openshift-bot

/retest-required

Remaining retests: 0 against base HEAD 7ea46e1b57fe28bdafcfd7cc39c79bcc9fa0677d and 2 for PR HEAD 9c74c4cf89c324807fd686099dc12175846fbc4f in total

openshift-ci-robot avatar Apr 11 '24 18:04 openshift-ci-robot

/retest-required

Remaining retests: 0 against base HEAD 86209ac83a333be49962a19a5afd3c58055964c1 and 1 for PR HEAD 9c74c4cf89c324807fd686099dc12175846fbc4f in total

openshift-ci-robot avatar Apr 12 '24 02:04 openshift-ci-robot

@vojtechszocs: all tests passed!

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

openshift-ci[bot] avatar Apr 12 '24 07:04 openshift-ci[bot]

[ART PR BUILD NOTIFIER]

This PR has been included in build openshift-enterprise-console-container-v4.16.0-202404120544.p0.g5de7277.assembly.stream.el9 for distgit openshift-enterprise-console. All builds following this will include this PR.

openshift-bot avatar Apr 12 '24 10:04 openshift-bot

@vojtechszocs, ./scripts/check-patternfly-modules.sh fails on MacOS. Probably ought to revert this in the interim as it blocks builds for Mac users (which is the majority of developers).

❯ ./build.sh 
# github.com/openshift/console/cmd/bridge
ld: warning: -bind_at_load is deprecated on macOS
ld: warning: '/private/var/folders/69/g46tnpnj0nn91q960rs6vw3h0000gn/T/go-link-1539668877/go.o' has malformed LC_DYSYMTAB, expected 126 undefined symbols to start at index 210109, found 146 undefined symbols starting at index 107
~/Git/console/frontend ~/Git/console
yarn install v1.22.22
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
warning Resolution field "[email protected]" is incompatible with requested version "minimist@~0.0.1"
warning Resolution field "[email protected]" is incompatible with requested version "minimist@^1.2.8"
success Already up-to-date.
$ ./scripts/check-patternfly-modules.sh && yarn prepare-husky && yarn generate
Checking \e[0;33myarn.lock\e[0m file for PatternFly module resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/quickstarts\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-catalog-view-extension\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-charts\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-component-groups\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-console\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-core\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-icons\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-log-viewer\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-styles\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-table\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-tokens\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-topology\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-user-feedback\e[0m has no version resolutions
grep: invalid option -- P
usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
\e[0;31m@patternfly/react-virtualized-extension\e[0m has no version resolutions
Run \e[0;33myarn why <pkg-name>\e[0m to inspect module resolution details
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

rhamilto avatar Apr 12 '24 12:04 rhamilto

@rhamilto Good catch, that issue should be fixed by https://github.com/openshift/console/pull/13757

vojtechszocs avatar Apr 12 '24 16:04 vojtechszocs