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: normalize pnpm lockfile data in parser #1735

Merged
merged 1 commit into from
May 21, 2024

Conversation

jbedard
Copy link
Member

@jbedard jbedard commented May 15, 2024

This way the data is standardized to a format for rules_js at parse time instead of elsewhere throughout the code.

Today the lockfile parsing normalizes to a version similar to pnpm lock v5, then _gather_package_info normalizes that a bit to a more rules_js specific format. The idea of this PR is to directly convert to that rules_js format as part of parsing, instead of pnpm vX => pnpm v5 => rules_js (where X = 5,6,9) we will have pnpm vX => rules_js and ideally have less code...


Changes are visible to end-users: no

Test plan

  • Covered by existing test cases

@jbedard jbedard force-pushed the pnpm-normalize branch 2 times, most recently from c3c3c43 to a8f655f Compare May 15, 2024 22:57
Copy link

aspect-workflows bot commented May 15, 2024

Test

All tests were cache hits

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


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

20 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-normalize branch 4 times, most recently from d87cfc4 to bd0d8ab Compare May 16, 2024 19:24
@jbedard jbedard changed the base branch from main to 2.x May 16, 2024 19:26
@jbedard jbedard force-pushed the pnpm-normalize branch 9 times, most recently from e54a9b5 to 4e17ddd Compare May 17, 2024 18:11
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 enabled auto-merge (squash) May 21, 2024 18:10
@jbedard jbedard merged commit aa106ad into aspect-build:2.x May 21, 2024
97 checks passed
@jbedard jbedard deleted the pnpm-normalize branch May 21, 2024 18:10
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.

None yet

2 participants