Skip to content

fix(scripts): stop auto_update hanging on hidden interactive prompts#108

Merged
CybotTM merged 1 commit into
mainfrom
fix/auto-update-hidden-prompts
Jul 16, 2026
Merged

fix(scripts): stop auto_update hanging on hidden interactive prompts#108
CybotTM merged 1 commit into
mainfrom
fix/auto-update-hidden-prompts

Conversation

@CybotTM

@CybotTM CybotTM commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

make upgrade-managed hung for hours at Composer: Update global packages. Diagnosis on the live process: the composer child sat in a terminal read (wait_woken, fd 0 → /dev/pts/0, fd 1/2 → /dev/null) — run_cmd discarded all output but left stdin attached, so composer's interactive prompt (GitHub token / plugin trust) was invisible and blocked forever.

run_cmd now:

  • detaches stdin (</dev/null) in quiet and verbose modes — a hidden prompt hits EOF and fails fast instead of hanging; composer commands additionally run --no-interaction
  • announces the actual command once it runs longer than SLOW_SECS (default 10s): ↳ still running (10s): composer global update --no-interaction
  • shows a rolling output tail (TAIL_LINES, default 5 lines, tty-only, ANSI-redrawn in place and cleared on completion)
  • surfaces failures: exit code + last 20 output lines (previously || true swallowed everything); failures remain non-fatal for the batch run

Both thresholds are env-tunable: SLOW_SECS=5 TAIL_LINES=10 make upgrade-managed.

Tests

  • tests/test_auto_update_run_cmd.py (7 tests, red→green): stdin detach in both modes (held-open pipe simulating an attached terminal), slow-command notice shows the real command, fast commands stay quiet, failure output + exit code surfaced, success output stays quiet, dry-run prints without executing
  • Full suite: 680 passed, 1 skipped; shellcheck clean (also fixes a pre-existing SC2155 in update_go); smoke tests pass

composer global update inside make upgrade-managed blocked for hours:
run_cmd discarded stdout/stderr but left stdin attached to the terminal,
so composer's prompt was invisible and waited forever for an answer.

run_cmd now:
- detaches stdin (</dev/null) in quiet, verbose, and background modes so
  a hidden prompt hits EOF instead of blocking; composer additionally
  gets --no-interaction
- announces the actual command after SLOW_SECS (default 10s)
- shows a rolling TAIL_LINES-line output tail on ttys (default 5),
  cleared when the command finishes
- prints the exit code and last 20 output lines when a command fails
  (previously swallowed by || true); failures stay non-fatal

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Copilot AI review requested due to automatic review settings July 16, 2026 22:12
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

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

Scanned Files

None

@sonarqubecloud

Copy link
Copy Markdown

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.45%. Comparing base (cd3c011) to head (d26ae4a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #108   +/-   ##
=======================================
  Coverage   72.45%   72.45%           
=======================================
  Files          22       22           
  Lines        3402     3402           
=======================================
  Hits         2465     2465           
  Misses        937      937           
Flag Coverage Δ
unittests 72.45% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CybotTM
CybotTM merged commit 85de1c0 into main Jul 16, 2026
21 of 22 checks passed
@CybotTM
CybotTM deleted the fix/auto-update-hidden-prompts branch July 16, 2026 22:28
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