Skip to content

fix(W-23970082): auto-derive cache-dependency-path from packageManager input @W-23970082@ - #175

Merged
peternhale merged 1 commit into
mainfrom
wr/fix-cache-dependency-path
Aug 24, 2026
Merged

fix(W-23970082): auto-derive cache-dependency-path from packageManager input @W-23970082@#175
peternhale merged 1 commit into
mainfrom
wr/fix-cache-dependency-path

Conversation

@WillieRuemmele

Copy link
Copy Markdown
Contributor

Summary

@W-23970082@

  • Remove hardcoded defaults for cache-dependency-path (was yarn.lock in npmPublish, package-lock.json in ctcOpen/ctcClose)
  • Auto-derive the lockfile path from the packageManager/package-manager input when not explicitly set: yarn → yarn.lock, pnpm → pnpm-lock.yaml, npm → package-lock.json
  • Fixes salesforce-metadata-plugins (and any other npm repo) failing in npmPublish with "Some specified paths were not resolved, unable to cache dependencies"

Context

This is the inverse of salesforcecli/cli#2882 — that PR fixed the CLI (a yarn repo) getting npm defaults in ctcOpen. Now npm repos calling npmPublish were getting the yarn.lock default. This fix makes all three workflows self-consistent regardless of which package manager the caller uses.

Reported by Pallav Agarwal in #platform-cli-collaboration.

Test plan

  • Re-run salesforce-metadata-plugins publish workflow (npm repo, no cacheDependencyPath override) — should pass
  • Verify CLI promote workflow still passes (yarn repo, explicitly passes cache-dependency-path: yarn.lock)
  • Verify any pnpm repo passing packageManager: pnpm resolves to pnpm-lock.yaml

The shared workflows hardcoded mismatched defaults for
cache-dependency-path — npmPublish defaulted to yarn.lock (breaking npm
repos) while ctcOpen/ctcClose defaulted to package-lock.json (breaking
yarn repos called directly).

Now when cache-dependency-path is not explicitly set, it's derived from
the packageManager/package-manager input using a ternary expression:
yarn → yarn.lock, pnpm → pnpm-lock.yaml, otherwise package-lock.json.

Fixes salesforce-metadata-plugins npmPublish failures reported in
#platform-cli-collaboration.
@WillieRuemmele WillieRuemmele changed the title fix(W-23970082): auto-derive cache-dependency-path from packageManager input fix(W-23970082): auto-derive cache-dependency-path from packageManager input @W-23970082@ Aug 24, 2026
@peternhale
peternhale merged commit 68e00d9 into main Aug 24, 2026
4 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.

2 participants