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: do not include registry url in package keys #1759

Merged
merged 1 commit into from
May 28, 2024

Conversation

jbedard
Copy link
Member

@jbedard jbedard commented May 28, 2024

Pre-v9 pnpm lock files are a bit of a mess, as I keep learning.

It seems like when a non-default registry is used on a package the package.* key in pnpm-lock.yaml then gets the default registry as a prefix. Then the resolution gets {registry: https://registry.yarnpkg.com/, tarball: https://registry.npmjs.org} (that's right, the tarball points to the default registry, despite our npmrc configuring the registry to the yarnpkg). See https://github.com/aspect-build/rules_js/blob/v2.0.0-rc1/npm/private/npm_translate_lock_helpers.bzl#L424-L429

This PR drops that default registry from the package.* keys, which means all the generated bzl files, all the arrays of dep versions etc etc.

See the diffs on all the snapshot tests.


Changes are visible to end-users: no

Test plan

  • Covered by existing test cases

@jbedard jbedard requested a review from gregmagolan May 28, 2024 04:56
@jbedard jbedard marked this pull request as draft May 28, 2024 04:58
@jbedard jbedard force-pushed the pnpm-url-versioned branch from b6a7f6a to 6b791a3 Compare May 28, 2024 05:00
Copy link

aspect-workflows bot commented May 28, 2024

Test

All tests were cache hits

191 tests (100.0%) were fully cached saving 53s.


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 1s.


Test

e2e/npm_link_package-esm

All tests were cache hits

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


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 520ms.


Test

e2e/pnpm_lockfiles

All tests were cache hits

21 tests (100.0%) were fully cached saving 7s.


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 605ms.


Test

e2e/vendored_node

All tests were cache hits

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


Buildifier      Format

@jbedard jbedard force-pushed the pnpm-url-versioned branch 4 times, most recently from 68f6c01 to e62caba Compare May 28, 2024 05:27
@jbedard jbedard marked this pull request as ready for review May 28, 2024 05:40
@jbedard jbedard force-pushed the pnpm-url-versioned branch from e62caba to ff9c6d7 Compare May 28, 2024 05:43
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 629c4cf into aspect-build:main May 28, 2024
98 checks passed
@jbedard jbedard deleted the pnpm-url-versioned branch May 28, 2024 16:24
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