Skip to content

🐛 Ignore env git stderr logs#385

Merged
wwilsman merged 1 commit intomasterfrom
ww/fix-env-git-stderr
Jun 22, 2021
Merged

🐛 Ignore env git stderr logs#385
wwilsman merged 1 commit intomasterfrom
ww/fix-env-git-stderr

Conversation

@wwilsman
Copy link
Copy Markdown
Contributor

What is this?

If you look at our CI logs, you'll see plenty of fatal error messages related to git. The root of the message is because the checkout step of our CI does a shallow (0 history) checkout of the repo. When the git command is run with the commit sha, it cannot find the associate commit object and logs this error.

Similarly, if the CLI is run outside of a git repo, git errors are also logged.

Turns out, this is because execSync defaults stderr to inherit rather than pipe which is the default of stdout, stdin, and stdio for spawn functions.

This PR explicitly sets this stdio to ignore stderr, stdin, and pipe stdout.

No test here since the only thing we could write would be "is called with the right stdio options." Which doesn't feel like a useful test anyway since those options aren't likely to change accidentally.

@wwilsman wwilsman added the 🐛 bug Something isn't working label Jun 22, 2021
@wwilsman wwilsman requested a review from Robdel12 June 22, 2021 16:54
Copy link
Copy Markdown
Contributor

@Robdel12 Robdel12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏁

@wwilsman wwilsman merged commit a3599db into master Jun 22, 2021
@wwilsman wwilsman deleted the ww/fix-env-git-stderr branch June 22, 2021 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants