Skip to content

fix: silence verify-deps auto-install output#11679

Merged
zkochan merged 2 commits into
pnpm:mainfrom
cyphercodes:fix-verify-deps-silent-run
May 17, 2026
Merged

fix: silence verify-deps auto-install output#11679
zkochan merged 2 commits into
pnpm:mainfrom
cyphercodes:fix-verify-deps-silent-run

Conversation

@cyphercodes

@cyphercodes cyphercodes commented May 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Pass the caller's silent reporter state into the verifyDepsBeforeRun: install auto-install path.
  • Run that internal install with a silent reporter and without inherited stdout when the parent command is silent.
  • Add regressions for silent pnpm run and pnpm exec so auto-install output cannot contaminate stdout.

Fixes #11636

Tests

  • pnpm --filter @pnpm/exec.pnpm-cli-runner run compile
  • pnpm --filter @pnpm/exec.commands run compile
  • pnpm --filter pnpm run compile
  • NODE_OPTIONS="--experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169" /root/.hermes/node/bin/node "$JEST_BIN" --no-coverage --runInBand test/createInstallArgs.test.ts from exec/commands
  • NODE_OPTIONS="--experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169" /root/.hermes/node/bin/node "$JEST_BIN" --no-coverage --runInBand test/verifyDepsBeforeRun.ts from exec/commands
  • NODE_OPTIONS="--experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169" /root/.hermes/node/bin/node "$JEST_BIN" --no-coverage --runInBand test/run.ts -t 'silent run does not print verifyDepsBeforeRun install output' from pnpm
  • NODE_OPTIONS="--experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169" /root/.hermes/node/bin/node "$JEST_BIN" --no-coverage --runInBand test/exec.ts -t 'silent exec does not print verifyDepsBeforeRun install output' from pnpm
  • git diff --cached --check
  • git diff --check

Notes

No pacquet change is included: this is in the TypeScript-only run/exec path, while pacquet currently only implements install.


Written by an agent (Hermes Agent, gpt-5.5).

Summary by CodeRabbit

  • Bug Fixes

    • --silent now correctly suppresses auto-install output when dependencies are installed before running pnpm run or pnpm exec, so only the invoked script’s output appears on stdout.
  • Tests

    • Added tests verifying --silent behavior for both run and exec scenarios with auto-dependency installation.
  • Chores

    • Added release metadata to trigger patch releases.

Review Change Stack

@cyphercodes cyphercodes requested a review from zkochan as a code owner May 16, 2026 03:37
@coderabbitai

coderabbitai Bot commented May 16, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d5a55173-d07b-470c-8bed-344d1daa02dc

📥 Commits

Reviewing files that changed from the base of the PR and between ff725bf and e5dc81f.

📒 Files selected for processing (6)
  • .changeset/fix-verify-deps-silent-install.md
  • exec/commands/src/exec.ts
  • exec/commands/src/runDepsStatusCheck.ts
  • exec/pnpm-cli-runner/src/index.ts
  • pnpm/test/exec.ts
  • pnpm/test/run.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/fix-verify-deps-silent-install.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • pnpm/test/exec.ts
  • pnpm/test/run.ts
  • exec/pnpm-cli-runner/src/index.ts
  • exec/commands/src/exec.ts
  • exec/commands/src/runDepsStatusCheck.ts
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Compile & Lint

📝 Walkthrough

Walkthrough

Adds an optional reporter option to exec types and runDepsStatusCheck, exposes reporter in runPnpmCli and appends --reporter=<reporter> to the invoked pnpm CLI; includes tests and a changeset documenting that auto-install honors --silent.

Changes

Reporter threading and tests

Layer / File(s) Summary
CLI runner reporter option
exec/pnpm-cli-runner/src/index.ts
Export RunPnpmCliOptions (cwd, optional reporter); runPnpmCli appends --reporter=<reporter> when provided and uses the constructed cliCommand for all exec paths.
Command types and deps check plumbing
exec/commands/src/exec.ts, exec/commands/src/runDepsStatusCheck.ts
ExecOpts now includes reporter from Config; RunDepsStatusCheckOptions adds reporter?: Config['reporter'] and passes { reporter: opts.reporter } to the runPnpmCli install runner.
Tests for silent install output behavior
pnpm/test/exec.ts, pnpm/test/run.ts
New Jest tests ensure pnpm exec --silent and pnpm run --silent do not print verifyDepsBeforeRun=install output while preserving the executed script stdout; includes workspace YAML helper import.
Changeset entry
.changeset/fix-verify-deps-silent-install.md
Adds a changeset documenting a patch release and that auto-install respects --silent (refs #11636).

Sequence Diagram(s)

sequenceDiagram
  participant ExecCommand as Exec command
  participant DepsCheck as runDepsStatusCheck
  participant CliRunner as runPnpmCli
  participant PNPM as pnpm process
  ExecCommand->>DepsCheck: invoke with opts.reporter
  DepsCheck->>CliRunner: start install runner ({ cwd, reporter })
  CliRunner->>PNPM: exec cliCommand (includes --reporter=<reporter>)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • zkochan

Poem

A rabbit whispers, soft and spry, 🐇
"Reporter threaded, logs glide by.
Silent installs keep your stage serene,
Only your script's own voice is seen.
Hop quiet, hop steady—ready, set, green!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: silencing the output from the auto-install that occurs when verifyDepsBeforeRun is set to install.
Linked Issues check ✅ Passed Changes successfully address issue #11636 by propagating the --silent reporter through the auto-install path to prevent unwanted stdout contamination when running scripts with --silent.
Out of Scope Changes check ✅ Passed All changes directly support the fix for issue #11636; type system updates, reporter propagation, and regression tests are all within scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread exec/pnpm-cli-runner/src/index.ts Outdated
const execOpts = {
cwd,
stdio: 'inherit' as const,
stdio: silent ? ['inherit', 'ignore', 'inherit'] as const : 'inherit' as const,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed if reporter already set to silent?

Comment thread exec/commands/src/runDepsStatusCheck.ts Outdated

const command = ['install', ...createInstallArgs(workspaceState?.settings)]
const install = runPnpmCli.bind(null, command, { cwd: opts.dir })
const install = runPnpmCli.bind(null, command, { cwd: opts.dir, silent: opts.reporter === 'silent' })

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not passing in the reporter itself?

@cyphercodes

Copy link
Copy Markdown
Contributor Author

Updated this PR to address the review feedback:

  • runPnpmCli() now accepts the caller's reporter and forwards it to the nested install as --reporter=<reporter>.
  • Removed the extra stdio suppression; --reporter=silent is responsible for silencing pnpm's install output.

Local verification:

  • corepack prepare pnpm@11.1.1 --activate
  • pnpm install
  • pnpm --filter @pnpm/exec.pnpm-cli-runner compile
  • pnpm --filter @pnpm/exec.commands compile
  • pnpm --filter pnpm compile
  • pnpm exec eslint exec/pnpm-cli-runner/src/index.ts exec/commands/src/runDepsStatusCheck.ts pnpm/test/run.ts pnpm/test/exec.ts
  • git diff --check

Note: I also attempted the narrow Jest specs directly from pnpm/, but this agent environment fails before running tests with Jest/ESM setup errors (module is already linked / Cannot use import statement outside a module). The source compile and lint checks above passed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@exec/pnpm-cli-runner/src/index.ts`:
- Around line 11-14: The current execOpts object hardcodes stdio: 'inherit'
which prevents silent installs; update index.ts to compute stdio from the
runner's reporter parameter instead of always using 'inherit' (e.g., set
execOpts.stdio = reporter === 'silent' ? ['ignore','ignore','inherit'] :
'inherit') so callers can suppress stdout, and ensure runDepsStatusCheck.ts
(which invokes the install) can pass or receive that stdio value when
verifyDepsBeforeRun: install is used; adjust any call sites that construct
execOpts or call the internal install command to use the new computed stdio
logic.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 16f8bdf0-3a47-4f0b-9d07-96094783bbb4

📥 Commits

Reviewing files that changed from the base of the PR and between 169a610 and ff725bf.

📒 Files selected for processing (2)
  • exec/commands/src/runDepsStatusCheck.ts
  • exec/pnpm-cli-runner/src/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • exec/commands/src/runDepsStatusCheck.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Compile & Lint
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use Standard Style with modifications: trailing commas are used, functions are preferred over classes, functions are declared after they are used (hoisting is relied upon).
Functions should have no more than two or three arguments. If a function needs more parameters, use a single options object instead.
Maintain import order: (1) Standard libraries, (2) External dependencies (sorted alphabetically), (3) Relative imports.

Files:

  • exec/pnpm-cli-runner/src/index.ts
🧠 Learnings (1)
📚 Learning: 2026-05-14T09:04:00.133Z
Learnt from: zkochan
Repo: pnpm/pnpm PR: 11622
File: resolving/npm-resolver/test/publishedBy.test.ts:350-354
Timestamp: 2026-05-14T09:04:00.133Z
Learning: In the pnpm/pnpm repository, ESLint is the authoritative style linter. Do not raise review findings for missing trailing commas in multiline function calls (e.g., `fs.writeFileSync(...)`) when this repo’s ESLint configuration does not report them and lint passes. Prefer deferring to the ESLint results for this specific trailing-comma rule rather than enforcing it manually in code review.

Applied to files:

  • exec/pnpm-cli-runner/src/index.ts

Comment thread exec/pnpm-cli-runner/src/index.ts
@zkochan zkochan force-pushed the fix-verify-deps-silent-run branch from ff725bf to e5dc81f Compare May 17, 2026 23:47
@zkochan zkochan merged commit 247d70b into pnpm:main May 17, 2026
6 of 7 checks passed
KSXGitHub pushed a commit that referenced this pull request May 18, 2026
… in new test fixtures

origin/main advanced with four PRs touching files this branch also changes:

- #11679 (fix: silence verify-deps auto-install output) — TS only, no conflict with pacquet/.
- #11705 (feat: tighten minimumReleaseAge) — TS only, no conflict.
- #11708 (refactor(pacquet): optional DI pattern + documentation) —
  renames the test-DI seam (`Api` generic → `Sys`, `RealApi` → `Host`,
  `FsReadString` → `FsReadToString`, fakes drop `*Api` suffix) across
  modules-yaml / cmd-shim / config / reporter / package-manager / cli,
  and adds a "Dependency injection for tests" section to
  `pacquet/CODE_STYLE_GUIDE.md` plus a corresponding rule 7 in
  `pacquet/AGENTS.md`. Most files auto-merged cleanly with this branch's
  single-letter renames; only `pacquet/crates/patching/Cargo.toml`
  needed a manual resolve where this branch added `[lints] workspace = true`
  and main added `text-block-macros` to dev-dependencies — combined.
- #11710 (test(pacquet): coverage) — adds 44 unit + integration tests.
  Two of the new closures (`|v|` in `registry/package/tests.rs:84` and
  `|e|` in `lockfile/save_lockfile/tests.rs:337`) tripped
  `perfectionist::single_letter_closure_param` because they predate this
  branch's enablement of the rule; renamed to `|version|` / `|entry|` to
  keep dylint at zero warnings post-merge.

Verified: `cargo check --workspace --tests --locked` clean,
`cargo dylint --all -- --all-targets --workspace` clean,
`cargo fmt --check` clean.
@melroy89

melroy89 commented May 26, 2026

Copy link
Copy Markdown

verifyDepsBeforeRun seems now be true by default in v11.1.3, was this a regression issue?

In my docker setup using pnpm v11 it will try to run a pnpm.mjs install --production --no-optional command on each pnpm exec command basically.

Workaround: I need to set verifyDepsBeforeRun to false in my pnpm-workspace.yaml file. The docs says its by default false (which was definitely not the case for me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

verifyDepsBeforeRun: install does not respect the --silent option

3 participants