Skip to content

fix(pnpm-policy): invoke the CLI by path in the refresh workflow - #110

Merged
pyramation merged 1 commit into
mainfrom
fix/pnpm-policy-refresh-bin
Aug 5, 2026
Merged

fix(pnpm-policy): invoke the CLI by path in the refresh workflow#110
pyramation merged 1 commit into
mainfrom
fix/pnpm-policy-refresh-bin

Conversation

@pyramation

Copy link
Copy Markdown
Contributor

Summary

Second failure of the refresh workflow (run): the build step passes now, and the next one dies with ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL Command "pnpm-policy" not found.

pnpm resolves a workspace dependency to its publishConfig.directory only if that directory exists when the link is made. pnpm-policy has "bin": "cli.js" relative to dist/, and dist/ is created by the build step — which runs after install. So on a fresh checkout the bin link points at packages/pnpm-policy/cli.js, which does not exist. It works on a developer machine only because dist/ is usually already there from a previous build, which is exactly why this did not show up locally.

-run: pnpm --filter @constructive-io/pnpm-policy exec pnpm-policy inventory --cwd . --throttle …
+run: node packages/pnpm-policy/dist/cli.js inventory --cwd packages/constructive-pnpm-policy --throttle …

Same reasoning for the package's refresh script, which had the same latent dependency on a link made before the build.

Reproduced and verified locally under CI conditions (rm -rf the three dist/ dirs and node_modules/ of the data package, then pnpm install --frozen-lockfile): the old form fails with the identical error, the new form queries npm and rewrites the inventory. The resulting diff is generatedAt-only, so the workflow's suppression branch correctly declines to open a PR — also checked by running that condition against the real diff.

Link to Devin session: https://app.devin.ai/sessions/ffa3b012deac4eb7afb8f49a9af9f9ca
Requested by: @pyramation

pnpm resolves a workspace dependency to its publishConfig.directory only if
that directory exists when the link is made. The tool is built after install,
so on a fresh checkout the linked bin points at a cli.js that does not exist
and the job dies with "Command pnpm-policy not found".
@pyramation pyramation self-assigned this Aug 5, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@pyramation
pyramation merged commit 10cc2f5 into main Aug 5, 2026
59 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.

1 participant