Skip to content

Default ask mode for developers#22369

Open
MikeMcQuaid wants to merge 1 commit into
mainfrom
ask-default-for-developers
Open

Default ask mode for developers#22369
MikeMcQuaid wants to merge 1 commit into
mainfrom
ask-default-for-developers

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • Exercise the upcoming ask-by-default behaviour through HOMEBREW_DEVELOPER before the release.
  • Keep HOMEBREW_NO_ASK as the explicit opt-out while the transition is staged.
  • Document and enforce TTY-only confirmation prompts so non-interactive runs keep moving.

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

OpenAI Codex 5.5 xhigh with local review and testing.


- Exercise the upcoming ask-by-default behaviour through
  `HOMEBREW_DEVELOPER` before the release.
- Keep `HOMEBREW_NO_ASK` as the explicit opt-out while the
  transition is staged.
- Document and enforce TTY-only confirmation prompts so
  non-interactive runs keep moving.
Copilot AI review requested due to automatic review settings May 21, 2026 14:10
Copy link
Copy Markdown
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

This PR stages “ask-by-default” behavior behind HOMEBREW_DEVELOPER, keeps HOMEBREW_NO_ASK as an explicit opt-out during the transition, and ensures confirmation prompts only occur when running interactively (TTY), so non-interactive runs continue without blocking.

Changes:

  • Add a custom Homebrew::EnvConfig.ask? implementation: enabled by HOMEBREW_ASK or (by default) HOMEBREW_DEVELOPER, disabled by HOMEBREW_NO_ASK, and only active when stdin/stdout are TTYs.
  • Enforce TTY-only confirmation prompting in Homebrew::Install.ask_input.
  • Update documentation/manpages and shell completions to reflect the refined prompt rules; add/adjust tests covering the new behavior.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
manpages/brew.1 Updates --ask, HOMEBREW_ASK, and HOMEBREW_NO_ASK documentation to match new prompting/default rules.
Library/Homebrew/test/env_config_spec.rb Adds unit tests for the new EnvConfig.ask? semantics (developer default, NO_ASK opt-out, TTY gating).
Library/Homebrew/test/cmd/install_spec.rb Updates/extends tests to cover TTY-only prompting behavior in Install.ask.
Library/Homebrew/install.rb Skips confirmation prompting when stdin/stdout are not TTYs.
Library/Homebrew/env_config.rb Implements custom ask? logic and wires HOMEBREW_ASK into custom implementations.
Library/Homebrew/cmd/upgrade.rb Expands --ask help text to document prompt conditions and TTY behavior.
Library/Homebrew/cmd/reinstall.rb Expands --ask help text to document prompt conditions and TTY behavior.
Library/Homebrew/cmd/install.rb Expands --ask help text to document prompt conditions and TTY behavior.
docs/Manpage.md Mirrors the manpage updates for --ask, HOMEBREW_ASK, and HOMEBREW_NO_ASK.
completions/zsh/_brew Updates --ask completion descriptions to match the new rules.
completions/fish/brew.fish Updates --ask completion descriptions to match the new rules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MikeMcQuaid MikeMcQuaid enabled auto-merge May 21, 2026 14:26
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