Skip to content

Conversation

Wito-1
Copy link
Contributor

@Wito-1 Wito-1 commented Jul 9, 2025

This PR updates the helper message to the user when ASPECT_RULES_JS_FROZEN_PNPM_LOCK=true is set. Under bzlmod the output label to run is the canonical label, however, only includes one @ symbol, so if the user copy/pastes the command it fails to run. This PR tries to rectify it by adding the correct number of @@ symbols prior to the canonical label, eg:

           bazel run @@aspect_rules_js~~npm~npm//:sync

Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: yes
  • Breaking change (forces users to change their own code or config): no
  • Suggested release notes appear below: no

Test plan

  • Manual testing; please provide instructions so we can reproduce:
  1. Add update_pnpm_lock = True to e2e/bzlmod/MODULE.bazel
diff --git a/e2e/bzlmod/MODULE.bazel b/e2e/bzlmod/MODULE.bazel
index 9f04be97..bf9a2b8f 100644
--- a/e2e/bzlmod/MODULE.bazel
+++ b/e2e/bzlmod/MODULE.bazel
@@ -39,9 +39,11 @@ npm.npm_translate_lock(
         "less": "npm --version",
         "jasmine": "tsc --version",
     },
+    data = ["//:package.json"],
     npmrc = "//:.npmrc",
     pnpm_lock = "//:pnpm-lock.yaml",
     verify_node_modules_ignored = "//:.bazelignore",
+    update_pnpm_lock = True,
 )
 use_repo(npm, "npm")
  1. Modify a dependency in e2e/bzlmod/package.json, eg:
diff --git a/e2e/bzlmod/package.json b/e2e/bzlmod/package.json
index 3a825429..8e783bfc 100644
--- a/e2e/bzlmod/package.json
+++ b/e2e/bzlmod/package.json
@@ -4,7 +4,7 @@
     "dependencies": {
         "chalk": "5.3.0",
         "less": "4.1.3",
-        "jasmine": "5.0.2"
+        "jasmine": "5.0.0"
     },
     "pnpm": {
         "packageExtensions": {
  1. Attempt to build in e2e/bzlmod, eg:
$ e2e/bzlmod
$ bazel build --action_env=ASPECT_RULES_JS_FROZEN_PNPM_LOCK=true ...

before the change:

ERROR: `.aspect/rules/external_repository_action_cache/npm_translate_lock_LTE4Nzc1MDcwNjU=` is out of date. `pnpm-lock.yaml` may require an update. To update run,

           bazel run @aspect_rules_js~~npm~npm//:sync

after the change:

ERROR: `.aspect/rules/external_repository_action_cache/npm_translate_lock_LTE4Nzc1MDcwNjU=` is out of date. `pnpm-lock.yaml` may require an update. To update run,

           bazel run @@aspect_rules_js~~npm~npm//:sync

@CLAassistant
Copy link

CLAassistant commented Jul 9, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

aspect-workflows bot commented Jul 9, 2025

Test

All tests were cache hits

225 tests (100.0%) were fully cached saving 34s.


Test

e2e/bzlmod

All tests were cache hits

5 tests (100.0%) were fully cached saving 539ms.


Test

e2e/gyp_no_install_script

All tests were cache hits

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


Test

e2e/js_image_oci

All tests were cache hits

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


Test

e2e/npm_link_package

All tests were cache hits

3 tests (100.0%) were fully cached saving 533ms.


Test

e2e/npm_link_package-esm

All tests were cache hits

3 tests (100.0%) were fully cached saving 630ms.


Test

e2e/npm_translate_lock

All tests were cache hits

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


Test

e2e/npm_translate_lock_empty

All tests were cache hits

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


Test

e2e/npm_translate_lock_multi

All tests were cache hits

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


Test

e2e/npm_translate_lock_partial_clone

All tests were cache hits

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


Test

e2e/npm_translate_lock_replace_packages

All tests were cache hits

3 tests (100.0%) were fully cached saving 269ms.


Test

e2e/npm_translate_lock_subdir_patch

All tests were cache hits

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


Test

e2e/npm_translate_package_lock

Buildkite build #8811 is running...


Test

e2e/npm_translate_yarn_lock

All tests were cache hits

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


Test

e2e/package_json_module

All tests were cache hits

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


Test

e2e/pnpm_lockfiles

All tests were cache hits

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


Test

e2e/pnpm_workspace

All tests were cache hits

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


Test

e2e/pnpm_workspace_rerooted

All tests were cache hits

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


Test

e2e/repo_mapping

All tests were cache hits

3 tests (100.0%) were fully cached saving 410ms.


Test

e2e/rules_foo

All tests were cache hits

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


Test

e2e/runfiles

All tests were cache hits

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


Test

e2e/vendored_node

All tests were cache hits

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


Buildifier      Format

@Wito-1 Wito-1 changed the title Updating canonical label name when ASPECT_RULES_JS_FROZEN_PNPM_LOCK=true Update helper message when ASPECT_RULES_JS_FROZEN_PNPM_LOCK=true Jul 9, 2025
@Wito-1 Wito-1 marked this pull request as ready for review July 9, 2025 20:34
@jbedard jbedard merged commit 7a8e980 into aspect-build:main Jul 10, 2025
99 checks passed
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.

3 participants