[WIP] Update to Gitbase v0.20.0 - #439
Conversation
247c1eb to
c273f26
Compare
|
The tests are failing due to a bug that will be fixed by #432. |
|
Looks good so far. |
c273f26 to
0e26c76
Compare
|
@carlosms thanks I didn't notice. To simplify review I've just rebased to master to solve conflicts, gonna address the tests now and also update to |
| return humanizef(err, "could not start gitbase") | ||
| } | ||
|
|
||
| if err := docker.EnsureInstalled(components.MysqlCli.Image, components.MysqlCli.Version); err != nil { |
There was a problem hiding this comment.
this function has name startGitbaseWithClient but it doesn't start client anymore. Just gitbase.
| } | ||
|
|
||
| defer func() { | ||
| err = term.RestoreTerminal(fd, prevState) |
There was a problem hiding this comment.
this error is never returned from the function
There was a problem hiding this comment.
refactored this part here. It should be clearer now and the code is more decoupled.
| return &insResp, nil | ||
| } | ||
|
|
||
| func withRawTerminal(in io.ReadCloser, fn func() error) func() error { |
There was a problem hiding this comment.
the name of this function and arguments below are a little confusing. withRawTerminal and rawTerminal. But actually you pass true and call this function even for non-terminal.
| err := docker.RemoveContainer(components.MysqlCli.Name) | ||
| if err != nil { | ||
| log.Warningf("could not stop mysql client: %v", err) | ||
| if insResp.ExitCode != 0 { |
There was a problem hiding this comment.
not sure if we have tests for it. What happens when you exit with ctrl-c or ctrl-d? Does it exit correctly with exit code 0?
There was a problem hiding this comment.
Nice catch! Now it exits with 0 on ctrl-d but not on ctrl-c. Gonna try adding a test for these.
There was a problem hiding this comment.
maybe it's okay to exit with error on ctrl-c in this case
aef630a to
4e151e4
Compare
|
|
||
| return fn() | ||
| } | ||
| type stdioAttaccher struct { |
| // characters | ||
| prevState, err = term.SetRawTerminal(fd) | ||
| if err != nil { | ||
| done <- err |
There was a problem hiding this comment.
😮 eagle's eye! thanks for noticing
| prevState, err = term.SetRawTerminal(fd) | ||
| if err != nil { | ||
| done <- err | ||
| go func() { |
There was a problem hiding this comment.
maybe it's better to make the channel buffered?
There was a problem hiding this comment.
Even if in this case would slightly increase readability, I think that using an unbuffered channel keeps the code simpler compared to the readability gain of using a buffered channel.
There was a problem hiding this comment.
what exactly do you see as a downside of a buffered channel?
There was a problem hiding this comment.
it's just an easier model to think 😄
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
… containers Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
…cess Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
I've separatead the starting of a component into a different function so that it can be used by other commands as well. Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
c39c87b to
0369669
Compare
|
Rebased on |
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
Signed-off-by: Lou Marvin Caraig <loumarvincaraig@gmail.com>
|
Updated to |
Closes #424.
Marked as WIP as waiting for final Gitbase v0.20.0 release.
This PR removes the
MysqlClicomponent and uses the MySql client provided byGitbaseitself.