Refactor UI package#277
Conversation
Fix order of env sources
Release v0.36.0
Release v0.37.0
It was leftover from the ui package refactor.
It's no longer needed now that the isPiped logic is moved to a helper function.
They aren't used outside the package and have accessor functions so there's no need for them to be public.
This should display the jobs as verify-build-<os>-<arch> instead of verify-build-<arch>-<os>.
|
Build verification is introduced in #278. |
It is weird to reuse the same struct for different implementations of an interface, while it is also possible to give them all a separate struct. This is way cleaner.
These names better describe the abstraction. Stdin and Stdout describe the implementation, not the interface.
This allows direct interfacing with stdin and stdout for some specific use-cases.
This has not been used for a long time and it has some compatibility issues with the ui update. So we can just as well delete it.
|
I think I fixed most of the issues. Could use some manual testing to verify whether it actually works on all platforms. |
|
I believe #274 was also introduced to fix a bug, there is a package (I believe in the standard library) that changes its behavior based on the passed Writer being This shows the importance of descriptive and complete PR messages. @Marton6 Do you remember which bug and package this was about exactly? |
SimonBarendse
left a comment
There was a problem hiding this comment.
It's not clear to me which changes are required to fix the build and which are just refactors. I hope the questions I asked below clear things up, if not, let's have a quick call.
The exec package checks if an os.File is passed. So we should explicitly set Stdout and not a wrapped writer.
These names better describe the abstraction. Stdin and Stdout are implementations of input and output. The interface should not describe the implementation.
This allows us to use t.Cleanup()
The command ran by secrethub run writes to Stdout() instead of Output(). The test should reflect that to succeed.
Revert "Refactor ui package"
Add build verification to CircleCI
Update Go SDK to v0.28.0
|
Removed the Changeset itself is still relevant. |
Release v0.38.0
Update Go version in Dockerfile – to develop
This makes it possible to mock this functionality in tests.
The interface really needed some comments.
|
Since this is not really useful on itself, I am merging it into #269. |
d6ae37b to
e6ed6df
Compare
|
@jpcoenen feel free to merge when you feel it's ready |
This started out as a fix for the build problems introduced in #274, but ended up as a refactor of the
uipackage.The main changes:
ui.IOinterface changed from:to:
This allows users of the interface to explicitly request the underlying
stdinorstdoutfile when they need it (for example, when spawning a child process). Also the naming ofIsInputPipedandIsOutputPipedbetter describes the interface thanIsStdinPipedandIsStdoutPiped.standardIO,windowsIOandttyIO) instead of a single struct with different fields set.This replaces the changes from #274.