screwdriver
screwdriver copied to clipboard
Last line of logs do not shown on screen if the step requires user input
What happened:
Last line of logs do not appear when a step requires user input at build screen.
What you expected to happen:
Logs are shown even if build requires user's input.
How to reproduce it:
Create pipeline with the screwdriver.yaml below.
shared:
image: node:8
jobs:
main:
requires: [ "~pr", "~commit" ]
steps:
- test: |
apt-get update
apt-get install vim
Then build it.
The logs, Do you want to continue? [Y/n]
, do not shown in log area of build screen.
The user cannot understand why the step gets stuck.
What I investigated:
Log output gets stuck at here
Ideas to solve this issue
Now I think there are two solution. Solution1 is feasible but not elegant. Solution2 seems to be good, but I can't find the way to do that.
So, Solution1 is the most likely candidate.
Anyway, if you have ideas to solve it, let me know :pray:
Solution1:
Use ReadByte
instead of ReadLine
at here.
When new line do not appear on pty for some seconds, launch sends bytes to emitter.
UI also might have to be modified for this solution, especially the last line of logs. It needs to modify around here
Solution2:
Use non interactive terminal. (Need to think pseudo teminal option around here, but I cannot find the method)
Solution2 looks good, but I do not know how to do it. If we have the prospect of being able to implement Solution1, it should be ok.
Solution2 +1 I'll check if we can run a shell as non-interactive mode on pty library.
I think that Solution2 maybe very hard. Because launcher runs a pty and executes steps separately on it to pass env between steps. For this behavior, pty may need to be run interactively.
Therefore, I suggest improved Solution1.
If the logs stuck (when new line do not appear on pty for some minutes), Screwdriver.cd shows messages in the build page like below.
I think it is also OK to show only message If the last log which is not appeared in the log area cannot be got.
How about this Solution?
Sounds good to me 👍 There are many situation that requires user interaction. It would be great if the last line shows on anywhere on webui not limited to the log pane.
Another side effect of using an interactive shell is that programs like wget, git, webpack, npm all act differently when in an interactive TTY.
Eg: git diff
uses less
for pager, which leads to build time out.