fix(scripts): stop auto_update hanging on hidden interactive prompts#108
Merged
Conversation
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>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
|
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
make upgrade-managedhung for hours atComposer: 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_cmddiscarded all output but left stdin attached, so composer's interactive prompt (GitHub token / plugin trust) was invisible and blocked forever.run_cmdnow:</dev/null) in quiet and verbose modes — a hidden prompt hits EOF and fails fast instead of hanging; composer commands additionally run--no-interactionSLOW_SECS(default 10s):↳ still running (10s): composer global update --no-interactionTAIL_LINES, default 5 lines, tty-only, ANSI-redrawn in place and cleared on completion)|| trueswallowed everything); failures remain non-fatal for the batch runBoth 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 executingupdate_go); smoke tests pass