This commit is contained in:
2026-01-21 15:08:22 -08:00
parent 3c19109222
commit da2bff8cd4
4 changed files with 116 additions and 7 deletions

View File

@@ -3828,10 +3828,43 @@ def check_url_exists_in_storage(
except Exception:
cm = nullcontext()
auto_confirm_reason: Optional[str] = None
if in_pipeline and stage_ctx is not None:
try:
total_stages = int(getattr(stage_ctx, "total_stages", 0))
except Exception:
total_stages = 0
try:
is_last_stage = bool(getattr(stage_ctx, "is_last_stage", False))
except Exception:
is_last_stage = False
if total_stages > 1 and not is_last_stage:
auto_confirm_reason = "pipeline stage (pre-last)"
if auto_confirm_reason is None:
try:
stdin_interactive = bool(sys.stdin and sys.stdin.isatty())
except Exception:
stdin_interactive = False
if not stdin_interactive:
auto_confirm_reason = "non-interactive stdin"
answered_yes = True
with cm:
get_stderr_console().print(table)
setattr(table, "_rendered_by_cmdlet", True)
answered_yes = bool(Confirm.ask("Continue anyway?", default=False, console=get_stderr_console()))
if auto_confirm_reason is None:
answered_yes = bool(Confirm.ask("Continue anyway?", default=False, console=get_stderr_console()))
else:
debug(
f"Bulk URL preflight auto-confirmed duplicates ({auto_confirm_reason}); continuing without user input."
)
try:
log(
f"Auto-confirmed duplicate URL warning ({auto_confirm_reason}). Continuing...",
file=sys.stderr,
)
except Exception:
pass
if in_pipeline:
try: