fix: auto-derive cache-dependency-path from packageManager input - #174
Closed
WillieRuemmele wants to merge 1 commit into
Closed
fix: auto-derive cache-dependency-path from packageManager input#174WillieRuemmele wants to merge 1 commit into
WillieRuemmele wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cache-dependency-path(wasyarn.lockin npmPublish,package-lock.jsonin ctcOpen/ctcClose)packageManager/package-managerinput when not explicitly set: yarn →yarn.lock, pnpm →pnpm-lock.yaml, npm →package-lock.jsonsalesforce-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.lockdefault. 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
salesforce-metadata-pluginspublish workflow (npm repo, nocacheDependencyPathoverride) — should passcache-dependency-path: yarn.lock)packageManager: pnpmresolves topnpm-lock.yaml