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

refactor: always read pnpm.patchedDependencies from lockfile #1700

Merged
merged 1 commit into from
May 13, 2024

Conversation

jbedard
Copy link
Member

@jbedard jbedard commented May 3, 2024

Why load them different when running pnpm update? That makes it inconsistent, especially with lockfile v5.3 where the lockfile vs package.json will give different results (edit: but we no longer support 5.3).

Unlike other pnpm.* properties from the package.json this one does end up in the lockfile with additional metadata, so we will always read it from the lockfile and not package.json.


Test plan

  • Covered by existing test cases

Copy link

aspect-workflows bot commented May 3, 2024

Test

All tests were cache hits

190 tests (100.0%) were fully cached saving 51s.


Test

e2e/bzlmod

All tests were cache hits

4 tests (100.0%) were fully cached saving 467ms.


Test

e2e/gyp_no_install_script

All tests were cache hits

2 tests (100.0%) were fully cached saving 693ms.


Test

e2e/js_image_oci

All tests were cache hits

1 test (100.0%) was fully cached saving 9s.


Test

e2e/npm_link_package

All tests were cache hits

2 tests (100.0%) were fully cached saving 845ms.


Test

e2e/npm_link_package-esm

All tests were cache hits

2 tests (100.0%) were fully cached saving 773ms.


Test

e2e/npm_translate_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 73ms.


Test

e2e/npm_translate_lock_empty

All tests were cache hits

1 test (100.0%) was fully cached saving 73ms.


Test

e2e/npm_translate_lock_multi

All tests were cache hits

2 tests (100.0%) were fully cached saving 271ms.


Test

e2e/npm_translate_lock_partial_clone

All tests were cache hits

1 test (100.0%) was fully cached saving 117ms.


Test

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

1 test (100.0%) was fully cached saving 248ms.


Test

e2e/npm_translate_package_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 73ms.


Test

e2e/npm_translate_yarn_lock

All tests were cache hits

1 test (100.0%) was fully cached saving 73ms.


Test

e2e/package_json_module

All tests were cache hits

1 test (100.0%) was fully cached saving 511ms.


Test

e2e/pnpm_lockfiles

All tests were cache hits

6 tests (100.0%) were fully cached saving 2s.


Test

e2e/pnpm_workspace

All tests were cache hits

8 tests (100.0%) were fully cached saving 3s.


Test

e2e/pnpm_workspace_rerooted

All tests were cache hits

6 tests (100.0%) were fully cached saving 2s.


Test

e2e/repo_mapping

All tests were cache hits

2 tests (100.0%) were fully cached saving 451ms.


Test

e2e/rules_foo

All tests were cache hits

2 tests (100.0%) were fully cached saving 393ms.


Test

e2e/vendored_node

All tests were cache hits

1 test (100.0%) was fully cached saving 187ms.


Buildifier      Format

@jbedard jbedard requested a review from gregmagolan May 3, 2024 22:14
@jbedard jbedard marked this pull request as ready for review May 3, 2024 22:14
@gregmagolan
Copy link
Member

Why load them different when running pnpm update? That makes it inconsistent, especially with lockfile v5.3 where the lockfile vs package.json will give different results.
Or should we do the opposite? Note that some package.json pnpm.* properties are never in the lockfile, so maybe all those pnpm.* properties should be read from the package.json... 🤔

I think this divergence was needed back before we failed the build when the lock file is updated. Now that we do that we should be able to just load the list of patches from the lock file

@jbedard jbedard requested a review from gregmagolan May 6, 2024 05:37
@jbedard jbedard marked this pull request as draft May 7, 2024 00:15
@jbedard
Copy link
Member Author

jbedard commented May 13, 2024

I think we have to do the opposite to support other pnpm.* properties.

@jbedard jbedard closed this May 13, 2024
@jbedard jbedard reopened this May 13, 2024
@jbedard jbedard force-pushed the pnpm-patches-from-lock branch from abef3de to b90c242 Compare May 13, 2024 20:39
@jbedard jbedard changed the base branch from main to 2.x May 13, 2024 20:39
@jbedard jbedard marked this pull request as ready for review May 13, 2024 20:47
Copy link
Member

@gregmagolan gregmagolan left a comment

Choose a reason for hiding this comment

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

🌮

@jbedard jbedard merged commit e7b8868 into aspect-build:2.x May 13, 2024
2 checks passed
@jbedard jbedard deleted the pnpm-patches-from-lock branch May 13, 2024 22:08
jbedard added a commit to jbedard/rules_js that referenced this pull request May 14, 2024
jbedard added a commit to jbedard/rules_js that referenced this pull request May 16, 2024
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