Skip to content

ci: upgrade pnpm to 9.1.2 #217

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

Merged
merged 1 commit into from
Jun 4, 2025
Merged

Conversation

warjiang
Copy link
Contributor

@warjiang warjiang commented Jun 3, 2025

What type of PR is this?
/kind bug

What this PR does / why we need it:
upgrade pnpm version otherwise pnpm will install latest dependencies instead of following the pnpm-lock file
Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 3, 2025
@karmada-bot karmada-bot requested review from devadapter and jhnine June 3, 2025 04:04
@warjiang
Copy link
Contributor Author

warjiang commented Jun 3, 2025

/assign @RainbowMango

@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 3, 2025
@RainbowMango
Copy link
Member

Echo from https://github.com/karmada-io/dashboard/actions/runs/15388148918/job/43291266877:

Error: src/components/panel/index.tsx(67,38): error TS2322: Type 'MenuItem[]' is not assignable to type 'Partial<BreadcrumbItemType & BreadcrumbSeparatorType>[]'.
Type 'MenuItem' is not assignable to type 'Partial<BreadcrumbItemType & BreadcrumbSeparatorType>'.
Index signature for type 'data-${string}' is missing in type 'MenuItem'.
 ELIFECYCLE  Command failed with exit code 2.

What's the root cause of it?

upgrade pnpm version otherwise pnpm will install latest dependencies instead of following the pnpm-lock file

Do you mean [email protected] always installs the latest dependencies?

@warjiang
Copy link
Contributor Author

warjiang commented Jun 3, 2025

Echo from https://github.com/karmada-io/dashboard/actions/runs/15388148918/job/43291266877:

Error: src/components/panel/index.tsx(67,38): error TS2322: Type 'MenuItem[]' is not assignable to type 'Partial<BreadcrumbItemType & BreadcrumbSeparatorType>[]'.
Type 'MenuItem' is not assignable to type 'Partial<BreadcrumbItemType & BreadcrumbSeparatorType>'.
Index signature for type 'data-${string}' is missing in type 'MenuItem'.
 ELIFECYCLE  Command failed with exit code 2.

What's the root cause of it?

upgrade pnpm version otherwise pnpm will install latest dependencies instead of following the pnpm-lock file

Do you mean [email protected] always installs the latest dependencies?

root cause is the mismatched version of pnpm(one in ci and the other one in pnpm-lock file)

pnpm-lock file has extra field to indicate the version of pnpm, in the main branch, the pnpm-lock file is generate by pnpm@9

lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false

but in the ci, we still use the outdated pnpm, outdated pnpm cannot follow the locked dependencies, it will install the latest dependencies and it will caused typescript types error. Because it will install the latest antd, but we developed the dashboard with a stable version of antd, and ci will fail finally.

As for when will the newer pnpm-lock file be introducted, I think it's in some special time, the latest antd is compatible with the antd which we used, so the pnpm-lock file be merged.

@warjiang
Copy link
Contributor Author

warjiang commented Jun 3, 2025

for the better way of pnpm management, we should follow the packageManager field in package.json

},
"dependencies": {
"dayjs": "^1.11.11"
},
"packageManager": "[email protected]",
"pnpm": {
"patchedDependencies": {
"[email protected]": "patches/[email protected]"

@@ -23,7 +23,7 @@ jobs:
- name: install node dependencies
uses: pnpm/action-setup@v4
with:
version: 8.15.6
version: 9.1.2
Copy link
Member

Choose a reason for hiding this comment

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

The pnpm version should follow the one from package.json, right?

"packageManager": "[email protected]",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exactly~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

one of best practice is corepack=> https://github.com/nodejs/corepack

Copy link
Member

Choose a reason for hiding this comment

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

So, how about adding one comment on it? like:

Suggested change
version: 9.1.2
# keep in sync with the packageManager version in ui/package.json
version: 9.1.2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, how about adding one comment on it? like:

+1
BTW, can I use your suggestion code directly on github, will it cause some DCO problem ?

Copy link
Member

Choose a reason for hiding this comment

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

May met the DCO problem and we have add the same comment at all 3 places, so I'd suggest go with a manual push.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done~

@karmada-bot karmada-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 3, 2025
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 4, 2025
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 4, 2025
@karmada-bot karmada-bot merged commit 5d1ee90 into karmada-io:main Jun 4, 2025
7 checks passed
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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants