Skip to content

fix: honor quiet mode#2750

Merged
sjinks merged 2 commits intotrunkfrom
fix/quiet-mode
Feb 26, 2026
Merged

fix: honor quiet mode#2750
sjinks merged 2 commits intotrunkfrom
fix/quiet-mode

Conversation

@sjinks
Copy link
Member

@sjinks sjinks commented Feb 26, 2026

Description

This pull request introduces an optional "quiet" mode to suppress console output in the development environment CLI and Lando integration. The main focus is to allow users or calling code to opt out of informational logs and messages during environment setup and bootstrapping.

The most important changes are:

Quiet mode support in CLI and Lando integration:

  • Added an optional quiet parameter to the getEnvironmentName function in dev-environment-cli.ts, which suppresses console output when set to true. [1] [2]
  • Extended the LandoBootstrapOptions interface in dev-environment-lando.ts to include a quiet property, allowing quiet mode to be passed through the bootstrapping process.
  • Updated the registerLogPathOutput function in dev-environment-lando.ts to accept a quiet argument and skip log path output when quiet is enabled. [1] [2]
  • Modified the bootstrapLando function to pass the quiet option to registerLogPathOutput, ensuring that log output respects the quiet mode setting.

Before:
Screenshot_20260226_171427

After:
Screenshot_20260226_171541

Changelog Description

Fixed

  • Do not display extra output when vip dev-env exec is run with --quiet

Pull request checklist

New release checklist

Steps to Test

vip dev-env exec -- wp user list

must not display the "COMMAND LOG FILE" message.

When running with a config file, there should be no "Using environment ..." message as well.

@sjinks sjinks self-assigned this Feb 26, 2026
@github-actions
Copy link
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@sonarqubecloud
Copy link

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a “quiet mode” pathway to the VIP dev-environment CLI and Lando bootstrap so informational console output can be suppressed during environment selection and command execution.

Changes:

  • Extend getEnvironmentName with a quiet argument to suppress the “Using environment …” message when a config-file slug is used.
  • Thread quiet through bootstrapLando to suppress the “COMMAND LOG FILE” exit output.
  • Update vip dev-env exec and vip dev-env import sql to pass --quiet into environment-name resolution (and for exec, into Lando bootstrap).

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/lib/dev-environment/dev-environment-lando.ts Adds quiet support to Lando bootstrap and suppresses exit-time log-path output.
src/lib/dev-environment/dev-environment-cli.ts Adds quiet parameter to getEnvironmentName to suppress config-file informational output.
src/bin/vip-dev-env-import-sql.js Passes --quiet into environment selection for import-sql.
src/bin/vip-dev-env-exec.js Passes --quiet into env selection and Lando bootstrap for exec.

Comment on lines 87 to +91
logPathRegistered = true;
if ( quiet ) {
return;
}

Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

registerLogPathOutput() sets logPathRegistered = true before the quiet early-return. If this function is first invoked with quiet=true and later invoked with quiet=false in the same process, the exit handler will never be registered and the log-path output will be permanently suppressed. Consider only setting logPathRegistered after deciding to register the exit hook, or tracking registration separately from the resolved log-path computation.

Suggested change
logPathRegistered = true;
if ( quiet ) {
return;
}
if ( quiet ) {
return;
}
logPathRegistered = true;

Copilot uses AI. Check for mistakes.
Comment on lines +152 to +156
if ( ! quiet ) {
console.log(
`Using environment ${ chalk.blue.bold( slug ) } from ${ chalk.gray(
configurationFileOptions.meta[ 'configuration-path' ]
) }\n`
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

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

The new quiet behavior suppresses the "Using environment …" informational log when a configuration file slug is used, but there isn't a test asserting the presence/absence of this output. Consider extending the existing getEnvironmentName test suite to verify console.log is called when quiet=false and not called when quiet=true for the configuration-file branch.

Copilot uses AI. Check for mistakes.
@sjinks sjinks merged commit 1306d72 into trunk Feb 26, 2026
23 checks passed
@sjinks sjinks deleted the fix/quiet-mode branch February 26, 2026 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants