Skip to content

Fix pnpm 12.2.1 compatibility: use --store-dir in prepareArtifactoryForPnpmBuild - #3692

Open
agrasth wants to merge 1 commit into
masterfrom
pm-compat/pnpm-12.2.1-1484166
Open

Fix pnpm 12.2.1 compatibility: use --store-dir in prepareArtifactoryForPnpmBuild#3692
agrasth wants to merge 1 commit into
masterfrom
pm-compat/pnpm-12.2.1-1484166

Conversation

@agrasth

@agrasth agrasth commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

TestPnpmPublishWorkspace, TestPnpmInstallAndPublishNormalProject, TestPnpmInstallAndPublishWorkspace, and TestPnpmInstallWithPreviousBuildCache all failed with:

error: unexpected argument '-s' found
Usage: pnpm install [OPTIONS]

The prepareArtifactoryForPnpmBuild helper (pnpm_test.go:514) constructed the cache-warm command with a single-dash long option:

jfrog pnpm install -store-dir=/path/to/caches

pnpm interprets -store-dir as the short flag -s followed by a positional argument tore-dir=..., and pnpm 12.x rejects unknown short flags with a hard error. All prior pnpm versions tolerated single-dash long options (as aliases or silently ignored), but pnpm 12 dropped that tolerance.

The same --store-dir flag was already spelled correctly (double-dash) everywhere else in the file — this was an isolated typo in the one test helper function.

Fix

Changed the single-dash -store-dir= to double-dash --store-dir= on line 514 of pnpm_test.go inside prepareArtifactoryForPnpmBuild. This is a test-only fix — no product behavior changed.

Compatibility impact

No exported symbols were changed. This is a one-character fix in a test helper function. All other supported pnpm versions are unaffected because --store-dir has been valid in pnpm since long before the supported range.

Test plan

  • go build ./...could not run: Go is not installed in the fix-authoring environment. The change is a string literal in a test file with no logic impact; a compile error here is not plausible.
  • gofmt -l pnpm_test.gocould not run for the same reason. The change is a single character inside a string literal; no formatting impact.
  • go vet ./...could not run for the same reason.
  • Existing unit tests for changed package — could not run (no live Artifactory in this environment).
  • The live PM integration test (pnpm 12.2.1 against the full test suite) cannot be run in this environment and must be re-triggered by CI.

…in test helper

prepareArtifactoryForPnpmBuild used a single-dash flag (-store-dir) which
pnpm 12.x no longer accepts as a long option, causing all tests that call
initPnpmFilesTest or initPnpmWorkspaceTest to fail with:
  error: unexpected argument '-s' found

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


pm-compat-fixer seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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.

1 participant