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

fix: handle git+ssh deps past pnpm 8.6.10 #1350

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

gregmagolan
Copy link
Member

@gregmagolan gregmagolan commented Nov 9, 2023

pnpm 8.6.10 changed the url format for git+ssh deps in the lock file in a way that rules_js doesn't handle.

with pnpm 8.6.9:

  github.com/aspect-build/test-private-npm-package/a09b6c1084c15c0dcd230a7017aefee66e6bb9db:
    resolution: {commit: a09b6c1084c15c0dcd230a7017aefee66e6bb9db, repo: git+ssh://git@github.com/aspect-build/test-private-npm-package.git, type: git}
    name: '@aspect-test/test-private-npm-package'
    version: 1.0.0
    dev: false

with pnpm 8.6.10:

  git@github.com+aspect-build/test-private-npm-package/a09b6c1084c15c0dcd230a7017aefee66e6bb9db:
    resolution: {commit: a09b6c1084c15c0dcd230a7017aefee66e6bb9db, repo: git@github.com:aspect-build/test-private-npm-package.git, type: git}
    name: '@aspect-test/test-private-npm-package'
    version: 1.0.0
    dev: false

Looks like the change in pnpm that had this effect comes from pnpm/pnpm#6806, which is listed in the 8.6.10 release notes


Type of change

  • Bug fix (change which fixes an issue)

Test plan

  • New test cases added

Without the fix the new e2e test repro'd the issue here: https://github.com/aspect-build/rules_js/actions/runs/6815533107/job/18534867343?pr=1350

ERROR: An error occurred during the fetch of repository 'aspect_rules_js~override~npm~npm__at_aspect-test_test-private-npm-package__git_github.com_aspect-build_test-private-npm-package_a09b6c1084c15c0dcd230a7017aefee66e6bb9db':
   Traceback (most recent call last):
	File "/home/runner/.cache/bazel/_bazel_runner/[44](https://github.com/aspect-build/rules_js/actions/runs/6815533107/job/18534867343?pr=1350#step:10:45)46d5ebe45e24f4686b119fe566ea1e/external/aspect_rules_js~override/npm/private/npm_import.bzl", line 499, column 38, in _npm_import_rule_impl
		_download_and_extract_archive(rctx)
	File "/home/runner/.cache/bazel/_bazel_runner/4446d5ebe45e24f4686b119fe566ea1e/external/aspect_rules_js~override/npm/private/npm_import.bzl", line 457, column 18, in _download_and_extract_archive
		rctx.download(
Error in download: java.io.IOException: Bad URL: git@github.com:aspect-build/test-private-npm-package.git
ERROR: <builtin>: fetching npm_import_rule rule //:aspect_rules_js~override~npm~npm__at_aspect-test_test-private-npm-package__git_github.com_aspect-build_test-private-npm-package_a09b6c1084c15c0dcd230a7017aefee66e6bb9db: Traceback (most recent call last):
	File "/home/runner/.cache/bazel/_bazel_runner/4446d5ebe45e24f4686b119fe566ea1e/external/aspect_rules_js~override/npm/private/npm_import.bzl", line 499, column 38, in _npm_import_rule_impl
		_download_and_extract_archive(rctx)
	File "/home/runner/.cache/bazel/_bazel_runner/4446d5ebe[45](https://github.com/aspect-build/rules_js/actions/runs/6815533107/job/18534867343?pr=1350#step:10:46)e24f[46](https://github.com/aspect-build/rules_js/actions/runs/6815533107/job/18534867343?pr=1350#step:10:47)86b119fe566ea1e/external/aspect_rules_js~override/npm/private/npm_import.bzl", line 457, column 18, in _download_and_extract_archive
		rctx.download(
Error in download: java.io.IOException: Bad URL: git@github.com:aspect-build/test-private-npm-package.git
ERROR: /home/runner/.cache/bazel/_bazel_runner/4446d5ebe45e24f4686b119fe566ea1e/external/aspect_rules_js~override~npm~npm/BUILD.bazel:18:6: @aspect_rules_js~override~npm~npm//:aspect_rules_js~override~npm~npm__at_aspect-test_test-private-npm-package__git_github.com_aspect-build_test-private-npm-package_a09b6c1084c15c0dcd230a7017aefee66e6bb9db_source_directory depends on @aspect_rules_js~override~npm~npm__at_aspect-test_test-private-npm-package__git_github.com_aspect-build_test-private-npm-package_a09b6c1084c15c0dcd230a7017aefee66e6bb9db//:source_directory in repository @aspect_rules_js~override~npm~npm__at_aspect-test_test-private-npm-package__git_github.com_aspect-build_test-private-npm-package_a09b6c1084c15c0dcd230a7017aefee66e6bb9db which failed to fetch. no such package '@aspect_rules_js~override~npm~npm__at_aspect-test_test-private-npm-package__git_github.com_aspect-build_test-private-npm-package_a09b6c1084c15c0dcd230a7017aefee66e6bb9db//': java.io.IOException: Bad URL: git@github.com:aspect-build/test-private-npm-package.git

@gregmagolan gregmagolan force-pushed the fix_git_ssh_past_pnpm_8_6_10 branch 5 times, most recently from 0d4efe9 to c70a225 Compare November 9, 2023 17:48
@gregmagolan gregmagolan marked this pull request as ready for review November 9, 2023 18:02
@gregmagolan gregmagolan force-pushed the fix_git_ssh_past_pnpm_8_6_10 branch 2 times, most recently from a8db374 to c72a4dc Compare November 10, 2023 02:29
@gregmagolan gregmagolan enabled auto-merge (squash) November 10, 2023 02:35
@gregmagolan gregmagolan merged commit 300f99e into main Nov 10, 2023
101 checks passed
@gregmagolan gregmagolan deleted the fix_git_ssh_past_pnpm_8_6_10 branch November 10, 2023 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants