-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abort sl root
call if output resembles a steam locomotive
#15053
Conversation
Jest detects whether a repository is a sapling repo by calling the `sl` binary, and getting the output. If `sl` (steam locomotive) is installed, the output of `sl root` 1) takes forever to get and 2) is not the root, but a moving image of a steam locomotive. This change monitors the stdout stream, and aborts the `sl` call if the first character is an escape character, which indicates that the terminal is being cleared to make way for a train to come through. See also: jestjs#14046
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choo-choo-choose to celebrate! 🎊 This bug has been a runaway train 🚆, derailing devs for years since I laid down the tracks for this feature. 🛤️ Let's conduct a thorough inspection 🕵️♂️ and write a test to ensure this patch stays on the right track 🛤️ and doesn't cause any more train wrecks. 💥🚈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is awesome!
Should we set some module scoped variable so we can reuse in findChangedFiles
(and also skip the spawn)?
(in addition, please add a changelog entry 🙂 )
19f4b8f
to
f4a2c13
Compare
Added changelog entry.
Do you mean like this @SimenB? Not sure what we'd be re-using in |
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you! This has long been a pain point, hopefully this is good enough 🙂
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Jest detects whether a repository is a sapling repo by calling the
sl
binary, and getting the output. If
sl
(steam locomotive) is installed,the output of
sl root
1) takes forever to get and 2) is not the root,but a moving image of a steam locomotive. This change monitors the
stdout stream, and aborts the
sl
call if the first character is anescape character, which indicates that the terminal is being cleared to
make way for a train to come through.
See also: #14046
Test plan
This was tested manually. I don't think I have the time to figure out
automated testing for this, as it requires installing a binary, which
means mucking around in the CI code.
With the existing main branch, with
sl
on$PATH
:With the existing main branch, in a repo with sapling roots, with sapling on
$PATH
:With the proposed changes, with
sl
on$PATH
:With the proposed changes, in a repo with sapling roots, with sapling on
$PATH
: