github / gh-valet

Valet helps facilitate the migration of Azure DevOps, CircleCI, GitLab CI, Jenkins, and Travis CI pipelines to GitHub Actions.
MIT License
510 stars 35 forks source link

Don't write stdout and stderr in parallel #82

Closed luke-engle closed 2 years ago

luke-engle commented 2 years ago

What's changing?

gh valet was writing stdout and stderr to the console in parallel. This meant if there was an error that happened while we were writing to stdout, we got mangled text in the console. For example: WARNING! Your password will be stored unencLogin rypted in /home/codespace/.dockerSucceeded.

This change adds a lock to the ReadStream method to prevent both streams from writing at the same time.

How's this tested?

Before this change πŸ‘‡

➜ echo "<GH PAT>" | gh valet update --username luke-engle --password-stdin                                      
LWAogin SucceeRded
NING! Your password will be stored unencrypted in /Users/lukeengle/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

latest: Pulling from valet-customers/valet-cli
...

After this change πŸ‘‡

➜ echo "<GH PAT>" | dotnet run --project src/Valet/Valet.csproj -- update --username luke-engle --password-stdin
WARNING! Your password will be stored unencrypted in /Users/lukeengle/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
latest: Pulling from valet-customers/valet-cli
...

Closes #79

github-actions[bot] commented 2 years ago

Unit Test Results

35 tests  Β±0   35 :heavy_check_mark: Β±0   0s :stopwatch: Β±0s βŸβ€„1 suites Β±0β€‚β€ƒβ€ƒβŸβ€„0 :zzz: Β±0  βŸβ€„1 files   Β±0β€‚β€ƒβ€ƒβŸβ€„0 :x: Β±0 

Results for commit e99732c5. ± Comparison against base commit 57d429d9.

:recycle: This comment has been updated with latest results.