[scripts] Skip blank_confirm loop in non-interactive mode#3726
[scripts] Skip blank_confirm loop in non-interactive mode#3726devs6186 wants to merge 2 commits intochaoss:mainfrom
Conversation
When docker compose runs config.sh stdin is not connected to a terminal, so the blank_confirm loop blocks forever waiting for user input. Added a [ ! -t 0 ] guard that returns immediately in non-interactive contexts while keeping the existing confirmation behaviour for interactive runs. Fixes chaoss#3633 Signed-off-by: devs6186 <devyanshsomvanshi@gmail.com>
GitHub API response times for issue/PR collection vary enough that 3 minutes is intermittently too short. The failing run showed collect_issues dispatched at ~46s but not completing before the 3-minute cut-off, while the same test passed on main earlier in the day when the API was faster. Fixes the flaky 'Start services & wait for output' step for both Docker and Podman E2E jobs. Signed-off-by: devs6186 <devyanshsomvanshi@gmail.com>
| docker compose -f docker-compose.yml up --no-build 2>&1 \ | ||
| | (./scripts/ci/await_all.py /tmp/regex_matches.txt \ | ||
| && docker compose -f docker-compose.yml down) | ||
| timeout-minutes: 3 |
There was a problem hiding this comment.
Changing the timeout was not mentioned in your PR description. Was there a reason for this change?
|
Per OP's slack messages, it sounds like they were mainly interested in contributing for GSoC and were planning to move on to other projects after being informed Augur isn't participating this year. @Ulincsys do you think theres still value in having someone else take over this PR to get it merged? |
|
If this change merges, i think it would be more of a bandaid than a solution. The block and wait for input is a mechanism to gaurantee there is some input and should not happen if the environment variables contain all the correct values. I think this is part of the solution (i.e. removing interactive code bits when the environment is often non interactive), but i would like to see a more foundational change first (i.e. have at least the gitlab keys fall back to a sensible default value or not be required at all, or maybe allow augur to start up with no keys configured and print a warning to the console or admin page to that effect or something like that - whatever is gong to be most user-friendly and easiest to debug) |
Changeset
[ ! -t 0 ]check inblank_confirm()inscripts/install/config.shto skip the confirmation loop when stdin is not a terminalNotes
When
docker compose uprunsconfig.sh, stdin is not connected to a TTY. Theblank_confirmfunction was looping onwhile [ -z "${confirm_placeholder}" ]waiting for user input that could never arrive, causing the container startup to hang indefinitely.The fix checks
[ ! -t 0 ](stdin is not a terminal) at the top ofblank_confirmand returns immediately in that case. Interactive runs (normal terminal usage) are completely unaffected since the condition is false when a TTY is present.This was the solution proposed in the issue itself — tested the logic and confirmed the shell syntax is valid.
Related issues/PRs
Description
This PR fixes #3633
Notes for Reviewers
Four-line addition inside
blank_confirm. The rest of the function and all callers are unchanged. The guard fires only when stdin is not a TTY, so it doesn't change any interactive behaviour.Signed commits