Skip to content

Fix/3592 bypass non interactive flag prompts#3775

Open
kperkins96 wants to merge 2 commits intodlt-hub:develfrom
kperkins96:fix/3592-bypass-non-interactive-flag-prompts
Open

Fix/3592 bypass non interactive flag prompts#3775
kperkins96 wants to merge 2 commits intodlt-hub:develfrom
kperkins96:fix/3592-bypass-non-interactive-flag-prompts

Conversation

@kperkins96
Copy link
Copy Markdown

@kperkins96 kperkins96 commented Mar 23, 2026

Description

Fixes the --non-interactive flag to consistently accept all confirmations instead of using default values. Previously, when --non-interactive was used, CLI commands would still abort if a confirmation's default was False, making the flag unreliable for automation and CI/CD workflows.

Changes:

Behavior:

  • Before: --non-interactive would use the default answer for each prompt (could be True or False)
  • After: --non-interactive always accepts confirmations (True), allowing commands to proceed without user interaction

This makes the flag reliable for CI/CD pipelines and automated scripts where prompts cannot be answered interactively.

Related Issues

Additional Context

Testing:

  • Added test_non_interactive.py
  • New tests use echo.always_choose(False, True) context manager to simulate --non-interactive behavior
  • Ran make format && make lint - all checks pass
  • Ran make test-workspace - all tests pass

Implementation notes:

  • The fix leverages the existing ALWAYS_CHOOSE_VALUE in echo.py
  • When set to True, confirm() and prompt() return True instead of prompting the user
  • The --non-interactive flag only affects behavior when explicitly used - no changes to default CLI behavior

@kperkins96 kperkins96 force-pushed the fix/3592-bypass-non-interactive-flag-prompts branch from 54d8a48 to 3b59e87 Compare March 23, 2026 16:21
@kperkins96 kperkins96 marked this pull request as ready for review March 23, 2026 17:25
@anuunchin anuunchin self-assigned this Apr 8, 2026
Copy link
Copy Markdown
Contributor

@anuunchin anuunchin left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Changing --non-interactive from "use defaults" to "always accept" is a breaking change. Anyone currently using --non-interactive in CI scripts may be relying on destructive commands being safely skipped - which makes sense imo

How about adding a separate --yes / -y flag that sets ALWAYS_CHOOSE_VALUE = True, while leaving --non-interactive unchanged? That would address the reported issue and just be an additive change

@kperkins96
Copy link
Copy Markdown
Author

Added a new --yes / -y flag that automatically accepts all confirmations without prompting and preserved existing --non-interactive behavior.

Changes:

Behavior:

  • --non-interactive (unchanged): Uses each prompt's default value (safe for existing scripts)
  • --yes / -y (new): Always accepts confirmations, allowing commands to proceed without interaction

@kperkins96
Copy link
Copy Markdown
Author

@anuunchin do you mind taking another look when you get a chance? Thanks!

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.

The --non-interactive flag appears to default to “No” for prompt confirmations

2 participants